Comparing version 3.1.9 to 3.1.10
@@ -21,2 +21,4 @@ 'use strict' | ||
files = Array.from(files) | ||
const opt = hlo(opt_) | ||
@@ -23,0 +25,0 @@ |
@@ -11,3 +11,3 @@ 'use strict' | ||
if (typeof opt_ === 'function') | ||
cb = opt_, files = [], opt_ = {} | ||
cb = opt_, files = null, opt_ = {} | ||
else if (Array.isArray(opt_)) | ||
@@ -17,6 +17,8 @@ files = opt_, opt_ = {} | ||
if (typeof files === 'function') | ||
cb = files, files = [] | ||
cb = files, files = null | ||
if (!files) | ||
files = [] | ||
else | ||
files = Array.from(files) | ||
@@ -23,0 +25,0 @@ const opt = hlo(opt_) |
@@ -14,3 +14,3 @@ 'use strict' | ||
if (typeof opt_ === 'function') | ||
cb = opt_, files = [], opt_ = {} | ||
cb = opt_, files = null, opt_ = {} | ||
else if (Array.isArray(opt_)) | ||
@@ -20,6 +20,8 @@ files = opt_, opt_ = {} | ||
if (typeof files === 'function') | ||
cb = files, files = [] | ||
cb = files, files = null | ||
if (!files) | ||
files = [] | ||
else | ||
files = Array.from(files) | ||
@@ -26,0 +28,0 @@ const opt = hlo(opt_) |
@@ -132,3 +132,3 @@ 'use strict' | ||
if (this.prefix) | ||
p.path = this.prefix + '/' + p.path | ||
p.path = this.prefix + '/' + p.path.replace(/^\.\/*/, '') | ||
@@ -152,3 +152,4 @@ // in this case, we don't have to wait for the stat | ||
if (this.prefix) | ||
p = this.prefix + '/' + p | ||
p = this.prefix + '/' + p.replace(/^\.\/*/, '') | ||
this[QUEUE].push(new PackJob(p, absolute)) | ||
@@ -322,3 +323,7 @@ this[PROCESS]() | ||
job.readdir.forEach(entry => { | ||
const base = job.path === './' ? '' : job.path.replace(/\/*$/, '/') | ||
const p = this.prefix ? | ||
job.path.slice(this.prefix.length + 1) || './' | ||
: job.path | ||
const base = p === './' ? '' : p.replace(/\/*$/, '/') | ||
this[ADDFSENTRY](base + entry) | ||
@@ -375,3 +380,9 @@ }) | ||
job.readdir.forEach(entry => { | ||
this[ADDFSENTRY](job.path + '/' + entry) | ||
const p = this.prefix ? | ||
job.path.slice(this.prefix.length + 1) || './' | ||
: job.path | ||
const base = p === './' ? '' : p.replace(/\/*$/, '/') | ||
this[ADDFSENTRY](base + entry) | ||
}) | ||
@@ -378,0 +389,0 @@ |
@@ -243,3 +243,3 @@ 'use strict' | ||
this[EX] = this[EX] || Object.create(null) | ||
this[EX].path = this[META] | ||
this[EX].path = this[META].replace(/\0.*/, '') | ||
break | ||
@@ -249,3 +249,3 @@ | ||
this[EX] = this[EX] || Object.create(null) | ||
this[EX].linkpath = this[META] | ||
this[EX].linkpath = this[META].replace(/\0.*/, '') | ||
break | ||
@@ -252,0 +252,0 @@ |
@@ -31,2 +31,4 @@ 'use strict' | ||
files = Array.from(files) | ||
return opt.sync ? replaceSync(opt, files) | ||
@@ -96,2 +98,3 @@ : replace(opt, files, cb) | ||
const replace = (opt, files, cb) => { | ||
files = Array.from(files) | ||
const p = new Pack(opt) | ||
@@ -98,0 +101,0 @@ |
@@ -45,2 +45,5 @@ 'use strict' | ||
this.writable = true | ||
this.readable = false | ||
this[PENDING] = 0 | ||
@@ -90,4 +93,7 @@ this[ENDED] = false | ||
[MAYBECLOSE] () { | ||
if (this[ENDED] && this[PENDING] === 0) | ||
if (this[ENDED] && this[PENDING] === 0) { | ||
this.emit('prefinish') | ||
this.emit('finish') | ||
this.emit('close') | ||
} | ||
} | ||
@@ -94,0 +100,0 @@ |
@@ -21,2 +21,4 @@ 'use strict' | ||
files = Array.from(files) | ||
mtimeFilter(opt) | ||
@@ -23,0 +25,0 @@ return r(opt, files, cb) |
@@ -5,3 +5,3 @@ { | ||
"description": "tar for node", | ||
"version": "3.1.9", | ||
"version": "3.1.10", | ||
"repository": { | ||
@@ -27,2 +27,3 @@ "type": "git", | ||
"chmodr": "^1.0.2", | ||
"end-of-stream": "^1.4.0", | ||
"events-to-array": "^1.1.2", | ||
@@ -37,3 +38,3 @@ "mutate-fs": "^1.1.0", | ||
"engines": { | ||
"node": ">=4" | ||
"node": ">=4.5" | ||
}, | ||
@@ -40,0 +41,0 @@ "files": [ |
# node-tar | ||
[![Build Status](https://travis-ci.org/npm/node-tar.svg?branch=master)](https://travis-ci.org/npm/node-tar) | ||
[Fast](./benchmarks) and full-featured Tar for Node.js | ||
@@ -4,0 +6,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
117644
2668
855
8