@lou.codes/predicates
Version:
🧐 Predicate util functions
15 lines (14 loc) • 372 B
JavaScript
import { isInstanceOf } from "./isInstanceOf.js";
/**
* `instanceof RegExp` alias.
*
* @category Objects
* @example
* ```typescript
* isRegExp(new RegExp("-")); // true
* isRegExp(/-/); // true
* isRegExp("Lou"); // false
* ```
* @returns `true` if the given value is an instance of `RegExp`, `false` otherwise.
*/
export const isRegExp = isInstanceOf(RegExp);