any-match
v2.0.1
Published
Determine if a single match exists with an array of strings/numbers/regexes.
Downloads
16
Readme
any-match
Determine if a single match exists with an array of strings/numbers/regexes.
Installation
Node.js >= 6
is required. To install, type this at the command line:
npm install any-match
Usage
const anyMatch = require('any-match');
anyMatch('a', ['a', 'b']); //-> true
anyMatch('c', ['a', 'b']); //-> false
anyMatch(1, [0, 1]); //-> true
anyMatch('abc', [/^abc$/]); //-> true