From 01533df87f9bb51df6b3bacb4285ef4cd36591eb Mon Sep 17 00:00:00 2001 From: Feng Yu Date: Fri, 31 May 2024 12:14:26 -0700 Subject: [PATCH] doc: add `err` param to fs.copyFile callback PR-URL: https://github.com/nodejs/node/pull/53234 Reviewed-By: LiviaMedeiros Reviewed-By: Luigi Pinca --- doc/api/fs.md | 1 + lib/fs.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index 07dd54f83dccc7..5d0dd605b328be 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -2313,6 +2313,7 @@ changes: * `dest` {string|Buffer|URL} destination filename of the copy operation * `mode` {integer} modifiers for copy operation. **Default:** `0`. * `callback` {Function} + * `err` {Error} Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it already exists. No arguments other than a possible exception are given to the diff --git a/lib/fs.js b/lib/fs.js index 0cddd128623c0c..fd9e1e316bc416 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -2999,7 +2999,7 @@ function mkdtempSync(prefix, options) { * @param {string | Buffer | URL} src * @param {string | Buffer | URL} dest * @param {number} [mode] - * @param {() => any} callback + * @param {(err?: Error) => any} callback * @returns {void} */ function copyFile(src, dest, mode, callback) {