jty
    Preparing search index...

    Function isEqualRegExp

    • Checks if two RegExp objects are the same.

      Parameters

      • x: unknown

        The first value to compare.

      • ref: RegExp

        The reference RegExp.

      Returns x is RegExp

      true if the regular expressions are the same, false otherwise.

      if ref is not a RegExp.

      isEqualRegExp(/a/g, /a/g) => true
      isEqualRegExp(/a/i, /a/g) => false
      isEqualRegExp(/a/, /b/) => false
      isEqualRegExp(new RegExp('a', 'g'), /a/g) => true