Function isRegExp

  • Returns true if the given object is a RegExp. Otherwise, returns false.

    const util = require('util');

    util.isRegExp(/some regexp/);
    // Returns: true
    util.isRegExp(new RegExp('another regexp'));
    // Returns: true
    util.isRegExp({});
    // Returns: false

    Deprecated

    Since v4.0.0 - Deprecated

    Parameters

    • object: unknown

    Returns object is RegExp

  • Returns true if the given object is a RegExp. Otherwise, returns false.

    const util = require('util');

    util.isRegExp(/some regexp/);
    // Returns: true
    util.isRegExp(new RegExp('another regexp'));
    // Returns: true
    util.isRegExp({});
    // Returns: false

    Deprecated

    Since v4.0.0 - Deprecated

    Parameters

    • object: unknown

    Returns object is RegExp

Generated using TypeDoc