Skip to content

Commit

Permalink
Add named exports for node:path/win32 and node:path/posix (#3015)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell authored Oct 28, 2024
1 parent ea8a12f commit 712e77b
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 4 deletions.
38 changes: 36 additions & 2 deletions src/node/path/posix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,40 @@
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
// https://opensource.org/licenses/Apache-2.0
//

import { posix } from 'node-internal:internal_path';
/* eslint-disable @typescript-eslint/unbound-method */
import { posix, win32 } from 'node-internal:internal_path';
const {
basename,
dirname,
extname,
format,
isAbsolute,
join,
matchesGlob,
normalize,
parse,
relative,
resolve,
toNamespacedPath,
delimiter,
sep,
} = posix;
export {
basename,
dirname,
extname,
format,
isAbsolute,
join,
matchesGlob,
normalize,
parse,
relative,
resolve,
toNamespacedPath,
delimiter,
posix,
sep,
win32,
};
export default posix;
38 changes: 36 additions & 2 deletions src/node/path/win32.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,40 @@
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
// https://opensource.org/licenses/Apache-2.0
//

import { win32 } from 'node-internal:internal_path';
/* eslint-disable @typescript-eslint/unbound-method */
import { win32, posix } from 'node-internal:internal_path';
const {
basename,
dirname,
extname,
format,
isAbsolute,
join,
matchesGlob,
normalize,
parse,
relative,
resolve,
toNamespacedPath,
delimiter,
sep,
} = win32;
export {
basename,
dirname,
extname,
format,
isAbsolute,
join,
matchesGlob,
normalize,
parse,
relative,
resolve,
toNamespacedPath,
delimiter,
posix,
sep,
win32,
};
export default win32;

0 comments on commit 712e77b

Please sign in to comment.