tar 5.0.8 → 5.0.9

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,9 +20,8 @@ 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) =>
24
+ path.split('/').slice(0, -1).reduce((set, path) =>
25
25
  set.length ? set.concat(normPath(join(set[set.length - 1], path)))
26
26
  : [path], [])
27
27
 
@@ -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
@@ -219,6 +219,8 @@ class Unpack extends Parser {
219
219
  const linkparts = normPath(entry.linkpath).split('/')
220
220
  if (linkparts.length >= this.strip)
221
221
  entry.linkpath = linkparts.slice(this.strip).join('/')
222
+ else
223
+ return false
222
224
  }
223
225
  }
224
226
 
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": "5.0.8",
5
+ "version": "5.0.9",
6
6
  "publishConfig": {
7
7
  "tag": "v5-legacy"
8
8
  },