tar 4.4.16 → 4.4.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,6 +8,7 @@
8
8
 
9
9
  const assert = require('assert')
10
10
  const normPath = require('./normalize-windows-path.js')
11
+ const { join } = require('path')
11
12
 
12
13
  module.exports = () => {
13
14
  // path => [function or Set]
@@ -19,10 +20,9 @@ module.exports = () => {
19
20
  const reservations = new Map()
20
21
 
21
22
  // return a set of parent dirs for a given path
22
- const { join } = require('path')
23
23
  const getDirs = path =>
24
- normPath(join(path)).split('/').slice(0, -1).reduce((set, path) =>
25
- set.length ? set.concat(normPath(join(set[set.length-1], path)))
24
+ path.split('/').slice(0, -1).reduce((set, path) =>
25
+ set.length ? set.concat(normPath(join(set[set.length - 1], path)))
26
26
  : [path], [])
27
27
 
28
28
  // functions currently running
@@ -99,6 +99,7 @@ module.exports = () => {
99
99
  }
100
100
 
101
101
  const reserve = (paths, fn) => {
102
+ paths = paths.map(p => normPath(join(p)).toLowerCase())
102
103
  const dirs = new Set(
103
104
  paths.map(path => getDirs(path)).reduce((a, b) => a.concat(b))
104
105
  )
package/lib/unpack.js CHANGED
@@ -209,6 +209,8 @@ class Unpack extends Parser {
209
209
  const linkparts = normPath(entry.linkpath).split('/')
210
210
  if (linkparts.length >= this.strip)
211
211
  entry.linkpath = linkparts.slice(this.strip).join('/')
212
+ else
213
+ return false
212
214
  }
213
215
  }
214
216
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
3
3
  "name": "tar",
4
4
  "description": "tar for node",
5
- "version": "4.4.16",
5
+ "version": "4.4.17",
6
6
  "publishConfig": {
7
7
  "tag": "v4-legacy"
8
8
  },