Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Create a matching function from a glob pattern, regex, string, array, object or function.
Create a matching function from a glob pattern, regex, string, array, object or function.
Install with npm:
$ npm install is-match --save
var isMatch = require('is-match');
from a string:
var isMatch = matcher('a')
isMatch('a');
//=> true
isMatch('b');
//=> false
from a glob pattern:
var isMatch = matcher('*')
isMatch('a'); //=> true
var isMatch = matcher('!b')
isMatch('a'); //=> true
var isMatch = matcher('!b')
isMatch('b'); //=> false
from an array of glob patterns:
var isMatch = matcher(['b'])
isMatch('a'); //=> false
var isMatch = matcher(['b', 'a'])
isMatch('a'); //=> true
var isMatch = matcher(['b', 'c', '*'])
isMatch('a'); //=> true
from a regex:
var isMatch = matcher(/a/);
isMatch('a');
//=> true
isMatch('b');
//=> false
from a function:
var isMatch = matcher(function (val) {
return val === 'a';
});
isMatch('a');
//=> true
isMatch('b');
//=> false
from an object:
var isMatch = matcher({a: 'b'});
isMatch({a: 'b'}); //=> true
isMatch({a: 'b', c: 'd'}); //=> false
isMatch({e: 'f', c: 'd'}); //=> false
You might also be interested in these projects:
true
if an array has a glob pattern. | homepagetrue
if the given string looks like a glob pattern or an extglob pattern.… more | homepagePull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Generate readme and API documentation with verb:
$ npm install verb && npm run docs
Or, if verb is installed globally:
$ verb
Install dev dependencies:
$ npm install -d && npm test
Jon Schlinkert
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb, v0.9.0, on April 20, 2016.
FAQs
Create a matching function from a glob pattern, regex, string, array, object or function.
The npm package is-match receives a total of 2,020 weekly downloads. As such, is-match popularity was classified as popular.
We found that is-match demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.