Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

unpack-stream

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unpack-stream - npm Package Compare versions

Comparing version 4.0.1 to 4.0.2

0

dist/index.d.ts

@@ -0,0 +0,0 @@ import { IncomingMessage } from 'http';

34

dist/index.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc