multimatch
Advanced tools
Comparing version 5.0.0 to 6.0.0
import {IOptions} from 'minimatch'; | ||
declare namespace multimatch { | ||
type Options = Readonly<IOptions>; | ||
} | ||
export type Options = Readonly<IOptions>; | ||
@@ -10,3 +8,3 @@ /** | ||
@param paths - Paths to match against. | ||
@param paths - The paths to match against. | ||
@param patterns - Globbing patterns to use. For example: `['*', '!cake']`. See supported [`minimatch` patterns](https://github.com/isaacs/minimatch#usage). | ||
@@ -17,3 +15,3 @@ @returns The matching paths in the order of input paths. | ||
``` | ||
import multimatch = require('multimatch'); | ||
import multimatch from 'multimatch'; | ||
@@ -24,8 +22,7 @@ multimatch(['unicorn', 'cake', 'rainbows'], ['*', '!cake']); | ||
*/ | ||
declare function multimatch( | ||
export default function multimatch( | ||
paths: string | readonly string[], | ||
patterns: string | readonly string[], | ||
options?: multimatch.Options | ||
options?: Options | ||
): string[]; | ||
export = multimatch; |
16
index.js
@@ -1,10 +0,8 @@ | ||
'use strict'; | ||
const minimatch = require('minimatch'); | ||
const arrayUnion = require('array-union'); | ||
const arrayDiffer = require('array-differ'); | ||
const arrify = require('arrify'); | ||
import minimatch from 'minimatch'; | ||
import arrayUnion from 'array-union'; | ||
import arrayDiffer from 'array-differ'; | ||
module.exports = (list, patterns, options = {}) => { | ||
list = arrify(list); | ||
patterns = arrify(patterns); | ||
export default function multimatch(list, patterns, options = {}) { | ||
list = [list].flat(); | ||
patterns = [patterns].flat(); | ||
@@ -30,2 +28,2 @@ if (list.length === 0 || patterns.length === 0) { | ||
return result; | ||
}; | ||
} |
{ | ||
"name": "multimatch", | ||
"version": "5.0.0", | ||
"version": "6.0.0", | ||
"description": "Extends `minimatch.match()` with support for multiple patterns", | ||
@@ -13,4 +13,6 @@ "license": "MIT", | ||
}, | ||
"type": "module", | ||
"exports": "./index.js", | ||
"engines": { | ||
"node": ">=10" | ||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0" | ||
}, | ||
@@ -38,13 +40,12 @@ "scripts": { | ||
"dependencies": { | ||
"@types/minimatch": "^3.0.3", | ||
"array-differ": "^3.0.0", | ||
"array-union": "^2.1.0", | ||
"arrify": "^2.0.1", | ||
"@types/minimatch": "^3.0.5", | ||
"array-differ": "^4.0.0", | ||
"array-union": "^3.0.1", | ||
"minimatch": "^3.0.4" | ||
}, | ||
"devDependencies": { | ||
"ava": "^2.4.0", | ||
"tsd": "^0.13.1", | ||
"xo": "^0.33.1" | ||
"ava": "^3.15.0", | ||
"tsd": "^0.18.0", | ||
"xo": "^0.45.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# multimatch [![Build Status](https://travis-ci.com/sindresorhus/multimatch.svg?branch=master)](https://travis-ci.com/github/sindresorhus/multimatch) | ||
# multimatch | ||
@@ -7,5 +7,5 @@ > Extends [`minimatch.match()`](https://github.com/isaacs/minimatch#minimatchmatchlist-pattern-options) with support for multiple patterns | ||
```sh | ||
npm install multimatch | ||
``` | ||
$ npm install multimatch | ||
``` | ||
@@ -15,3 +15,3 @@ ## Usage | ||
```js | ||
const multimatch = require('multimatch'); | ||
import multimatch from 'multimatch'; | ||
@@ -22,3 +22,3 @@ multimatch(['unicorn', 'cake', 'rainbows'], ['*', '!cake']); | ||
See the [tests](https://github.com/sindresorhus/multimatch/tree/master/test) for more usage examples and expected matches. | ||
See the [tests](test) for more usage examples and expected matches. | ||
@@ -35,3 +35,3 @@ ## API | ||
Paths to match against. | ||
The paths to match against. | ||
@@ -57,3 +57,3 @@ #### patterns | ||
Therefore a lone negation (e.g. `['!foo']`) will never match anything – use `['*', '!foo']` instead. | ||
Therefore a lone negation (e.g. `['!foo']`) will never match anything. Use `['*', '!foo']` instead. | ||
@@ -60,0 +60,0 @@ ## Globbing patterns |
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
4
Yes
5784
41
+ Addedarray-differ@4.0.0(transitive)
+ Addedarray-union@3.0.1(transitive)
- Removedarrify@^2.0.1
- Removedarray-differ@3.0.0(transitive)
- Removedarray-union@2.1.0(transitive)
- Removedarrify@2.0.1(transitive)
Updated@types/minimatch@^3.0.5
Updatedarray-differ@^4.0.0
Updatedarray-union@^3.0.1