aboutsummaryrefslogtreecommitdiff
path: root/node_modules/matcher/readme.md
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2018-09-20 02:56:13 +0200
committerFlorian Dold <florian.dold@gmail.com>2018-09-20 02:56:13 +0200
commitbbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch)
treec58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/matcher/readme.md
parent003fb34971cf63466184351b4db5f7c67df4f444 (diff)
update packages
Diffstat (limited to 'node_modules/matcher/readme.md')
-rw-r--r--node_modules/matcher/readme.md29
1 files changed, 24 insertions, 5 deletions
diff --git a/node_modules/matcher/readme.md b/node_modules/matcher/readme.md
index 6716eecbf..f395cfb71 100644
--- a/node_modules/matcher/readme.md
+++ b/node_modules/matcher/readme.md
@@ -8,7 +8,7 @@ Useful when you want to accept loose string input and regexes/globs are too conv
## Install
```
-$ npm install --save matcher
+$ npm install matcher
```
@@ -40,18 +40,24 @@ matcher.isMatch('foo bar baz', 'foo b* b*');
matcher.isMatch('unicorn', 'uni\\*');
//=> false
+
+matcher.isMatch('UNICORN', 'UNI*', {caseSensitive: true});
+//=> true
+
+matcher.isMatch('UNICORN', 'unicorn', {caseSensitive: true});
+//=> false
```
## API
-### matcher(inputs, patterns)
+### matcher(inputs, patterns, [options])
Accepts an array of `input`'s and `pattern`'s.
-Returns an array of of `inputs` filtered based on the `patterns`.
+Returns an array of `inputs` filtered based on the `patterns`.
-### matcher.isMatch(input, pattern)
+### matcher.isMatch(input, pattern, [options])
Returns a boolean of whether the `input` matches the `pattern`.
@@ -61,11 +67,24 @@ 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`
-Case-insensitive. Use `*` to match zero or more characters. A pattern starting with `!` will be negated.
+Use `*` to match zero or more characters. A pattern starting with `!` will be negated.
## Benchmark