multimatch
Advanced tools
Comparing version 0.3.0 to 1.0.0
@@ -20,9 +20,12 @@ 'use strict'; | ||
return patterns.reduce(function (ret, pattern, i) { | ||
return patterns.reduce(function (ret, pattern) { | ||
var process = union; | ||
if (pattern[0] === '!') { | ||
return diff(ret, minimatch.match(ret, pattern.slice(1), options)); | ||
pattern = pattern.slice(1); | ||
process = diff; | ||
} | ||
return union(ret, minimatch.match(list, pattern, options)); | ||
return process(ret, minimatch.match(list, pattern, options)); | ||
}, []); | ||
}; |
{ | ||
"name": "multimatch", | ||
"version": "0.3.0", | ||
"version": "1.0.0", | ||
"description": "Extends minimatch.match() with support for multiple patterns", | ||
@@ -41,5 +41,5 @@ "license": "MIT", | ||
"dependencies": { | ||
"array-differ": "^0.1.0", | ||
"array-union": "^0.1.0", | ||
"minimatch": "^0.3.0" | ||
"array-differ": "^1.0.0", | ||
"array-union": "^1.0.0", | ||
"minimatch": "^1.0.0" | ||
}, | ||
@@ -46,0 +46,0 @@ "devDependencies": { |
@@ -6,17 +6,2 @@ # multimatch [![Build Status](https://travis-ci.org/sindresorhus/multimatch.svg?branch=master)](https://travis-ci.org/sindresorhus/multimatch) | ||
#### Comparison | ||
Minimatch: | ||
```js | ||
minimatch.match(['unicorn', 'cake', 'rainbows'], '*corn'); | ||
``` | ||
Multimatch: | ||
```js | ||
multimatch(['unicorn', 'cake', 'rainbows'], ['*corn', 'rain*']); | ||
``` | ||
## Install | ||
@@ -47,4 +32,20 @@ | ||
## Globbing patterns | ||
Just a quick overview. | ||
- `*` matches any number of characters, but not `/` | ||
- `?` matches a single character, but not `/` | ||
- `**` matches any number of characters, including `/`, as long as it's the only thing in a path part | ||
- `{}` allows for a comma-separated list of "or" expressions | ||
- `!` at the beginning of a pattern will negate the match | ||
## Related | ||
See [globby](https://github.com/sindresorhus/globby) if you need to match against the filesystem instead of a list. | ||
## License | ||
MIT © [Sindre Sorhus](http://sindresorhus.com), [Jon Schlinkert](https://github.com/jonschlinkert) |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
2928
23
1
50
+ Addedarray-differ@1.0.0(transitive)
+ Addedarray-union@1.0.2(transitive)
+ Addedarray-uniq@1.0.3(transitive)
+ Addedminimatch@1.0.0(transitive)
- Removedarray-differ@0.1.0(transitive)
- Removedarray-union@0.1.0(transitive)
- Removedarray-uniq@0.1.1(transitive)
- Removedminimatch@0.3.0(transitive)
Updatedarray-differ@^1.0.0
Updatedarray-union@^1.0.0
Updatedminimatch@^1.0.0