Socket
Socket
Sign inDemoInstall

@parcel/utils

Package Overview
Dependencies
Maintainers
1
Versions
877
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parcel/utils - npm Package Compare versions

Comparing version 2.0.0-nightly.173 to 2.0.0-nightly.177

3

lib/glob.js

@@ -74,4 +74,5 @@ "use strict";

}
});
}); // $FlowFixMe Added in Flow 0.121.0 upgrade in #4381
return (0, _fastGlob.default)(normalizePath(p), options);
}

@@ -10,2 +10,4 @@ "use strict";

exports.blobToStream = blobToStream;
exports.streamFromPromise = streamFromPromise;
exports.fallbackStream = fallbackStream;

@@ -52,2 +54,27 @@ var _stream = require("stream");

return readableFromStringOrBuffer(blob);
}
function streamFromPromise(promise) {
const stream = new _stream.PassThrough();
promise.then(blob => {
if (blob instanceof _stream.Readable) {
blob.pipe(stream);
} else {
stream.end(blob);
}
});
return stream;
}
function fallbackStream(stream, fallback) {
const res = new _stream.PassThrough();
stream.on('error', err => {
if (err.code === 'ENOENT') {
fallback().pipe(res);
} else {
res.emit('error', err);
}
});
stream.pipe(res);
return res;
}
{
"name": "@parcel/utils",
"version": "2.0.0-nightly.173+bac3f05f",
"version": "2.0.0-nightly.177+db7e3a12",
"description": "Blazing fast, zero configuration web application bundler",

@@ -20,6 +20,6 @@ "license": "MIT",

"@iarna/toml": "^2.2.0",
"@parcel/codeframe": "2.0.0-nightly.173+bac3f05f",
"@parcel/diagnostic": "2.0.0-nightly.173+bac3f05f",
"@parcel/logger": "2.0.0-nightly.173+bac3f05f",
"@parcel/markdown-ansi": "2.0.0-nightly.173+bac3f05f",
"@parcel/codeframe": "2.0.0-nightly.177+db7e3a12",
"@parcel/diagnostic": "2.0.0-nightly.177+db7e3a12",
"@parcel/logger": "2.0.0-nightly.177+db7e3a12",
"@parcel/markdown-ansi": "2.0.0-nightly.177+db7e3a12",
"ansi-html": "^0.0.7",

@@ -44,3 +44,3 @@ "chalk": "^2.4.2",

},
"gitHead": "bac3f05fa31574338f14ab9cd2c9bd78fb1c22ee"
"gitHead": "db7e3a12105630abc44058bff7a88eb612f12e75"
}

@@ -69,3 +69,4 @@ // @flow

// $FlowFixMe Added in Flow 0.121.0 upgrade in #4381
return fastGlob(normalizePath(p), options);
}
// @flow strict-local
import {Readable} from 'stream';
import {Readable, PassThrough} from 'stream';
import type {Blob} from '@parcel/types';

@@ -45,1 +45,31 @@

}
export function streamFromPromise(promise: Promise<Blob>): Readable {
const stream = new PassThrough();
promise.then(blob => {
if (blob instanceof Readable) {
blob.pipe(stream);
} else {
stream.end(blob);
}
});
return stream;
}
export function fallbackStream(
stream: Readable,
fallback: () => Readable,
): Readable {
const res = new PassThrough();
stream.on('error', err => {
if (err.code === 'ENOENT') {
fallback().pipe(res);
} else {
res.emit('error', err);
}
});
stream.pipe(res);
return res;
}
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