Skip to content

Commit 5d2b775

Browse files
Apply suggestions from code review
Co-authored-by: Livia Medeiros <livia@cirno.name>
1 parent 3cf7032 commit 5d2b775

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

doc/api/fs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,7 @@ Renames `oldPath` to `newPath`.
15901590
added: v10.0.0
15911591
changes:
15921592
- version: REPLACEME
1593-
pr-url: https://github.com/nodejs/node/pull/00000
1593+
pr-url: https://github.com/nodejs/node/pull/58616
15941594
description: Remove `recursive` option.
15951595
- version: v16.0.0
15961596
pr-url: https://github.com/nodejs/node/pull/37216
@@ -4251,7 +4251,7 @@ rename('oldFile.txt', 'newFile.txt', (err) => {
42514251
added: v0.0.2
42524252
changes:
42534253
- version: REPLACEME
4254-
pr-url: https://github.com/nodejs/node/pull/00000
4254+
pr-url: https://github.com/nodejs/node/pull/58616
42554255
description: Remove `recursive` option.
42564256
- version: v18.0.0
42574257
pr-url: https://github.com/nodejs/node/pull/41678
@@ -6225,7 +6225,7 @@ See the POSIX rename(2) documentation for more details.
62256225
added: v0.1.21
62266226
changes:
62276227
- version: REPLACEME
6228-
pr-url: https://github.com/nodejs/node/pull/00000
6228+
pr-url: https://github.com/nodejs/node/pull/58616
62296229
description: Remove `recursive` option.
62306230
- version: v16.0.0
62316231
pr-url: https://github.com/nodejs/node/pull/37216

lib/fs.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,10 @@ function rmdir(path, options, callback) {
11181118
}
11191119

11201120
if (options?.recursive !== undefined) {
1121+
// This API previously accepted a `recursive` option that was deprecated
1122+
// and removed. However, in order to make the change more visible, we
1123+
// opted to throw an error if recursive is specified rather than removing it
1124+
// entirely.
11211125
throw new ERR_INVALID_ARG_VALUE(
11221126
'options.recursive',
11231127
options.recursive,

0 commit comments

Comments
 (0)