Comparing version 5.0.15 to 6.0.1
@@ -39,2 +39,3 @@ exports.alphasort = alphasort | ||
// ignore patterns are always in dot:true mode. | ||
function ignoreMap (pattern) { | ||
@@ -44,7 +45,7 @@ var gmatcher = null | ||
var gpattern = pattern.replace(/(\/\*\*)+$/, '') | ||
gmatcher = new Minimatch(gpattern) | ||
gmatcher = new Minimatch(gpattern, { dot: true }) | ||
} | ||
return { | ||
matcher: new Minimatch(pattern), | ||
matcher: new Minimatch(pattern, { dot: true }), | ||
gmatcher: gmatcher | ||
@@ -110,5 +111,4 @@ } | ||
// passes in false as the option. | ||
options.nonegate = options.nonegate === false ? false : true | ||
options.nocomment = options.nocomment === false ? false : true | ||
deprecationWarning(options) | ||
options.nonegate = true | ||
options.nocomment = true | ||
@@ -119,21 +119,2 @@ self.minimatch = new Minimatch(pattern, options) | ||
// TODO(isaacs): remove entirely in v6 | ||
// exported to reset in tests | ||
exports.deprecationWarned | ||
function deprecationWarning(options) { | ||
if (!options.nonegate || !options.nocomment) { | ||
if (process.noDeprecation !== true && !exports.deprecationWarned) { | ||
var msg = 'glob WARNING: comments and negation will be disabled in v6' | ||
if (process.throwDeprecation) | ||
throw new Error(msg) | ||
else if (process.traceDeprecation) | ||
console.trace(msg) | ||
else | ||
console.error(msg) | ||
exports.deprecationWarned = true | ||
} | ||
} | ||
} | ||
function finish (self) { | ||
@@ -140,0 +121,0 @@ var nou = self.nounique |
@@ -5,3 +5,3 @@ { | ||
"description": "a little globber", | ||
"version": "5.0.15", | ||
"version": "6.0.1", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
@@ -77,10 +77,2 @@ [![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Dependency Status](https://david-dm.org/isaacs/node-glob.svg)](https://david-dm.org/isaacs/node-glob) [![devDependency Status](https://david-dm.org/isaacs/node-glob/dev-status.svg)](https://david-dm.org/isaacs/node-glob#info=devDependencies) [![optionalDependency Status](https://david-dm.org/isaacs/node-glob/optional-status.svg)](https://david-dm.org/isaacs/node-glob#info=optionalDependencies) | ||
### Negation | ||
The intent for negation would be for a pattern starting with `!` to | ||
match everything that *doesn't* match the supplied pattern. However, | ||
the implementation is weird, and for the time being, this should be | ||
avoided. The behavior is deprecated in version 5, and will be removed | ||
entirely in version 6. | ||
### Empty Sets | ||
@@ -118,7 +110,7 @@ | ||
* `pattern` {String} Pattern to be matched | ||
* `options` {Object} | ||
* `cb` {Function} | ||
* `err` {Error | null} | ||
* `matches` {Array<String>} filenames found matching the pattern | ||
* `pattern` `{String}` Pattern to be matched | ||
* `options` `{Object}` | ||
* `cb` `{Function}` | ||
* `err` `{Error | null}` | ||
* `matches` `{Array<String>}` filenames found matching the pattern | ||
@@ -129,5 +121,5 @@ Perform an asynchronous glob search. | ||
* `pattern` {String} Pattern to be matched | ||
* `options` {Object} | ||
* return: {Array<String>} filenames found matching the pattern | ||
* `pattern` `{String}` Pattern to be matched | ||
* `options` `{Object}` | ||
* return: `{Array<String>}` filenames found matching the pattern | ||
@@ -150,7 +142,7 @@ Perform a synchronous glob search. | ||
* `pattern` {String} pattern to search for | ||
* `options` {Object} | ||
* `cb` {Function} Called when an error occurs, or matches are found | ||
* `err` {Error | null} | ||
* `matches` {Array<String>} filenames found matching the pattern | ||
* `pattern` `{String}` pattern to search for | ||
* `options` `{Object}` | ||
* `cb` `{Function}` Called when an error occurs, or matches are found | ||
* `err` `{Error | null}` | ||
* `matches` `{Array<String>}` filenames found matching the pattern | ||
@@ -171,4 +163,4 @@ Note that if the `sync` flag is set in the options, then matches will | ||
* `true` - Path exists | ||
* `'DIR'` - Path exists, and is not a directory | ||
* `'FILE'` - Path exists, and is a directory | ||
* `'FILE'` - Path exists, and is not a directory | ||
* `'DIR'` - Path exists, and is a directory | ||
* `[file, entries, ...]` - Path exists, is a directory, and the | ||
@@ -190,3 +182,4 @@ array value is the results of `fs.readdir` | ||
are sorted, unless the `nosort` flag is set. | ||
* `match` Every time a match is found, this is emitted with the matched. | ||
* `match` Every time a match is found, this is emitted with the specific | ||
thing that matched. It is not deduplicated or resolved to a realpath. | ||
* `error` Emitted when an unexpected error is encountered, or whenever | ||
@@ -273,3 +266,5 @@ any fs error occurs if `options.strict` is set. | ||
*only* directories, simply put a `/` at the end of the pattern.) | ||
* `ignore` Add a pattern or an array of patterns to exclude matches. | ||
* `ignore` Add a pattern or an array of glob patterns to exclude matches. | ||
Note: `ignore` patterns are *always* in `dot:true` mode, regardless | ||
of any other settings. | ||
* `follow` Follow symlinked directories when expanding `**` patterns. | ||
@@ -282,6 +277,2 @@ Note that this can result in a lot of duplicate references in the | ||
broken symlink) | ||
* `nonegate` Suppress deprecated `negate` behavior. (See below.) | ||
Default=true | ||
* `nocomment` Suppress deprecated `comment` behavior. (See below.) | ||
Default=true | ||
@@ -319,18 +310,9 @@ ## Comparisons to other fnmatch/glob implementations | ||
**Note**: In version 5 of this module, negation and comments are | ||
**disabled** by default. You can explicitly set `nonegate:false` or | ||
`nocomment:false` to re-enable them. They are going away entirely in | ||
version 6. | ||
Previously, this module let you mark a pattern as a "comment" if it | ||
started with a `#` character, or a "negated" pattern if it started | ||
with a `!` character. | ||
The intent for negation would be for a pattern starting with `!` to | ||
match everything that *doesn't* match the supplied pattern. However, | ||
the implementation is weird. It is better to use the `ignore` option | ||
to set a pattern or set of patterns to exclude from matches. If you | ||
want the "everything except *x*" type of behavior, you can use `**` as | ||
the main pattern, and set an `ignore` for the things to exclude. | ||
These options were deprecated in version 5, and removed in version 6. | ||
The comments feature is added in minimatch, primarily to more easily | ||
support use cases like ignore files, where a `#` at the start of a | ||
line makes the pattern "empty". However, in the context of a | ||
straightforward filesystem globber, "comments" don't make much sense. | ||
To specify things that should not match, use the `ignore` option. | ||
@@ -337,0 +319,0 @@ ## Windows |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51968
1182
360