mirror of
https://github.com/crazy-max/ghaction-upx.git
synced 2025-12-09 22:40:42 -07:00
Update node_modules
This commit is contained in:
10
node_modules/get-stream/buffer-stream.js
generated
vendored
10
node_modules/get-stream/buffer-stream.js
generated
vendored
@@ -1,11 +1,11 @@
|
||||
'use strict';
|
||||
const PassThrough = require('stream').PassThrough;
|
||||
const {PassThrough} = require('stream');
|
||||
|
||||
module.exports = opts => {
|
||||
opts = Object.assign({}, opts);
|
||||
module.exports = options => {
|
||||
options = Object.assign({}, options);
|
||||
|
||||
const array = opts.array;
|
||||
let encoding = opts.encoding;
|
||||
const {array} = options;
|
||||
let {encoding} = options;
|
||||
const buffer = encoding === 'buffer';
|
||||
let objectMode = false;
|
||||
|
||||
|
||||
61
node_modules/get-stream/index.js
generated
vendored
61
node_modules/get-stream/index.js
generated
vendored
@@ -1,51 +1,50 @@
|
||||
'use strict';
|
||||
const pump = require('pump');
|
||||
const bufferStream = require('./buffer-stream');
|
||||
|
||||
function getStream(inputStream, opts) {
|
||||
class MaxBufferError extends Error {
|
||||
constructor() {
|
||||
super('maxBuffer exceeded');
|
||||
this.name = 'MaxBufferError';
|
||||
}
|
||||
}
|
||||
|
||||
function getStream(inputStream, options) {
|
||||
if (!inputStream) {
|
||||
return Promise.reject(new Error('Expected a stream'));
|
||||
}
|
||||
|
||||
opts = Object.assign({maxBuffer: Infinity}, opts);
|
||||
options = Object.assign({maxBuffer: Infinity}, options);
|
||||
|
||||
const {maxBuffer} = options;
|
||||
|
||||
const maxBuffer = opts.maxBuffer;
|
||||
let stream;
|
||||
let clean;
|
||||
|
||||
const p = new Promise((resolve, reject) => {
|
||||
const error = err => {
|
||||
if (err) { // null check
|
||||
err.bufferedData = stream.getBufferedValue();
|
||||
return new Promise((resolve, reject) => {
|
||||
const rejectPromise = error => {
|
||||
if (error) { // A null check
|
||||
error.bufferedData = stream.getBufferedValue();
|
||||
}
|
||||
|
||||
reject(err);
|
||||
reject(error);
|
||||
};
|
||||
|
||||
stream = bufferStream(opts);
|
||||
inputStream.once('error', error);
|
||||
inputStream.pipe(stream);
|
||||
stream = pump(inputStream, bufferStream(options), error => {
|
||||
if (error) {
|
||||
rejectPromise(error);
|
||||
return;
|
||||
}
|
||||
|
||||
resolve();
|
||||
});
|
||||
|
||||
stream.on('data', () => {
|
||||
if (stream.getBufferedLength() > maxBuffer) {
|
||||
reject(new Error('maxBuffer exceeded'));
|
||||
rejectPromise(new MaxBufferError());
|
||||
}
|
||||
});
|
||||
stream.once('error', error);
|
||||
stream.on('end', resolve);
|
||||
|
||||
clean = () => {
|
||||
// some streams doesn't implement the `stream.Readable` interface correctly
|
||||
if (inputStream.unpipe) {
|
||||
inputStream.unpipe(stream);
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
p.then(clean, clean);
|
||||
|
||||
return p.then(() => stream.getBufferedValue());
|
||||
}).then(() => stream.getBufferedValue());
|
||||
}
|
||||
|
||||
module.exports = getStream;
|
||||
module.exports.buffer = (stream, opts) => getStream(stream, Object.assign({}, opts, {encoding: 'buffer'}));
|
||||
module.exports.array = (stream, opts) => getStream(stream, Object.assign({}, opts, {array: true}));
|
||||
module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
|
||||
module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
|
||||
module.exports.MaxBufferError = MaxBufferError;
|
||||
|
||||
20
node_modules/get-stream/license
generated
vendored
20
node_modules/get-stream/license
generated
vendored
@@ -1,21 +1,9 @@
|
||||
The MIT License (MIT)
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
36
node_modules/get-stream/package.json
generated
vendored
36
node_modules/get-stream/package.json
generated
vendored
@@ -1,33 +1,31 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"get-stream@3.0.0",
|
||||
"get-stream@4.1.0",
|
||||
"/home/runner/work/ghaction-upx/ghaction-upx"
|
||||
]
|
||||
],
|
||||
"_from": "get-stream@3.0.0",
|
||||
"_id": "get-stream@3.0.0",
|
||||
"_from": "get-stream@4.1.0",
|
||||
"_id": "get-stream@4.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=",
|
||||
"_integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
|
||||
"_location": "/get-stream",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "get-stream@3.0.0",
|
||||
"raw": "get-stream@4.1.0",
|
||||
"name": "get-stream",
|
||||
"escapedName": "get-stream",
|
||||
"rawSpec": "3.0.0",
|
||||
"rawSpec": "4.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "3.0.0"
|
||||
"fetchSpec": "4.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/cacheable-request",
|
||||
"/download",
|
||||
"/got"
|
||||
"/download"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
|
||||
"_spec": "3.0.0",
|
||||
"_resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
|
||||
"_spec": "4.1.0",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
@@ -37,6 +35,9 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/get-stream/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"pump": "^3.0.0"
|
||||
},
|
||||
"description": "Get a stream as a string, buffer, or array",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
@@ -44,7 +45,7 @@
|
||||
"xo": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
"node": ">=6"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
@@ -57,7 +58,6 @@
|
||||
"promise",
|
||||
"concat",
|
||||
"string",
|
||||
"str",
|
||||
"text",
|
||||
"buffer",
|
||||
"read",
|
||||
@@ -66,8 +66,7 @@
|
||||
"readable",
|
||||
"readablestream",
|
||||
"array",
|
||||
"object",
|
||||
"obj"
|
||||
"object"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "get-stream",
|
||||
@@ -78,8 +77,5 @@
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "3.0.0",
|
||||
"xo": {
|
||||
"esnext": true
|
||||
}
|
||||
"version": "4.1.0"
|
||||
}
|
||||
|
||||
26
node_modules/get-stream/readme.md
generated
vendored
26
node_modules/get-stream/readme.md
generated
vendored
@@ -6,7 +6,7 @@
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save get-stream
|
||||
$ npm install get-stream
|
||||
```
|
||||
|
||||
|
||||
@@ -15,10 +15,11 @@ $ npm install --save get-stream
|
||||
```js
|
||||
const fs = require('fs');
|
||||
const getStream = require('get-stream');
|
||||
const stream = fs.createReadStream('unicorn.txt');
|
||||
|
||||
getStream(stream).then(str => {
|
||||
console.log(str);
|
||||
(async () => {
|
||||
const stream = fs.createReadStream('unicorn.txt');
|
||||
|
||||
console.log(await getStream(stream));
|
||||
/*
|
||||
,,))))))));,
|
||||
__)))))))))))))),
|
||||
@@ -40,7 +41,7 @@ getStream(stream).then(str => {
|
||||
\~\
|
||||
~~
|
||||
*/
|
||||
});
|
||||
})();
|
||||
```
|
||||
|
||||
|
||||
@@ -54,6 +55,8 @@ Get the `stream` as a string.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `Object`
|
||||
|
||||
##### encoding
|
||||
|
||||
Type: `string`<br>
|
||||
@@ -66,7 +69,7 @@ Default: `utf8`
|
||||
Type: `number`<br>
|
||||
Default: `Infinity`
|
||||
|
||||
Maximum length of the returned string. If it exceeds this value before the stream ends, the promise will be rejected.
|
||||
Maximum length of the returned string. If it exceeds this value before the stream ends, the promise will be rejected with a `getStream.MaxBufferError` error.
|
||||
|
||||
### getStream.buffer(stream, [options])
|
||||
|
||||
@@ -92,11 +95,14 @@ It honors both the `maxBuffer` and `encoding` options. The behavior changes slig
|
||||
If the input stream emits an `error` event, the promise will be rejected with the error. The buffered data will be attached to the `bufferedData` property of the error.
|
||||
|
||||
```js
|
||||
getStream(streamThatErrorsAtTheEnd('unicorn'))
|
||||
.catch(err => {
|
||||
console.log(err.bufferedData);
|
||||
(async () => {
|
||||
try {
|
||||
await getStream(streamThatErrorsAtTheEnd('unicorn'));
|
||||
} catch (error) {
|
||||
console.log(error.bufferedData);
|
||||
//=> 'unicorn'
|
||||
});
|
||||
}
|
||||
})()
|
||||
```
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user