diff options
| author | Kevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com> | 2019-01-07 07:39:36 -0800 |
|---|---|---|
| committer | Ryan Dahl <ry@tinyclouds.org> | 2019-01-07 10:39:36 -0500 |
| commit | 3dd70d411ae79523c6a1bc337c33bc2224623521 (patch) | |
| tree | b86566b263ad7c493e408730afc14724baf42c0b | |
| parent | 7907bfc4c91f5287237d87571d1933db4ae7a4fa (diff) | |
path: remove export = module (denoland/deno_std#95)
Original: https://github.com/denoland/deno_std/commit/a0b5aec82397bf76d3e8348194536c2596292e65
| -rw-r--r-- | path/index.ts | 19 | ||||
| -rw-r--r-- | path/parse_format_test.ts | 4 |
2 files changed, 18 insertions, 5 deletions
diff --git a/path/index.ts b/path/index.ts index 7b62b0b00..4201c52ad 100644 --- a/path/index.ts +++ b/path/index.ts @@ -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; diff --git a/path/parse_format_test.ts b/path/parse_format_test.ts index 1b5e5908a..be98f8739 100644 --- a/path/parse_format_test.ts +++ b/path/parse_format_test.ts @@ -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); }); |
