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

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/tar/lib/path-reservations.js')
-rw-r--r--node_modules/tar/lib/path-reservations.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/node_modules/tar/lib/path-reservations.js b/node_modules/tar/lib/path-reservations.js
index 1929ac9c2..167447af0 100644
--- a/node_modules/tar/lib/path-reservations.js
+++ b/node_modules/tar/lib/path-reservations.js
@@ -8,6 +8,7 @@
const assert = require('assert')
const normPath = require('./normalize-windows-path.js')
+const { join } = require('path')
module.exports = () => {
// path => [function or Set]
@@ -19,9 +20,8 @@ module.exports = () => {
const reservations = new Map()
// return a set of parent dirs for a given path
- const { join } = require('path')
const getDirs = path =>
- normPath(join(path)).split('/').slice(0, -1).reduce((set, path) =>
+ path.split('/').slice(0, -1).reduce((set, path) =>
set.length ? set.concat(normPath(join(set[set.length - 1], path)))
: [path], [])
@@ -99,6 +99,7 @@ module.exports = () => {
}
const reserve = (paths, fn) => {
+ paths = paths.map(p => normPath(join(p)).toLowerCase())
const dirs = new Set(
paths.map(path => getDirs(path)).reduce((a, b) => a.concat(b))
)