Skip to content

Commit

Permalink
Ensure POSIX path normalizing behavior under NODERAWFS
Browse files Browse the repository at this point in the history
Avoids mangling `C:/tmp` to `C:\tmp`. Should be safe, the underlying
Windows API can accept either the backslash or slash to separate
directory and file components of a path.

See: https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file
  • Loading branch information
kleisauke committed Aug 14, 2024
1 parent cd097fb commit 76e6056
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/library_nodepath.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
addToLibrary({
$PATH: {
isAbs: (path) => nodePath['isAbsolute'](path),
normalize: (path) => nodePath['normalize'](path),
normalize: (path) => nodePath['posix']['normalize'](path),
dirname: (path) => nodePath['dirname'](path),
basename: (path) => nodePath['basename'](path),
join: (...args) => nodePath['join'](...args),
join2: (l, r) => nodePath['join'](l, r),
join: (...args) => nodePath['posix']['join'](...args),
join2: (l, r) => nodePath['posix']['join'](l, r),
},
// The FS-using parts are split out into a separate object, so simple path
// usage does not require the FS.
Expand Down

0 comments on commit 76e6056

Please sign in to comment.