Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

extglob

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extglob - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

5

index.js

@@ -7,3 +7,2 @@ 'use strict';

var debug = require('debug')('extglob');
var extend = require('extend-shallow');

@@ -39,5 +38,3 @@ var unique = require('array-unique');

function extglob(pattern, options) {
debug('initializing from <%s>', __filename);
var res = extglob.create(pattern, options);
return res.output;
return extglob.create(pattern, options).output;
}

@@ -44,0 +41,0 @@

43

lib/compilers.js

@@ -10,3 +10,11 @@ 'use strict';

module.exports = function(extglob) {
var star = extglob.options.star || '.*?';
function star() {
if (typeof extglob.options.star === 'function') {
return extglob.options.star.apply(this, arguments);
}
if (typeof extglob.options.star === 'string') {
return extglob.options.star;
}
return '.*?';
}

@@ -91,3 +99,3 @@ /**

return this.emit(prefix + star, node);
return this.emit(prefix + star.call(this, node), node);
})

@@ -100,3 +108,2 @@

.set('paren', function(node) {
node.prev = this.prev();
return this.mapVisit(node.nodes);

@@ -109,9 +116,10 @@ })

return this.emit('(?:(?!(?:', node);
case '@':
case '*':
case '+':
case '*':
case '?':
case '@':
return this.emit('(', node);
default: {
return this.emit(node.val, node);
var val = (this.options.bash === true ? '\\' : '') + node.val;
return this.emit(val, node);
}

@@ -121,20 +129,15 @@ }

.set('paren.close', function(node) {
if (!node.parent.prev) {
return this.emit('\\' + node.val, node);
}
switch (node.prefix) {
case '!':
case '^':
var rest = node.rest;
var val = !this.options.bash
? '))' + star + ')'
: ').)*$)';
var prefix = /^(\)|$)/.test(node.rest) ? '$' : '';
var str = star.call(this, node);
var boundary = !rest || /^[).]/.test(rest);
if (!node.suffix && !this.options.bash && boundary) {
val = '$' + val;
// if the extglob has a slash explicitly defined, we know the user wants
// to match slashes, so we need to change the "star" regex accordingly
if (node.parent.hasSlash && !this.options.star && this.options.slash !== false) {
str = '.*?';
}
return this.emit(val, node);
return this.emit(prefix + ('))' + str + ')'), node);
case '+':

@@ -147,4 +150,6 @@ return this.emit(')+', node);

case '@':
return this.emit(')', node);
default: {
return this.emit(')', node);
var val = (this.options.bash === true ? '\\' : '') + ')';
return this.emit(val, node);
}

@@ -151,0 +156,0 @@ }

@@ -10,3 +10,2 @@ 'use strict';

var extend = require('extend-shallow');
var debug = require('debug')('extglob');

@@ -25,3 +24,2 @@ /**

function Extglob(options) {
debug('initializing from <%s>', __filename);
this.options = extend({source: 'extglob'}, options);

@@ -28,0 +26,0 @@ this.snapdragon = this.options.snapdragon || new Snapdragon(this.options);

@@ -5,2 +5,7 @@ 'use strict';

var Cache = require('fragment-cache');
/**
* Utils
*/
var utils = module.exports;

@@ -7,0 +12,0 @@ var cache = utils.cache = new Cache();

{
"name": "extglob",
"description": "Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns.",
"version": "1.0.0",
"version": "1.1.0",
"homepage": "https://github.com/jonschlinkert/extglob",

@@ -30,3 +30,2 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",

"array-unique": "^0.3.2",
"debug": "^2.2.0",
"define-property": "^0.2.5",

@@ -100,2 +99,2 @@ "expand-brackets": "^2.0.1",

}
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc