summaryrefslogtreecommitdiff
path: root/lib/fs.js
diff options
context:
space:
mode:
authorMohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>2022-01-24 19:39:16 +0330
committerJames M Snell <jasnell@gmail.com>2022-02-05 08:36:48 -0800
commit8c4b8b201ada6b76d5306c9c7f352e45087fb4a9 (patch)
tree0f3159d3dd6aad1159292956f1fe1550fb41d06a /lib/fs.js
parent217acb9036f39ea6088cee75f70f11602997e15f (diff)
downloadnode-new-8c4b8b201ada6b76d5306c9c7f352e45087fb4a9.tar.gz
lib: replace validator and error
Refs: https://github.com/nodejs/node/pull/41660 PR-URL: https://github.com/nodejs/node/pull/41678 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/fs.js')
-rw-r--r--lib/fs.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/fs.js b/lib/fs.js
index 0e2bbbcc63..c551599a53 100644
--- a/lib/fs.js
+++ b/lib/fs.js
@@ -132,7 +132,6 @@ const {
parseFileMode,
validateBoolean,
validateBuffer,
- validateCallback,
validateEncoding,
validateFunction,
validateInteger,
@@ -174,7 +173,7 @@ function showTruncateDeprecation() {
}
function maybeCallback(cb) {
- validateCallback(cb);
+ validateFunction(cb, 'cb');
return cb;
}
@@ -183,7 +182,7 @@ function maybeCallback(cb) {
// for callbacks that are passed to the binding layer, callbacks that are
// invoked from JS already run in the proper scope.
function makeCallback(cb) {
- validateCallback(cb);
+ validateFunction(cb, 'cb');
return (...args) => ReflectApply(cb, this, args);
}
@@ -192,7 +191,7 @@ function makeCallback(cb) {
// an optimization, since the data passed back to the callback needs to be
// transformed anyway.
function makeStatsCallback(cb) {
- validateCallback(cb);
+ validateFunction(cb, 'cb');
return (err, stats) => {
if (err) return cb(err);