Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: refactor to use validateFunction #37045

Closed
wants to merge 2 commits into from

Conversation

Lxxyx
Copy link
Member

@Lxxyx Lxxyx commented Jan 24, 2021

  1. add a new validator: validateFunction
  2. refactor to use validateFunction

add validateFunction and refactor to use validateFunction
@nodejs-github-bot nodejs-github-bot added the lib / src Issues and PRs related to general changes in the lib or src directory. label Jan 24, 2021
@Lxxyx
Copy link
Member Author

Lxxyx commented Jan 24, 2021

validateFunction and validateCallback are similar, but ERR_INVALID_ARG_TYPE is more widely used and more accurate, maybe we should refactor validateCallback to validateFunction in the next major release? @Trott

Refs: #36609 (review)

lib/async_hooks.js Outdated Show resolved Hide resolved
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
@nodejs-github-bot
Copy link
Collaborator

@RaisinTen RaisinTen added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 24, 2021
@benjamingr
Copy link
Member

Landed in 064a707 🎉

@benjamingr benjamingr closed this Jan 27, 2021
benjamingr pushed a commit that referenced this pull request Jan 27, 2021
add validateFunction and refactor to use validateFunction

PR-URL: #37045
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request Feb 2, 2021
add validateFunction and refactor to use validateFunction

PR-URL: #37045
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@targos targos mentioned this pull request Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. lib / src Issues and PRs related to general changes in the lib or src directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants