mirror of
https://github.com/denoland/deno.git
synced 2024-11-27 16:10:57 -05:00
path: remove export = module (denoland/deno_std#95)
Original: a0b5aec823
This commit is contained in:
parent
7907bfc4c9
commit
3dd70d411a
2 changed files with 18 additions and 5 deletions
|
@ -119,7 +119,7 @@ function _format(sep: string, pathObject: FormatInputPathObject) {
|
|||
return dir + sep + base;
|
||||
}
|
||||
|
||||
const win32 = {
|
||||
export const win32 = {
|
||||
// path.resolve([from ...], to)
|
||||
resolve: function resolve(...pathSegments: string[]) {
|
||||
let resolvedDevice = "";
|
||||
|
@ -1004,7 +1004,7 @@ const win32 = {
|
|||
posix: null
|
||||
};
|
||||
|
||||
const posix = {
|
||||
export const posix = {
|
||||
// path.resolve([from ...], to)
|
||||
resolve: function resolve(...pathSegments: string[]) {
|
||||
let resolvedPath = "";
|
||||
|
@ -1422,4 +1422,17 @@ posix.win32 = win32.win32 = win32;
|
|||
posix.posix = win32.posix = posix;
|
||||
|
||||
const module = platform.os === "win" ? win32 : posix;
|
||||
export = module;
|
||||
|
||||
export const resolve = module.resolve;
|
||||
export const normalize = module.normalize;
|
||||
export const isAbsolute = module.isAbsolute;
|
||||
export const join = module.join;
|
||||
export const relative = module.relative;
|
||||
export const toNamespacedPath = module.toNamespacedPath;
|
||||
export const dirname = module.dirname;
|
||||
export const basename = module.basename;
|
||||
export const extname = module.extname;
|
||||
export const format = module.format;
|
||||
export const parse = module.parse;
|
||||
export const sep = module.sep;
|
||||
export const delimiter = module.delimiter;
|
||||
|
|
|
@ -161,7 +161,7 @@ function checkFormat(path, testCases) {
|
|||
|
||||
test(function parseTrailingWin32() {
|
||||
windowsTrailingTests.forEach(function(p) {
|
||||
const actual = path.win32.parse(p[0]);
|
||||
const actual = path.win32.parse(p[0] as string);
|
||||
const expected = p[1];
|
||||
assertEqual(actual, expected);
|
||||
});
|
||||
|
@ -169,7 +169,7 @@ test(function parseTrailingWin32() {
|
|||
|
||||
test(function parseTrailing() {
|
||||
posixTrailingTests.forEach(function(p) {
|
||||
const actual = path.posix.parse(p[0]);
|
||||
const actual = path.posix.parse(p[0] as string);
|
||||
const expected = p[1];
|
||||
assertEqual(actual, expected);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue