From d9540b51ebc1a97bbb109fff0825c2f0090aefa2 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sat, 26 Oct 2024 10:27:24 +0200 Subject: [PATCH] fs: remove `dirent.path` PR-URL: https://github.com/nodejs/node/pull/55548 Fixes: https://github.com/nodejs/node/issues/55538 Reviewed-By: Matteo Collina Reviewed-By: Yagiz Nizipli Reviewed-By: LiviaMedeiros Reviewed-By: Ethan Arrowood --- benchmark/fs/bench-opendirSync.js | 2 +- doc/api/deprecations.md | 8 +++--- doc/api/fs.md | 26 -------------------- lib/internal/fs/utils.js | 13 ---------- test/parallel/test-fs-opendir.js | 3 +-- test/parallel/test-fs-utils-get-dirents.js | 6 +---- test/sequential/test-fs-opendir-recursive.js | 2 +- test/sequential/test-fs-readdir-recursive.js | 2 +- 8 files changed, 10 insertions(+), 52 deletions(-) diff --git a/benchmark/fs/bench-opendirSync.js b/benchmark/fs/bench-opendirSync.js index 206822db139ff7..f24faa5d5e6994 100644 --- a/benchmark/fs/bench-opendirSync.js +++ b/benchmark/fs/bench-opendirSync.js @@ -8,7 +8,7 @@ tmpdir.refresh(); const testFiles = fs.readdirSync('test', { withFileTypes: true }) .filter((f) => f.isDirectory()) - .map((f) => path.join(f.path, f.name)); + .map((f) => path.join(f.parentPath, f.name)); const bench = common.createBenchmark(main, { type: ['existing', 'non-existing'], n: [1e3], diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index bcfa2932c7e110..692360d243b71a 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -3615,6 +3615,9 @@ Please use `value instanceof WebAssembly.Module` instead. -Type: Runtime +Type: End-of-Life -The [`dirent.path`][] is deprecated due to its lack of consistency across +The `dirent.path` property has been removed due to its lack of consistency across release lines. Please use [`dirent.parentPath`][] instead. ### DEP0179: `Hash` constructor @@ -3813,7 +3816,6 @@ It is recommended to use the `new` qualifier instead. This applies to all REPL c [`diagnostics_channel.subscribe(name, onMessage)`]: diagnostics_channel.md#diagnostics_channelsubscribename-onmessage [`diagnostics_channel.unsubscribe(name, onMessage)`]: diagnostics_channel.md#diagnostics_channelunsubscribename-onmessage [`dirent.parentPath`]: fs.md#direntparentpath -[`dirent.path`]: fs.md#direntpath [`dns.lookup()`]: dns.md#dnslookuphostname-options-callback [`dnsPromises.lookup()`]: dns.md#dnspromiseslookuphostname-options [`domain`]: domain.md diff --git a/doc/api/fs.md b/doc/api/fs.md index 621731f133c700..4fafdc453b0603 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -6811,31 +6811,6 @@ added: The path to the parent directory of the file this {fs.Dirent} object refers to. -#### `dirent.path` - - - -> Stability: 0 - Deprecated: Use [`dirent.parentPath`][] instead. - -* {string} - -Alias for `dirent.parentPath`. - ### Class: `fs.FSWatcher`