Skip to content

Unexpected semantics for util.is... #2197

Closed
@deian

Description

@deian

The semantics for the util is... functions are somewhat unexpected. For example, the documentation for util.isRegExp says:

Returns true if the given "object" is a RegExp. false otherwise.

But I'm seeing that util.isRegExp(Object.create(RegExp.prototype)) === false.
Can we clarify the documentation to explain why this is not a RegExp or change the semantics of isRegExp please? (Same goes with the other is functions.) Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    utilIssues and PRs related to the built-in util module.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions