From bbff7403fbf46f9ad92240ac213df8d30ef31b64 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 20 Sep 2018 02:56:13 +0200 Subject: update packages --- node_modules/matcher/readme.md | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'node_modules/matcher/readme.md') 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`
+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 -- cgit v1.2.3