util-ex
Version:
Browser-friendly enhanced util fully compatible with standard node.js
11 lines (10 loc) • 377 B
TypeScript
/**
* Determines if a string represents a valid JavaScript RegExp.
* @param {string} aRegExpString - The string to test.
* @returns {boolean} - True if the string represents a valid EegExp, false otherwise.
* @example
* isRegExpStr('/[a-z]/g') // true
* isRegExpStr('/not a regexp') // false
*/
export function isRegExpStr(value: any): boolean;
export default isRegExpStr;