diff options
author | James M Snell <jasnell@gmail.com> | 2017-08-21 08:44:47 +0300 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-10-02 21:30:19 +0300 |
commit | 1f8d527e94ad97e7db14d18406fe0e12983358cb (patch) | |
tree | f0433f7deac9990e289973eb88cfb5c27452ccbe /lib/path.js | |
parent | 7069e633caf90a77fced619689171a92059ee29a (diff) |
path: deprecate internal _makeLong, replace
Replace the internal `path._makeLong()` with a public
`path.toLongUNCPath()` method. Add documentation.
PR-URL: https://github.com/nodejs/node/pull/14956
Ref: https://github.com/standard-things/esm/issues/66
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'lib/path.js')
-rw-r--r-- | lib/path.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/path.js b/lib/path.js index 9ac8a2450b7..c9ed0120d86 100644 --- a/lib/path.js +++ b/lib/path.js @@ -687,7 +687,7 @@ const win32 = { }, - _makeLong: function _makeLong(path) { + toNamespacedPath: function toNamespacedPath(path) { // Note: this will *probably* throw somewhere. if (typeof path !== 'string') return path; @@ -725,7 +725,6 @@ const win32 = { return path; }, - dirname: function dirname(path) { assertPath(path); const len = path.length; @@ -1356,11 +1355,11 @@ const posix = { }, - _makeLong: function _makeLong(path) { + toNamespacedPath: function toNamespacedPath(path) { + // Non-op on posix systems return path; }, - dirname: function dirname(path) { assertPath(path); if (path.length === 0) @@ -1630,6 +1629,9 @@ const posix = { posix.win32 = win32.win32 = win32; posix.posix = win32.posix = posix; +// Legacy internal API, docs-only deprecated: DEP00XX +win32._makeLong = win32.toNamespacedPath; +posix._makeLong = posix.toNamespacedPath; if (process.platform === 'win32') module.exports = win32; |