UNPKG

@augment-vir/common

Version:

A collection of augments, helpers types, functions, and classes for any JavaScript environment.

12 lines (11 loc) 406 B
import { escapeStringForRegExp } from '../regexp/regexp-string.js'; /** * A case insensitive match between strings. * * @category String * @category Package : @augment-vir/common * @package [`@augment-vir/common`](https://www.npmjs.com/package/@augment-vir/common) */ export function match(haystack, needle) { return !!needle && !!new RegExp(escapeStringForRegExp(needle), 'i').exec(haystack); }