Skip to content

Commit

Permalink
actually deprecate deprecated Path.path getter
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jun 21, 2024
1 parent 766c9b0 commit 838bb01
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,8 @@ export abstract class PathBase implements Dirent {
/**
* Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,
* this property refers to the *parent* path, not the path object itself.
*
* @deprecated
*/
get path(): string {
return this.parentPath
Expand Down
5 changes: 3 additions & 2 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ t.test('platform-specific', t => {
t.equal(pw.relativePosix('c:/some/a/b'), '../a/b')
t.equal(pw.relativePosix('/a/b'), '//?/C:/a/b')
t.equal(pw.cwd.fullpath(), 'C:\\some\\path')
t.equal(pw.cwd.path, pw.cwd.parent?.fullpath())
t.equal(pw.cwd.root.path, pw.cwd.root.fullpath())
t.equal(pw.cwd.parentPath, pw.cwd.parent?.fullpath())
t.equal(pw.cwd.root.parentPath, pw.cwd.root.fullpath())
t.equal(pw.cwd.path, pw.cwd.parentPath)
t.equal(pw.cwd.fullpathPosix(), '//?/C:/some/path')
t.equal(pw.cwd.getRoot('\\\\?\\c:\\'), pw.root)
t.equal(pw.cwd.getRoot('C:\\'), pw.root)
Expand Down

0 comments on commit 838bb01

Please sign in to comment.