stevenvachon / any-match

Determine if a single match exists with an array of strings/numbers/regexes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

any-match NPM Version Build Status Dependency Monitor

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

About

Determine if a single match exists with an array of strings/numbers/regexes.

License:MIT License


Languages

Language:JavaScript 100.0%