isMatch()
constisMatch: (string,pattern,options?) =>boolean=micromatch.isMatch
Returns true if the specified string matches the given glob pattern.
Parameters
| Parameter | Type | Description |
|---|---|---|
|
|
|
String to match |
|
|
|
Glob pattern to use for matching. |
|
|
See available options for changing how matches are performed |
Returns
boolean
Returns true if the string matches the glob pattern.
Example
var mm = require('micromatch');
mm.isMatch(string, pattern[, options]);
console.log(mm.isMatch('a.a', '*.a'));
//=> true
console.log(mm.isMatch('a.b', '*.a'));
//=> false