## Heads up! See the [release history](#release-history) to learn about breaking changes in the [v1.0.0 release]({%= homepage %}/releases/tag/1.0.0). ## Usage ```js var isMatch = require('{%= name %}'); ``` ### Create matchers: **from a string:** ```js var isMatch = matcher('a') isMatch('a'); //=> true isMatch('b'); //=> false ``` **from a glob pattern:** ```js 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:** ```js 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:** ```js var isMatch = matcher(/a/); isMatch('a'); //=> true isMatch('b'); //=> false ``` **from a function:** ```js var isMatch = matcher(function (val) { return val === 'a'; }); isMatch('a'); //=> true isMatch('b'); //=> false ``` **from an object:** ```js var isMatch = matcher({a: 'b'}); isMatch({a: 'b'}); //=> true isMatch({a: 'b', c: 'd'}); //=> false isMatch({e: 'f', c: 'd'}); //=> false ``` ## Release history ### v1.0.0 **Potentially breaking changes** - prior to 1.0, when an array of globs was passed, `isMatch()` would return true if _any_ of the globs matched. As of 1.0, `isMatch()` only returns true when _all_ globs match. - now does number comparisons. there are several ways to compare numbers, I'm open to a discussion or changes if necessary.