unpack-stream
Advanced tools
Comparing version 1.2.0 to 2.0.0-beta.1
@@ -11,9 +11,18 @@ /// <reference types="node" /> | ||
export declare type Index = { | ||
[filename: string]: { | ||
type: 'file'; | ||
size: number; | ||
integrity: string; | ||
mtime: string; | ||
headers: { | ||
[filename: string]: { | ||
type: 'file'; | ||
size: number; | ||
mtime: string; | ||
}; | ||
}; | ||
integrityPromise: Promise<{ | ||
[filename: string]: { | ||
type: 'file'; | ||
size: number; | ||
integrity: string; | ||
mtime: string; | ||
}; | ||
}>; | ||
}; | ||
export declare function local(stream: NodeJS.ReadableStream, dest: string): Promise<{}>; |
@@ -47,2 +47,3 @@ "use strict"; | ||
const index = {}; | ||
const headers = {}; | ||
const integrityPromises = []; | ||
@@ -55,2 +56,3 @@ return new Promise((resolve, reject) => { | ||
mapStream(fileStream, header) { | ||
headers[header.name] = header; | ||
integrityPromises.push(ssri.fromStream(fileStream) | ||
@@ -69,5 +71,7 @@ .then((sri) => { | ||
.on('finish', () => { | ||
Promise.all(integrityPromises) | ||
.then(() => resolve(index)) | ||
.catch(reject); | ||
resolve({ | ||
headers, | ||
integrityPromise: Promise.all(integrityPromises) | ||
.then(() => index) | ||
}); | ||
}); | ||
@@ -74,0 +78,0 @@ }); |
{ | ||
"name": "unpack-stream", | ||
"version": "1.2.0", | ||
"version": "2.0.0-beta.1", | ||
"description": "Unpack a tarball stream", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
11034
104
1