Function isRegExp

  • Checks if a given value is a regular expression.

    Parameters

    • value: unknown

      The value to be checked if it is a regular expression.

    Returns boolean

    true if the value is a regular expression, false otherwise.

    Example

    const regex = /[a-z]/;
    console.log(isRegexp(regex)); // true

    const str = 'hello';
    console.log(isRegexp(str)); // false

Generated using TypeDoc