Socket
Socket
Sign inDemoInstall

multimatch

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

multimatch - npm Package Compare versions

Comparing version 5.0.0 to 6.0.0

13

index.d.ts
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;

@@ -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

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