unpack-stream
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -0,0 +0,0 @@ import { IncomingMessage } from 'http'; |
@@ -5,4 +5,6 @@ "use strict"; | ||
const decompress = require("decompress-maybe"); | ||
const isWindows = require("is-windows"); | ||
const tar = require("tar-fs"); | ||
const ssri = require("ssri"); | ||
const IS_WINDOWS = isWindows(); | ||
function remote(stream, dest, opts) { | ||
@@ -44,9 +46,35 @@ opts = opts || {}; | ||
exports.remote = remote; | ||
const createIgnorer = !IS_WINDOWS | ||
? (ignore) => { | ||
if (ignore) { | ||
return (filename, header) => ignore(header.name); | ||
} | ||
return () => false; | ||
} | ||
: (ignore) => { | ||
const lowercaseFiles = new Set(); | ||
if (ignore) { | ||
return (filename, header) => { | ||
const lowercaseFilename = filename.toLowerCase(); | ||
if (lowercaseFiles.has(lowercaseFilename)) { | ||
return true; | ||
} | ||
lowercaseFiles.add(lowercaseFilename); | ||
return ignore(header.name); | ||
}; | ||
} | ||
return (filename, header) => { | ||
const lowercaseFilename = filename.toLowerCase(); | ||
if (lowercaseFiles.has(lowercaseFilename)) { | ||
return true; | ||
} | ||
lowercaseFiles.add(lowercaseFilename); | ||
return false; | ||
}; | ||
}; | ||
function local(stream, dest, opts) { | ||
opts = opts || {}; | ||
const ignore = opts.ignore && function (filename, header) { return opts.ignore(header.name); } || function () { return false; }; | ||
const ignore = createIgnorer(opts.ignore); | ||
const generateIntegrity = opts.generateIntegrity !== false; | ||
const index = {}; | ||
const headers = {}; | ||
const integrityPromises = []; | ||
return new Promise((resolve, reject) => { | ||
@@ -53,0 +81,0 @@ stream |
{ | ||
"name": "unpack-stream", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "Unpack a tarball stream", | ||
@@ -37,4 +37,6 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@types/is-windows": "^0.2.0", | ||
"@types/node": "^10.0.8", | ||
"decompress-maybe": "^1.0.0", | ||
"is-windows": "^1.0.2", | ||
"ssri": "^6.0.0", | ||
@@ -45,2 +47,3 @@ "tar-fs": "^2.0.0" | ||
"@types/tape": "^4.2.30", | ||
"@types/tempy": "^0.2.0", | ||
"got": "^8.0.0", | ||
@@ -53,2 +56,3 @@ "ignorable": "^1.0.1", | ||
"tape": "^4.7.0", | ||
"tempy": "^0.2.1", | ||
"ts-node": "^8.0.2", | ||
@@ -55,0 +59,0 @@ "typescript": "^3.0.0" |
Sorry, the diff of this file is not supported yet
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
13326
119
6
12
+ Added@types/is-windows@^0.2.0
+ Addedis-windows@^1.0.2
+ Added@types/is-windows@0.2.0(transitive)
+ Addedis-windows@1.0.2(transitive)