Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/tar/lib/normalize-windows-path.js')
-rw-r--r--deps/npm/node_modules/tar/lib/normalize-windows-path.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/deps/npm/node_modules/tar/lib/normalize-windows-path.js b/deps/npm/node_modules/tar/lib/normalize-windows-path.js
new file mode 100644
index 00000000000..eb13ba01b7b
--- /dev/null
+++ b/deps/npm/node_modules/tar/lib/normalize-windows-path.js
@@ -0,0 +1,8 @@
+// on windows, either \ or / are valid directory separators.
+// on unix, \ is a valid character in filenames.
+// so, on windows, and only on windows, we replace all \ chars with /,
+// so that we can use / as our one and only directory separator char.
+
+const platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform
+module.exports = platform !== 'win32' ? p => p
+ : p => p && p.replace(/\\/g, '/')