UNPKG

any-match

Version:

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

13 lines (9 loc) 295 B
"use strict"; var isRegExp = require("is-regexp"); var anyMatch = function anyMatch(needle, haystack) { return haystack.some(function (strand) { return isRegExp(strand) ? strand.test(needle) : strand === needle; }); }; module.exports = anyMatch; //# sourceMappingURL=index-es5.js.map