Skip to content

replace util.isType() with typeof Β #607

@micnic

Description

@micnic

In the last PRs (#601 #605) I observed that the contributors replaced util.isString(data) with typeof data === 'string' or util.isFunction(callback) with typeof callback === 'function', the reason for these changes are some performance optimizations, I guess these optimizations are quite insignificant, but they are still improving the performance of the code. From my point of view it's also a code style change, so my question is: Should we allow such changes in the code style? if it's "yes" then we should replace them everywhere where util.isType() is used.

cc TC members @chrisdickinson @bnoordhuis

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