From 7c0cd2fb8730000fe92a20027dc3e24338f6514f Mon Sep 17 00:00:00 2001 From: Shubham Pandey Date: Sat, 26 Aug 2023 11:23:46 +0530 Subject: [PATCH] doc: update `options.filter` description for `fs.cp` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/49289 Fixes: https://github.com/nodejs/node/issues/49092 Reviewed-By: Antoine du Hamel Reviewed-By: Tobias Nießen Reviewed-By: Luigi Pinca Reviewed-By: LiviaMedeiros --- doc/api/fs.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index 4438465882d25f..38bed8a21717ba 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -997,7 +997,8 @@ changes: * `errorOnExist` {boolean} when `force` is `false`, and the destination exists, throw an error. **Default:** `false`. * `filter` {Function} Function to filter copied files/directories. Return - `true` to copy the item, `false` to ignore it. Can also return a `Promise` + `true` to copy the item, `false` to ignore it. When ignoring a directory, + all of its contents will be skipped as well. Can also return a `Promise` that resolves to `true` or `false` **Default:** `undefined`. * `src` {string} source path to copy. * `dest` {string} destination path to copy to. @@ -2341,7 +2342,8 @@ changes: * `errorOnExist` {boolean} when `force` is `false`, and the destination exists, throw an error. **Default:** `false`. * `filter` {Function} Function to filter copied files/directories. Return - `true` to copy the item, `false` to ignore it. Can also return a `Promise` + `true` to copy the item, `false` to ignore it. When ignoring a directory, + all of its contents will be skipped as well. Can also return a `Promise` that resolves to `true` or `false` **Default:** `undefined`. * `src` {string} source path to copy. * `dest` {string} destination path to copy to. @@ -5262,7 +5264,8 @@ changes: * `errorOnExist` {boolean} when `force` is `false`, and the destination exists, throw an error. **Default:** `false`. * `filter` {Function} Function to filter copied files/directories. Return - `true` to copy the item, `false` to ignore it. **Default:** `undefined` + `true` to copy the item, `false` to ignore it. When ignoring a directory, + all of its contents will be skipped as well. **Default:** `undefined` * `src` {string} source path to copy. * `dest` {string} destination path to copy to. * Returns: {boolean}