any-match

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

Usage no npm install needed!

<script type="module">
  import anyMatch from 'https://cdn.skypack.dev/any-match';
</script>

README

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