Skip to content

Commit 1e69e91

Browse files
committed
Update.
1 parent 9ef72e8 commit 1e69e91

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

README.md

+5-9
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Usage
1414
npm install anymatchx
1515
```
1616

17-
#### anymatch (matchers, testString, [returnIndex])
17+
#### anymatch(matchers, testString, [returnIndex])
1818
* __matchers__: (_Array|String|RegExp|Function_)
1919
String to be directly matched, string with glob patterns, regular expression
2020
test, function that takes the testString as an argument and returns a truthy
@@ -25,15 +25,13 @@ the first matcher that that testString matched, or -1 if no match, instead of a
2525
boolean result.
2626

2727
```js
28-
var anymatch = require('anymatch');
28+
const anymatch = require('anymatch');
2929

30-
var matchers = [
30+
const matchers = [
3131
'path/to/file.js',
3232
'path/anyjs/**/*.js',
3333
/foo\.js$/,
34-
function (string) {
35-
return string.indexOf('bar') !== -1 && string.length > 10
36-
}
34+
(string) => string.includes('bar') && string.length > 10
3735
];
3836

3937
anymatch(matchers, 'path/to/file.js'); // true
@@ -48,8 +46,6 @@ anymatch(matchers, 'path/anyjs/foo.js', true); // 1
4846

4947
// skip matchers
5048
anymatch(matchers, 'path/to/file.js', false, 1); // false
51-
anymatch(matchers, 'path/anyjs/foo.js', true, 2, 3); // 2
52-
anymatch(matchers, 'path/to/bar.js', true, 0, 3); // -1
5349

5450
// using globs to match directories and their children
5551
anymatch('node_modules', 'node_modules'); // true
@@ -59,7 +55,7 @@ anymatch('node_modules/**', '/absolute/path/to/node_modules/somelib/index.js');
5955
anymatch('**/node_modules/**', '/absolute/path/to/node_modules/somelib/index.js'); // true
6056
```
6157

62-
#### anymatch (matchers)
58+
#### anymatch(matchers)
6359
You can also pass in only your matcher(s) to get a curried function that has
6460
already been bound to the provided matching criteria. This can be used as an
6561
`Array#filter` callback.

0 commit comments

Comments
 (0)