aboutsummaryrefslogtreecommitdiff
path: root/node_modules/matcher
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/matcher')
-rw-r--r--node_modules/matcher/index.js69
-rw-r--r--node_modules/matcher/license9
-rw-r--r--node_modules/matcher/package.json47
-rw-r--r--node_modules/matcher/readme.md104
4 files changed, 0 insertions, 229 deletions
diff --git a/node_modules/matcher/index.js b/node_modules/matcher/index.js
deleted file mode 100644
index 33e4e1532..000000000
--- a/node_modules/matcher/index.js
+++ /dev/null
@@ -1,69 +0,0 @@
-'use strict';
-const escapeStringRegexp = require('escape-string-regexp');
-
-const reCache = new Map();
-
-function makeRe(pattern, options) {
- const opts = Object.assign({
- caseSensitive: false
- }, options);
-
- const cacheKey = pattern + JSON.stringify(opts);
-
- if (reCache.has(cacheKey)) {
- return reCache.get(cacheKey);
- }
-
- const negated = pattern[0] === '!';
-
- if (negated) {
- pattern = pattern.slice(1);
- }
-
- pattern = escapeStringRegexp(pattern).replace(/\\\*/g, '.*');
-
- const re = new RegExp(`^${pattern}$`, opts.caseSensitive ? '' : 'i');
- re.negated = negated;
- reCache.set(cacheKey, re);
-
- return re;
-}
-
-module.exports = (inputs, patterns, options) => {
- if (!(Array.isArray(inputs) && Array.isArray(patterns))) {
- throw new TypeError(`Expected two arrays, got ${typeof inputs} ${typeof patterns}`);
- }
-
- if (patterns.length === 0) {
- return inputs;
- }
-
- const firstNegated = patterns[0][0] === '!';
-
- patterns = patterns.map(x => makeRe(x, options));
-
- const ret = [];
-
- for (const input of inputs) {
- // If first pattern is negated we include everything to match user expectation
- let matches = firstNegated;
-
- for (const pattern of patterns) {
- if (pattern.test(input)) {
- matches = !pattern.negated;
- }
- }
-
- if (matches) {
- ret.push(input);
- }
- }
-
- return ret;
-};
-
-module.exports.isMatch = (input, pattern, options) => {
- const re = makeRe(pattern, options);
- const matches = re.test(input);
- return re.negated ? !matches : matches;
-};
diff --git a/node_modules/matcher/license b/node_modules/matcher/license
deleted file mode 100644
index e7af2f771..000000000
--- a/node_modules/matcher/license
+++ /dev/null
@@ -1,9 +0,0 @@
-MIT License
-
-Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/matcher/package.json b/node_modules/matcher/package.json
deleted file mode 100644
index 7fe40a112..000000000
--- a/node_modules/matcher/package.json
+++ /dev/null
@@ -1,47 +0,0 @@
-{
- "name": "matcher",
- "version": "1.1.1",
- "description": "Simple wildcard matching",
- "license": "MIT",
- "repository": "sindresorhus/matcher",
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "sindresorhus.com"
- },
- "engines": {
- "node": ">=4"
- },
- "scripts": {
- "test": "xo && ava",
- "bench": "matcha bench.js"
- },
- "files": [
- "index.js"
- ],
- "keywords": [
- "matcher",
- "matching",
- "match",
- "regex",
- "regexp",
- "regular",
- "expression",
- "wildcard",
- "pattern",
- "string",
- "filter",
- "glob",
- "globber",
- "globbing",
- "minimatch"
- ],
- "dependencies": {
- "escape-string-regexp": "^1.0.4"
- },
- "devDependencies": {
- "ava": "*",
- "matcha": "^0.7.0",
- "xo": "*"
- }
-}
diff --git a/node_modules/matcher/readme.md b/node_modules/matcher/readme.md
deleted file mode 100644
index f395cfb71..000000000
--- a/node_modules/matcher/readme.md
+++ /dev/null
@@ -1,104 +0,0 @@
-# matcher [![Build Status](https://travis-ci.org/sindresorhus/matcher.svg?branch=master)](https://travis-ci.org/sindresorhus/matcher)
-
-> Simple [wildcard](https://en.wikipedia.org/wiki/Wildcard_character) matching
-
-Useful when you want to accept loose string input and regexes/globs are too convoluted.
-
-
-## Install
-
-```
-$ npm install matcher
-```
-
-
-## Usage
-
-```js
-const matcher = require('matcher');
-
-matcher(['foo', 'bar', 'moo'], ['*oo', '!foo']);
-//=> ['moo']
-
-matcher(['foo', 'bar', 'moo'], ['!*oo']);
-//=> ['bar']
-
-matcher.isMatch('unicorn', 'uni*');
-//=> true
-
-matcher.isMatch('unicorn', '*corn');
-//=> true
-
-matcher.isMatch('unicorn', 'un*rn');
-//=> true
-
-matcher.isMatch('rainbow', '!unicorn');
-//=> true
-
-matcher.isMatch('foo bar baz', 'foo b* b*');
-//=> true
-
-matcher.isMatch('unicorn', 'uni\\*');
-//=> false
-
-matcher.isMatch('UNICORN', 'UNI*', {caseSensitive: true});
-//=> true
-
-matcher.isMatch('UNICORN', 'unicorn', {caseSensitive: true});
-//=> false
-```
-
-
-## API
-
-### matcher(inputs, patterns, [options])
-
-Accepts an array of `input`'s and `pattern`'s.
-
-Returns an array of `inputs` filtered based on the `patterns`.
-
-### matcher.isMatch(input, pattern, [options])
-
-Returns a boolean of whether the `input` matches the `pattern`.
-
-#### input
-
-Type: `string`
-
-String to match.
-
-#### options
-
-Type: `Object`
-
-##### caseSensitive
-
-Type: `boolean`<br>
-Default: `false`
-
-Treat uppercase and lowercase characters as being the same.
-
-Ensure you use this correctly. For example, files and directories should be matched case-insensitively, while most often, object keys should be matched case-sensitively.
-
-#### pattern
-
-Type: `string`
-
-Use `*` to match zero or more characters. A pattern starting with `!` will be negated.
-
-
-## Benchmark
-
-```
-$ npm run bench
-```
-
-
-## Related
-
-- [multimatch](https://github.com/sindresorhus/multimatch) - Extends `minimatch.match()` with support for multiple patterns
-
-
-## License
-
-MIT © [Sindre Sorhus](https://sindresorhus.com)