Skip to content

Commit

Permalink
doc: updating doc for fs.cp, fsPromises.cp and fs.cpSync
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham9411 committed Aug 23, 2023
1 parent 5c9daf4 commit fa10461
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,15 @@ changes:
* `filter` {Function} Function to filter copied files/directories. Return
`true` to copy the item, `false` to ignore it. Can also return a `Promise`
that resolves to `true` or `false` **Default:** `undefined`.
When using the `recursive` option, please note the following caveat:
If the filter function is configured to skip certain files based on a
condition, and you are performing a recursive copy operation, be aware that
directories that do not match the filter condition will also be skipped.
This is because the filter function is applied to both files and
directories during recursion.
* `src` {string} source path to copy.
* `dest` {string} destination path to copy to.
* Returns: {boolean|Promise}
Expand Down Expand Up @@ -2353,6 +2362,15 @@ changes:
* `filter` {Function} Function to filter copied files/directories. Return
`true` to copy the item, `false` to ignore it. Can also return a `Promise`
that resolves to `true` or `false` **Default:** `undefined`.
When using the `recursive` option, please note the following caveat:
If the filter function is configured to skip certain files based on a
condition, and you are performing a recursive copy operation, be aware that
directories that do not match the filter condition will also be skipped.
This is because the filter function is applied to both files and
directories during recursion.
* `src` {string} source path to copy.
* `dest` {string} destination path to copy to.
* Returns: {boolean|Promise}
Expand Down Expand Up @@ -5279,6 +5297,15 @@ changes:
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`

When using the `recursive` option, please note the following caveat:

If the filter function is configured to skip certain files based on a
condition, and you are performing a recursive copy operation, be aware that
directories that do not match the filter condition will also be skipped.
This is because the filter function is applied to both files and
directories during recursion.

* `src` {string} source path to copy.
* `dest` {string} destination path to copy to.
* Returns: {boolean}
Expand Down

0 comments on commit fa10461

Please sign in to comment.