tar 5.0.4 → 5.0.5

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,8 +8,11 @@
8
8
  // Only supported in Node v12.9.0 and above.
9
9
  const platform = process.env.__FAKE_PLATFORM__ || process.platform
10
10
  const isWindows = platform === 'win32'
11
- const fs = require('fs')
11
+ const fs = global.__FAKE_TESTING_FS__ || require('fs')
12
+
13
+ /* istanbul ignore next */
12
14
  const { O_CREAT, O_TRUNC, O_WRONLY, UV_FS_O_FILEMAP = 0 } = fs.constants
15
+
13
16
  const fMapEnabled = isWindows && !!UV_FS_O_FILEMAP
14
17
  const fMapLimit = 512 * 1024
15
18
  const fMapFlag = UV_FS_O_FILEMAP | O_TRUNC | O_CREAT | O_WRONLY
package/lib/pack.js CHANGED
@@ -75,10 +75,13 @@ const Pack = warner(class Pack extends MiniPass {
75
75
  if (typeof opt.onwarn === 'function')
76
76
  this.on('warn', opt.onwarn)
77
77
 
78
+ this.portable = !!opt.portable
78
79
  this.zip = null
79
80
  if (opt.gzip) {
80
81
  if (typeof opt.gzip !== 'object')
81
82
  opt.gzip = {}
83
+ if (this.portable)
84
+ opt.gzip.portable = true
82
85
  this.zip = new zlib.Gzip(opt.gzip)
83
86
  this.zip.on('data', chunk => super.write(chunk))
84
87
  this.zip.on('end', _ => super.end())
@@ -87,7 +90,6 @@ const Pack = warner(class Pack extends MiniPass {
87
90
  } else
88
91
  this.on('drain', this[ONDRAIN])
89
92
 
90
- this.portable = !!opt.portable
91
93
  this.noDirRecurse = !!opt.noDirRecurse
92
94
  this.follow = !!opt.follow
93
95
  this.noMtime = !!opt.noMtime
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.4",
5
+ "version": "5.0.5",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/npm/node-tar.git"
@@ -19,7 +19,7 @@
19
19
  "chownr": "^1.1.3",
20
20
  "fs-minipass": "^2.0.0",
21
21
  "minipass": "^3.0.0",
22
- "minizlib": "^2.0.0",
22
+ "minizlib": "^2.1.0",
23
23
  "mkdirp": "^0.5.0",
24
24
  "yallist": "^4.0.0"
25
25
  },