Gathering detailed insights and metrics for matcher
Gathering detailed insights and metrics for matcher
Gathering detailed insights and metrics for matcher
Gathering detailed insights and metrics for matcher
npm install matcher
98.7
Supply Chain
99.5
Quality
75.7
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
537 Stars
42 Commits
29 Forks
6 Watching
1 Branches
12 Contributors
Updated on 18 Nov 2024
JavaScript (97.26%)
TypeScript (2.74%)
Cumulative downloads
Total Downloads
Last day
-7.2%
491,582
Compared to previous day
Last week
2.6%
2,909,615
Compared to previous week
Last month
17%
12,062,167
Compared to previous month
Last year
7.8%
118,514,641
Compared to previous year
1
Simple wildcard matching
Useful when you want to accept loose string input and regexes/globs are too convoluted.
1npm install matcher
1import {matcher, isMatch} from 'matcher'; 2 3matcher(['foo', 'bar', 'moo'], ['*oo', '!foo']); 4//=> ['moo'] 5 6matcher(['foo', 'bar', 'moo'], ['!*oo']); 7//=> ['bar'] 8 9matcher('moo', ['']); 10//=> [] 11 12matcher('moo', []); 13//=> [] 14 15matcher([''], ['']); 16//=> [''] 17 18isMatch('unicorn', 'uni*'); 19//=> true 20 21isMatch('unicorn', '*corn'); 22//=> true 23 24isMatch('unicorn', 'un*rn'); 25//=> true 26 27isMatch('rainbow', '!unicorn'); 28//=> true 29 30isMatch('foo bar baz', 'foo b* b*'); 31//=> true 32 33isMatch('unicorn', 'uni\\*'); 34//=> false 35 36isMatch(['foo', 'bar'], 'f*'); 37//=> true 38 39isMatch(['foo', 'bar'], ['a*', 'b*']); 40//=> true 41 42isMatch('unicorn', ['']); 43//=> false 44 45isMatch('unicorn', []); 46//=> false 47 48isMatch([], 'bar'); 49//=> false 50 51isMatch([], []); 52//=> false 53 54isMatch('', ''); 55//=> true
It matches even across newlines. For example, foo*r
will match foo\nbar
.
Accepts a string or an array of strings for both inputs
and patterns
.
Returns an array of inputs
filtered based on the patterns
.
Accepts a string or an array of strings for both inputs
and patterns
.
Returns a boolean
of whether any of given inputs
matches all the patterns
.
Type: string | string[]
The string or array of strings to match.
Type: object
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.
1import {isMatch} from 'matcher'; 2 3isMatch('UNICORN', 'UNI*', {caseSensitive: true}); 4//=> true 5 6isMatch('UNICORN', 'unicorn', {caseSensitive: true}); 7//=> false 8 9isMatch('unicorn', ['tri*', 'UNI*'], {caseSensitive: true}); 10//=> false
Type: boolean
Default: false
Require all negated patterns to not match and any normal patterns to match at least once. Otherwise, it will be a no-match condition.
1import {matcher} from 'matcher'; 2 3// Find text strings containing both "edge" and "tiger" in arbitrary order, but not "stunt". 4const demo = (strings) => matcher(strings, ['*edge*', '*tiger*', '!*stunt*'], {allPatterns: true}); 5 6demo(['Hey, tiger!', 'tiger has edge over hyenas', 'pushing a tiger over the edge is a stunt']); 7//=> ['tiger has edge over hyenas']
1import {matcher} from 'matcher'; 2 3matcher(['foo', 'for', 'bar'], ['f*', 'b*', '!x*'], {allPatterns: true}); 4//=> ['foo', 'for', 'bar'] 5 6matcher(['foo', 'for', 'bar'], ['f*'], {allPatterns: true}); 7//=> []
Type: string | string[]
Use *
to match zero or more characters.
A leading !
negates the pattern.
An input string will be omitted, if it does not match any non-negated patterns present, or if it matches a negated pattern, or if no pattern is present.
1npm run bench
minimatch.match()
with support for multiple patternsNo vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
security policy file detected
Details
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 11/30 approved changesets -- score normalized to 3
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More