tar 4.4.9 → 4.4.13

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.
package/lib/mkdir.js CHANGED
@@ -69,7 +69,7 @@ const mkdir = module.exports = (dir, opt, cb) => {
69
69
  return done()
70
70
 
71
71
  if (dir === cwd)
72
- return fs.lstat(dir, (er, st) => {
72
+ return fs.stat(dir, (er, st) => {
73
73
  if (er || !st.isDirectory())
74
74
  er = new CwdError(dir, er && er.code || 'ENOTDIR')
75
75
  done(er)
@@ -154,7 +154,7 @@ const mkdirSync = module.exports.sync = (dir, opt) => {
154
154
  let ok = false
155
155
  let code = 'ENOTDIR'
156
156
  try {
157
- ok = fs.lstatSync(dir).isDirectory()
157
+ ok = fs.statSync(dir).isDirectory()
158
158
  } catch (er) {
159
159
  code = er.code
160
160
  } finally {
package/lib/parse.js CHANGED
@@ -102,7 +102,12 @@ module.exports = warner(class Parser extends EE {
102
102
  }
103
103
 
104
104
  [CONSUMEHEADER] (chunk, position) {
105
- const header = new Header(chunk, position, this[EX], this[GEX])
105
+ let header
106
+ try {
107
+ header = new Header(chunk, position, this[EX], this[GEX])
108
+ } catch (er) {
109
+ return this.warn('invalid entry', er)
110
+ }
106
111
 
107
112
  if (header.nullBlock)
108
113
  this[EMIT]('nullBlock')
package/lib/read-entry.js CHANGED
@@ -6,6 +6,10 @@ const SLURP = Symbol('slurp')
6
6
  module.exports = class ReadEntry extends MiniPass {
7
7
  constructor (header, ex, gex) {
8
8
  super()
9
+ // read entries always start life paused. this is to avoid the
10
+ // situation where Minipass's auto-ending empty streams results
11
+ // in an entry ending before we're ready for it.
12
+ this.pause()
9
13
  this.extended = ex
10
14
  this.globalExtended = gex
11
15
  this.header = header
@@ -231,7 +231,7 @@ const WriteEntry = warner(class WriteEntry extends MiniPass {
231
231
  er.path = this.absolute
232
232
  er.syscall = 'read'
233
233
  er.code = 'EOF'
234
- this[CLOSE](fd)
234
+ this[CLOSE](fd, _ => _)
235
235
  return this.emit('error', er)
236
236
  }
237
237
 
@@ -240,7 +240,7 @@ const WriteEntry = warner(class WriteEntry extends MiniPass {
240
240
  er.path = this.absolute
241
241
  er.syscall = 'read'
242
242
  er.code = 'EOF'
243
- this[CLOSE](fd)
243
+ this[CLOSE](fd, _ => _)
244
244
  return this.emit('error', er)
245
245
  }
246
246
 
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.9",
5
+ "version": "4.4.13",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/npm/node-tar.git"
@@ -11,14 +11,14 @@
11
11
  "test": "tap",
12
12
  "preversion": "npm test",
13
13
  "postversion": "npm publish",
14
- "postpublish": "git push origin --all; git push origin --tags",
14
+ "postpublish": "git push origin --follow-tags",
15
15
  "genparse": "node scripts/generate-parse-fixtures.js",
16
16
  "bench": "for i in benchmarks/*/*.js; do echo $i; for j in {1..5}; do node $i || break; done; done"
17
17
  },
18
18
  "dependencies": {
19
19
  "chownr": "^1.1.1",
20
20
  "fs-minipass": "^1.2.5",
21
- "minipass": "^2.3.5",
21
+ "minipass": "^2.8.6",
22
22
  "minizlib": "^1.2.1",
23
23
  "mkdirp": "^0.5.0",
24
24
  "safe-buffer": "^5.1.2",
@@ -30,7 +30,7 @@
30
30
  "events-to-array": "^1.1.2",
31
31
  "mutate-fs": "^2.1.1",
32
32
  "rimraf": "^2.6.3",
33
- "tap": "^14.2.0",
33
+ "tap": "^14.6.5",
34
34
  "tar-fs": "^1.16.3",
35
35
  "tar-stream": "^1.6.2"
36
36
  },