mirror of
https://github.com/crazy-max/ghaction-upx.git
synced 2024-12-23 00:26:08 -07:00
Update node_modules
This commit is contained in:
parent
c5091ccc7b
commit
4bcd932c28
2
node_modules/buffer/AUTHORS.md
generated
vendored
2
node_modules/buffer/AUTHORS.md
generated
vendored
|
@ -56,5 +56,7 @@
|
|||
- kumavis (aaron@kumavis.me)
|
||||
- Sergey Ukustov (sergey.ukustov@machinomy.com)
|
||||
- Fei Liu (liu.feiwood@gmail.com)
|
||||
- Blaine Bublitz (blaine.bublitz@gmail.com)
|
||||
- Niklas Mischkulnig (mischnic@users.noreply.github.com)
|
||||
|
||||
#### Generated by bin/update-authors.sh.
|
||||
|
|
7
node_modules/buffer/README.md
generated
vendored
7
node_modules/buffer/README.md
generated
vendored
|
@ -34,6 +34,11 @@ instance methods, and class methods that are supported.
|
|||
- Does not modify any browser prototypes or put anything on `window`
|
||||
- Comprehensive test suite (including all buffer tests from node.js core)
|
||||
|
||||
## `buffer` for enterprise
|
||||
|
||||
Available as part of the Tidelift Subscription.
|
||||
|
||||
The maintainers of `buffer` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-buffer?utm_source=npm-buffer&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
||||
|
||||
## install
|
||||
|
||||
|
@ -43,8 +48,6 @@ To use this module directly (without browserify), install it:
|
|||
npm install buffer
|
||||
```
|
||||
|
||||
[Get supported buffer with the Tidelift Subscription](https://tidelift.com/subscription/pkg/npm-buffer?utm_source=npm-buffer&utm_medium=referral&utm_campaign=readme)
|
||||
|
||||
This module was previously called **native-buffer-browserify**, but please use **buffer**
|
||||
from now on.
|
||||
|
||||
|
|
6
node_modules/buffer/index.js
generated
vendored
6
node_modules/buffer/index.js
generated
vendored
|
@ -142,6 +142,12 @@ function from (value, encodingOrOffset, length) {
|
|||
return fromArrayBuffer(value, encodingOrOffset, length)
|
||||
}
|
||||
|
||||
if (typeof SharedArrayBuffer !== 'undefined' &&
|
||||
(isInstance(value, SharedArrayBuffer) ||
|
||||
(value && isInstance(value.buffer, SharedArrayBuffer)))) {
|
||||
return fromArrayBuffer(value, encodingOrOffset, length)
|
||||
}
|
||||
|
||||
if (typeof value === 'number') {
|
||||
throw new TypeError(
|
||||
'The "value" argument must not be of type number. Received type number'
|
||||
|
|
25
node_modules/buffer/package.json
generated
vendored
25
node_modules/buffer/package.json
generated
vendored
|
@ -1,31 +1,31 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"buffer@5.4.3",
|
||||
"buffer@5.5.0",
|
||||
"/home/runner/work/ghaction-upx/ghaction-upx"
|
||||
]
|
||||
],
|
||||
"_from": "buffer@5.4.3",
|
||||
"_id": "buffer@5.4.3",
|
||||
"_from": "buffer@5.5.0",
|
||||
"_id": "buffer@5.5.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-zvj65TkFeIt3i6aj5bIvJDzjjQQGs4o/sNoezg1F1kYap9Nu2jcUdpwzRSJTHMMzG0H7bZkn4rNQpImhuxWX2A==",
|
||||
"_integrity": "sha512-9FTEDjLjwoAkEwyMGDjYJQN2gfRgOKBKRfiglhvibGbpeeU/pQn1bJxQqm32OD/AIeEuHxU9roxXxg34Byp/Ww==",
|
||||
"_location": "/buffer",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "buffer@5.4.3",
|
||||
"raw": "buffer@5.5.0",
|
||||
"name": "buffer",
|
||||
"escapedName": "buffer",
|
||||
"rawSpec": "5.4.3",
|
||||
"rawSpec": "5.5.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "5.4.3"
|
||||
"fetchSpec": "5.5.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/unbzip2-stream"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/buffer/-/buffer-5.4.3.tgz",
|
||||
"_spec": "5.4.3",
|
||||
"_resolved": "https://registry.npmjs.org/buffer/-/buffer-5.5.0.tgz",
|
||||
"_spec": "5.5.0",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx",
|
||||
"author": {
|
||||
"name": "Feross Aboukhadijeh",
|
||||
|
@ -51,7 +51,7 @@
|
|||
},
|
||||
"description": "Node.js Buffer API, for the browser",
|
||||
"devDependencies": {
|
||||
"airtap": "^2.0.3",
|
||||
"airtap": "^3.0.0",
|
||||
"benchmark": "^2.0.0",
|
||||
"browserify": "^16.1.0",
|
||||
"concat-stream": "^2.0.0",
|
||||
|
@ -106,8 +106,11 @@
|
|||
"test/common.js",
|
||||
"test/_polyfill.js",
|
||||
"perf/**/*.js"
|
||||
],
|
||||
"globals": [
|
||||
"SharedArrayBuffer"
|
||||
]
|
||||
},
|
||||
"types": "index.d.ts",
|
||||
"version": "5.4.3"
|
||||
"version": "5.5.0"
|
||||
}
|
||||
|
|
51
node_modules/cacheable-request/node_modules/get-stream/buffer-stream.js
generated
vendored
Normal file
51
node_modules/cacheable-request/node_modules/get-stream/buffer-stream.js
generated
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
'use strict';
|
||||
const PassThrough = require('stream').PassThrough;
|
||||
|
||||
module.exports = opts => {
|
||||
opts = Object.assign({}, opts);
|
||||
|
||||
const array = opts.array;
|
||||
let encoding = opts.encoding;
|
||||
const buffer = encoding === 'buffer';
|
||||
let objectMode = false;
|
||||
|
||||
if (array) {
|
||||
objectMode = !(encoding || buffer);
|
||||
} else {
|
||||
encoding = encoding || 'utf8';
|
||||
}
|
||||
|
||||
if (buffer) {
|
||||
encoding = null;
|
||||
}
|
||||
|
||||
let len = 0;
|
||||
const ret = [];
|
||||
const stream = new PassThrough({objectMode});
|
||||
|
||||
if (encoding) {
|
||||
stream.setEncoding(encoding);
|
||||
}
|
||||
|
||||
stream.on('data', chunk => {
|
||||
ret.push(chunk);
|
||||
|
||||
if (objectMode) {
|
||||
len = ret.length;
|
||||
} else {
|
||||
len += chunk.length;
|
||||
}
|
||||
});
|
||||
|
||||
stream.getBufferedValue = () => {
|
||||
if (array) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
return buffer ? Buffer.concat(ret, len) : ret.join('');
|
||||
};
|
||||
|
||||
stream.getBufferedLength = () => len;
|
||||
|
||||
return stream;
|
||||
};
|
51
node_modules/cacheable-request/node_modules/get-stream/index.js
generated
vendored
Normal file
51
node_modules/cacheable-request/node_modules/get-stream/index.js
generated
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
'use strict';
|
||||
const bufferStream = require('./buffer-stream');
|
||||
|
||||
function getStream(inputStream, opts) {
|
||||
if (!inputStream) {
|
||||
return Promise.reject(new Error('Expected a stream'));
|
||||
}
|
||||
|
||||
opts = Object.assign({maxBuffer: Infinity}, opts);
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
reject(err);
|
||||
};
|
||||
|
||||
stream = bufferStream(opts);
|
||||
inputStream.once('error', error);
|
||||
inputStream.pipe(stream);
|
||||
|
||||
stream.on('data', () => {
|
||||
if (stream.getBufferedLength() > maxBuffer) {
|
||||
reject(new Error('maxBuffer exceeded'));
|
||||
}
|
||||
});
|
||||
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());
|
||||
}
|
||||
|
||||
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}));
|
83
node_modules/cacheable-request/node_modules/get-stream/package.json
generated
vendored
Normal file
83
node_modules/cacheable-request/node_modules/get-stream/package.json
generated
vendored
Normal file
|
@ -0,0 +1,83 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"get-stream@3.0.0",
|
||||
"/home/runner/work/ghaction-upx/ghaction-upx"
|
||||
]
|
||||
],
|
||||
"_from": "get-stream@3.0.0",
|
||||
"_id": "get-stream@3.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=",
|
||||
"_location": "/cacheable-request/get-stream",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "get-stream@3.0.0",
|
||||
"name": "get-stream",
|
||||
"escapedName": "get-stream",
|
||||
"rawSpec": "3.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "3.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/cacheable-request"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
|
||||
"_spec": "3.0.0",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/get-stream/issues"
|
||||
},
|
||||
"description": "Get a stream as a string, buffer, or array",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"into-stream": "^3.0.0",
|
||||
"xo": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"buffer-stream.js"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/get-stream#readme",
|
||||
"keywords": [
|
||||
"get",
|
||||
"stream",
|
||||
"promise",
|
||||
"concat",
|
||||
"string",
|
||||
"str",
|
||||
"text",
|
||||
"buffer",
|
||||
"read",
|
||||
"data",
|
||||
"consume",
|
||||
"readable",
|
||||
"readablestream",
|
||||
"array",
|
||||
"object",
|
||||
"obj"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "get-stream",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/get-stream.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "3.0.0",
|
||||
"xo": {
|
||||
"esnext": true
|
||||
}
|
||||
}
|
117
node_modules/cacheable-request/node_modules/get-stream/readme.md
generated
vendored
Normal file
117
node_modules/cacheable-request/node_modules/get-stream/readme.md
generated
vendored
Normal file
|
@ -0,0 +1,117 @@
|
|||
# get-stream [![Build Status](https://travis-ci.org/sindresorhus/get-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/get-stream)
|
||||
|
||||
> Get a stream as a string, buffer, or array
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save get-stream
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const fs = require('fs');
|
||||
const getStream = require('get-stream');
|
||||
const stream = fs.createReadStream('unicorn.txt');
|
||||
|
||||
getStream(stream).then(str => {
|
||||
console.log(str);
|
||||
/*
|
||||
,,))))))));,
|
||||
__)))))))))))))),
|
||||
\|/ -\(((((''''((((((((.
|
||||
-*-==//////(('' . `)))))),
|
||||
/|\ ))| o ;-. '((((( ,(,
|
||||
( `| / ) ;))))' ,_))^;(~
|
||||
| | | ,))((((_ _____------~~~-. %,;(;(>';'~
|
||||
o_); ; )))(((` ~---~ `:: \ %%~~)(v;(`('~
|
||||
; ''''```` `: `:::|\,__,%% );`'; ~
|
||||
| _ ) / `:|`----' `-'
|
||||
______/\/~ | / /
|
||||
/~;;.____/;;' / ___--,-( `;;;/
|
||||
/ // _;______;'------~~~~~ /;;/\ /
|
||||
// | | / ; \;;,\
|
||||
(<_ | ; /',/-----' _>
|
||||
\_| ||_ //~;~~~~~~~~~
|
||||
`\_| (,~~
|
||||
\~\
|
||||
~~
|
||||
*/
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
The methods returns a promise that resolves when the `end` event fires on the stream, indicating that there is no more data to be read. The stream is switched to flowing mode.
|
||||
|
||||
### getStream(stream, [options])
|
||||
|
||||
Get the `stream` as a string.
|
||||
|
||||
#### options
|
||||
|
||||
##### encoding
|
||||
|
||||
Type: `string`<br>
|
||||
Default: `utf8`
|
||||
|
||||
[Encoding](https://nodejs.org/api/buffer.html#buffer_buffer) of the incoming stream.
|
||||
|
||||
##### maxBuffer
|
||||
|
||||
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.
|
||||
|
||||
### getStream.buffer(stream, [options])
|
||||
|
||||
Get the `stream` as a buffer.
|
||||
|
||||
It honors the `maxBuffer` option as above, but it refers to byte length rather than string length.
|
||||
|
||||
### getStream.array(stream, [options])
|
||||
|
||||
Get the `stream` as an array of values.
|
||||
|
||||
It honors both the `maxBuffer` and `encoding` options. The behavior changes slightly based on the encoding chosen:
|
||||
|
||||
- When `encoding` is unset, it assumes an [object mode stream](https://nodesource.com/blog/understanding-object-streams/) and collects values emitted from `stream` unmodified. In this case `maxBuffer` refers to the number of items in the array (not the sum of their sizes).
|
||||
|
||||
- When `encoding` is set to `buffer`, it collects an array of buffers. `maxBuffer` refers to the summed byte lengths of every buffer in the array.
|
||||
|
||||
- When `encoding` is set to anything else, it collects an array of strings. `maxBuffer` refers to the summed character lengths of every string in the array.
|
||||
|
||||
|
||||
## Errors
|
||||
|
||||
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);
|
||||
//=> 'unicorn'
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## FAQ
|
||||
|
||||
### How is this different from [`concat-stream`](https://github.com/maxogden/concat-stream)?
|
||||
|
||||
This module accepts a stream instead of being one and returns a promise instead of using a callback. The API is simpler and it only supports returning a string, buffer, or array. It doesn't have a fragile type inference. You explicitly choose what you want. And it doesn't depend on the huge `readable-stream` package.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [get-stdin](https://github.com/sindresorhus/get-stdin) - Get stdin as a string or buffer
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
37
node_modules/caw/index.js
generated
vendored
37
node_modules/caw/index.js
generated
vendored
|
@ -1,37 +0,0 @@
|
|||
'use strict';
|
||||
const url = require('url');
|
||||
const getProxy = require('get-proxy');
|
||||
const isurl = require('isurl');
|
||||
const tunnelAgent = require('tunnel-agent');
|
||||
const urlToOptions = require('url-to-options');
|
||||
|
||||
module.exports = (proxy, opts) => {
|
||||
proxy = proxy || getProxy();
|
||||
opts = Object.assign({}, opts);
|
||||
|
||||
if (typeof proxy === 'object') {
|
||||
opts = proxy;
|
||||
proxy = getProxy();
|
||||
}
|
||||
|
||||
if (!proxy) {
|
||||
return null;
|
||||
}
|
||||
|
||||
proxy = isurl.lenient(proxy) ? urlToOptions(proxy) : url.parse(proxy);
|
||||
|
||||
const uriProtocol = opts.protocol === 'https' ? 'https' : 'http';
|
||||
const proxyProtocol = proxy.protocol === 'https:' ? 'Https' : 'Http';
|
||||
const port = proxy.port || (proxyProtocol === 'Https' ? 443 : 80);
|
||||
const method = `${uriProtocol}Over${proxyProtocol}`;
|
||||
|
||||
delete opts.protocol;
|
||||
|
||||
return tunnelAgent[method](Object.assign({
|
||||
proxy: {
|
||||
port,
|
||||
host: proxy.hostname,
|
||||
proxyAuth: proxy.auth
|
||||
}
|
||||
}, opts));
|
||||
};
|
84
node_modules/caw/package.json
generated
vendored
84
node_modules/caw/package.json
generated
vendored
|
@ -1,84 +0,0 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"caw@2.0.1",
|
||||
"/home/runner/work/ghaction-upx/ghaction-upx"
|
||||
]
|
||||
],
|
||||
"_from": "caw@2.0.1",
|
||||
"_id": "caw@2.0.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-Cg8/ZSBEa8ZVY9HspcGUYaK63d/bN7rqS3CYCzEGUxuYv6UlmcjzDUz2fCFFHyTvUW5Pk0I+3hkA3iXlIj6guA==",
|
||||
"_location": "/caw",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "caw@2.0.1",
|
||||
"name": "caw",
|
||||
"escapedName": "caw",
|
||||
"rawSpec": "2.0.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "2.0.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/download"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/caw/-/caw-2.0.1.tgz",
|
||||
"_spec": "2.0.1",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx",
|
||||
"author": {
|
||||
"name": "Kevin Mårtensson",
|
||||
"email": "kevinmartensson@gmail.com",
|
||||
"url": "github.com/kevva"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/kevva/caw/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"get-proxy": "^2.0.0",
|
||||
"isurl": "^1.0.0-alpha5",
|
||||
"tunnel-agent": "^0.6.0",
|
||||
"url-to-options": "^1.0.1"
|
||||
},
|
||||
"description": "Construct HTTP/HTTPS agents for tunneling proxies",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"create-cert": "^1.0.4",
|
||||
"get-port": "^3.1.0",
|
||||
"got": "^7.0.0",
|
||||
"pify": "^3.0.0",
|
||||
"proxyquire": "^1.7.9",
|
||||
"sinon": "^2.3.1",
|
||||
"universal-url": "1.0.0-alpha",
|
||||
"xo": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/kevva/caw#readme",
|
||||
"keywords": [
|
||||
"http",
|
||||
"https",
|
||||
"proxy",
|
||||
"tunnel"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "caw",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/kevva/caw.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "2.0.1",
|
||||
"xo": {
|
||||
"rules": {
|
||||
"ava/no-skip-test": 0
|
||||
}
|
||||
}
|
||||
}
|
51
node_modules/caw/readme.md
generated
vendored
51
node_modules/caw/readme.md
generated
vendored
|
@ -1,51 +0,0 @@
|
|||
# caw [![Build Status](https://travis-ci.org/kevva/caw.svg?branch=master)](https://travis-ci.org/kevva/caw)
|
||||
|
||||
> Construct HTTP/HTTPS agents for tunneling proxies
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install caw
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const caw = require('caw');
|
||||
const got = require('got');
|
||||
|
||||
got('todomvc.com', {
|
||||
agent: caw()
|
||||
}, () => {});
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### caw([proxy], [options])
|
||||
|
||||
#### proxy
|
||||
|
||||
Type: `string`
|
||||
|
||||
Proxy URL. If not set, it'll try getting it using [`get-proxy`](https://github.com/kevva/get-proxy).
|
||||
|
||||
#### options
|
||||
|
||||
Type: `Object`
|
||||
|
||||
Besides the options below, you can pass in options allowed in [tunnel-agent](https://github.com/request/tunnel-agent).
|
||||
|
||||
##### protocol
|
||||
|
||||
Type: `string`<br>
|
||||
Default: `http`
|
||||
|
||||
Endpoint protocol.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Kevin Mårtensson](https://github.com/kevva)
|
22
node_modules/config-chain/LICENCE
generated
vendored
22
node_modules/config-chain/LICENCE
generated
vendored
|
@ -1,22 +0,0 @@
|
|||
Copyright (c) 2011 Dominic Tarr
|
||||
|
||||
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 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.
|
282
node_modules/config-chain/index.js
generated
vendored
282
node_modules/config-chain/index.js
generated
vendored
|
@ -1,282 +0,0 @@
|
|||
var ProtoList = require('proto-list')
|
||||
, path = require('path')
|
||||
, fs = require('fs')
|
||||
, ini = require('ini')
|
||||
, EE = require('events').EventEmitter
|
||||
, url = require('url')
|
||||
, http = require('http')
|
||||
|
||||
var exports = module.exports = function () {
|
||||
var args = [].slice.call(arguments)
|
||||
, conf = new ConfigChain()
|
||||
|
||||
while(args.length) {
|
||||
var a = args.shift()
|
||||
if(a) conf.push
|
||||
( 'string' === typeof a
|
||||
? json(a)
|
||||
: a )
|
||||
}
|
||||
|
||||
return conf
|
||||
}
|
||||
|
||||
//recursively find a file...
|
||||
|
||||
var find = exports.find = function () {
|
||||
var rel = path.join.apply(null, [].slice.call(arguments))
|
||||
|
||||
function find(start, rel) {
|
||||
var file = path.join(start, rel)
|
||||
try {
|
||||
fs.statSync(file)
|
||||
return file
|
||||
} catch (err) {
|
||||
if(path.dirname(start) !== start) // root
|
||||
return find(path.dirname(start), rel)
|
||||
}
|
||||
}
|
||||
return find(__dirname, rel)
|
||||
}
|
||||
|
||||
var parse = exports.parse = function (content, file, type) {
|
||||
content = '' + content
|
||||
// if we don't know what it is, try json and fall back to ini
|
||||
// if we know what it is, then it must be that.
|
||||
if (!type) {
|
||||
try { return JSON.parse(content) }
|
||||
catch (er) { return ini.parse(content) }
|
||||
} else if (type === 'json') {
|
||||
if (this.emit) {
|
||||
try { return JSON.parse(content) }
|
||||
catch (er) { this.emit('error', er) }
|
||||
} else {
|
||||
return JSON.parse(content)
|
||||
}
|
||||
} else {
|
||||
return ini.parse(content)
|
||||
}
|
||||
}
|
||||
|
||||
var json = exports.json = function () {
|
||||
var args = [].slice.call(arguments).filter(function (arg) { return arg != null })
|
||||
var file = path.join.apply(null, args)
|
||||
var content
|
||||
try {
|
||||
content = fs.readFileSync(file,'utf-8')
|
||||
} catch (err) {
|
||||
return
|
||||
}
|
||||
return parse(content, file, 'json')
|
||||
}
|
||||
|
||||
var env = exports.env = function (prefix, env) {
|
||||
env = env || process.env
|
||||
var obj = {}
|
||||
var l = prefix.length
|
||||
for(var k in env) {
|
||||
if(k.indexOf(prefix) === 0)
|
||||
obj[k.substring(l)] = env[k]
|
||||
}
|
||||
|
||||
return obj
|
||||
}
|
||||
|
||||
exports.ConfigChain = ConfigChain
|
||||
function ConfigChain () {
|
||||
EE.apply(this)
|
||||
ProtoList.apply(this, arguments)
|
||||
this._awaiting = 0
|
||||
this._saving = 0
|
||||
this.sources = {}
|
||||
}
|
||||
|
||||
// multi-inheritance-ish
|
||||
var extras = {
|
||||
constructor: { value: ConfigChain }
|
||||
}
|
||||
Object.keys(EE.prototype).forEach(function (k) {
|
||||
extras[k] = Object.getOwnPropertyDescriptor(EE.prototype, k)
|
||||
})
|
||||
ConfigChain.prototype = Object.create(ProtoList.prototype, extras)
|
||||
|
||||
ConfigChain.prototype.del = function (key, where) {
|
||||
// if not specified where, then delete from the whole chain, scorched
|
||||
// earth style
|
||||
if (where) {
|
||||
var target = this.sources[where]
|
||||
target = target && target.data
|
||||
if (!target) {
|
||||
return this.emit('error', new Error('not found '+where))
|
||||
}
|
||||
delete target[key]
|
||||
} else {
|
||||
for (var i = 0, l = this.list.length; i < l; i ++) {
|
||||
delete this.list[i][key]
|
||||
}
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
||||
ConfigChain.prototype.set = function (key, value, where) {
|
||||
var target
|
||||
|
||||
if (where) {
|
||||
target = this.sources[where]
|
||||
target = target && target.data
|
||||
if (!target) {
|
||||
return this.emit('error', new Error('not found '+where))
|
||||
}
|
||||
} else {
|
||||
target = this.list[0]
|
||||
if (!target) {
|
||||
return this.emit('error', new Error('cannot set, no confs!'))
|
||||
}
|
||||
}
|
||||
target[key] = value
|
||||
return this
|
||||
}
|
||||
|
||||
ConfigChain.prototype.get = function (key, where) {
|
||||
if (where) {
|
||||
where = this.sources[where]
|
||||
if (where) where = where.data
|
||||
if (where && Object.hasOwnProperty.call(where, key)) return where[key]
|
||||
return undefined
|
||||
}
|
||||
return this.list[0][key]
|
||||
}
|
||||
|
||||
ConfigChain.prototype.save = function (where, type, cb) {
|
||||
if (typeof type === 'function') cb = type, type = null
|
||||
var target = this.sources[where]
|
||||
if (!target || !(target.path || target.source) || !target.data) {
|
||||
// TODO: maybe save() to a url target could be a PUT or something?
|
||||
// would be easy to swap out with a reddis type thing, too
|
||||
return this.emit('error', new Error('bad save target: '+where))
|
||||
}
|
||||
|
||||
if (target.source) {
|
||||
var pref = target.prefix || ''
|
||||
Object.keys(target.data).forEach(function (k) {
|
||||
target.source[pref + k] = target.data[k]
|
||||
})
|
||||
return this
|
||||
}
|
||||
|
||||
var type = type || target.type
|
||||
var data = target.data
|
||||
if (target.type === 'json') {
|
||||
data = JSON.stringify(data)
|
||||
} else {
|
||||
data = ini.stringify(data)
|
||||
}
|
||||
|
||||
this._saving ++
|
||||
fs.writeFile(target.path, data, 'utf8', function (er) {
|
||||
this._saving --
|
||||
if (er) {
|
||||
if (cb) return cb(er)
|
||||
else return this.emit('error', er)
|
||||
}
|
||||
if (this._saving === 0) {
|
||||
if (cb) cb()
|
||||
this.emit('save')
|
||||
}
|
||||
}.bind(this))
|
||||
return this
|
||||
}
|
||||
|
||||
ConfigChain.prototype.addFile = function (file, type, name) {
|
||||
name = name || file
|
||||
var marker = {__source__:name}
|
||||
this.sources[name] = { path: file, type: type }
|
||||
this.push(marker)
|
||||
this._await()
|
||||
fs.readFile(file, 'utf8', function (er, data) {
|
||||
if (er) this.emit('error', er)
|
||||
this.addString(data, file, type, marker)
|
||||
}.bind(this))
|
||||
return this
|
||||
}
|
||||
|
||||
ConfigChain.prototype.addEnv = function (prefix, env, name) {
|
||||
name = name || 'env'
|
||||
var data = exports.env(prefix, env)
|
||||
this.sources[name] = { data: data, source: env, prefix: prefix }
|
||||
return this.add(data, name)
|
||||
}
|
||||
|
||||
ConfigChain.prototype.addUrl = function (req, type, name) {
|
||||
this._await()
|
||||
var href = url.format(req)
|
||||
name = name || href
|
||||
var marker = {__source__:name}
|
||||
this.sources[name] = { href: href, type: type }
|
||||
this.push(marker)
|
||||
http.request(req, function (res) {
|
||||
var c = []
|
||||
var ct = res.headers['content-type']
|
||||
if (!type) {
|
||||
type = ct.indexOf('json') !== -1 ? 'json'
|
||||
: ct.indexOf('ini') !== -1 ? 'ini'
|
||||
: href.match(/\.json$/) ? 'json'
|
||||
: href.match(/\.ini$/) ? 'ini'
|
||||
: null
|
||||
marker.type = type
|
||||
}
|
||||
|
||||
res.on('data', c.push.bind(c))
|
||||
.on('end', function () {
|
||||
this.addString(Buffer.concat(c), href, type, marker)
|
||||
}.bind(this))
|
||||
.on('error', this.emit.bind(this, 'error'))
|
||||
|
||||
}.bind(this))
|
||||
.on('error', this.emit.bind(this, 'error'))
|
||||
.end()
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
ConfigChain.prototype.addString = function (data, file, type, marker) {
|
||||
data = this.parse(data, file, type)
|
||||
this.add(data, marker)
|
||||
return this
|
||||
}
|
||||
|
||||
ConfigChain.prototype.add = function (data, marker) {
|
||||
if (marker && typeof marker === 'object') {
|
||||
var i = this.list.indexOf(marker)
|
||||
if (i === -1) {
|
||||
return this.emit('error', new Error('bad marker'))
|
||||
}
|
||||
this.splice(i, 1, data)
|
||||
marker = marker.__source__
|
||||
this.sources[marker] = this.sources[marker] || {}
|
||||
this.sources[marker].data = data
|
||||
// we were waiting for this. maybe emit 'load'
|
||||
this._resolve()
|
||||
} else {
|
||||
if (typeof marker === 'string') {
|
||||
this.sources[marker] = this.sources[marker] || {}
|
||||
this.sources[marker].data = data
|
||||
}
|
||||
// trigger the load event if nothing was already going to do so.
|
||||
this._await()
|
||||
this.push(data)
|
||||
process.nextTick(this._resolve.bind(this))
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
||||
ConfigChain.prototype.parse = exports.parse
|
||||
|
||||
ConfigChain.prototype._await = function () {
|
||||
this._awaiting++
|
||||
}
|
||||
|
||||
ConfigChain.prototype._resolve = function () {
|
||||
this._awaiting--
|
||||
if (this._awaiting === 0) this.emit('load', this)
|
||||
}
|
65
node_modules/config-chain/package.json
generated
vendored
65
node_modules/config-chain/package.json
generated
vendored
|
@ -1,65 +0,0 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"config-chain@1.1.12",
|
||||
"/home/runner/work/ghaction-upx/ghaction-upx"
|
||||
]
|
||||
],
|
||||
"_from": "config-chain@1.1.12",
|
||||
"_id": "config-chain@1.1.12",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==",
|
||||
"_location": "/config-chain",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "config-chain@1.1.12",
|
||||
"name": "config-chain",
|
||||
"escapedName": "config-chain",
|
||||
"rawSpec": "1.1.12",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.1.12"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/npm-conf"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz",
|
||||
"_spec": "1.1.12",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx",
|
||||
"author": {
|
||||
"name": "Dominic Tarr",
|
||||
"email": "dominic.tarr@gmail.com",
|
||||
"url": "http://dominictarr.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/dominictarr/config-chain/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"ini": "^1.3.4",
|
||||
"proto-list": "~1.2.1"
|
||||
},
|
||||
"description": "HANDLE CONFIGURATION ONCE AND FOR ALL",
|
||||
"devDependencies": {
|
||||
"tap": "0.3.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "http://github.com/dominictarr/config-chain",
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "https://raw.githubusercontent.com/dominictarr/config-chain/master/LICENCE"
|
||||
}
|
||||
],
|
||||
"name": "config-chain",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/dominictarr/config-chain.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tap test/*"
|
||||
},
|
||||
"version": "1.1.12"
|
||||
}
|
257
node_modules/config-chain/readme.markdown
generated
vendored
257
node_modules/config-chain/readme.markdown
generated
vendored
|
@ -1,257 +0,0 @@
|
|||
# config-chain
|
||||
|
||||
A module for loading custom configurations
|
||||
|
||||
## NOTE: Feature Freeze
|
||||
|
||||
[![locked](http://badges.github.io/stability-badges/dist/locked.svg)](http://github.com/badges/stability-badges)
|
||||
|
||||
This module is frozen.
|
||||
|
||||
In general, we recommend using [rc](https://github.com/dominictarr/rc) instead,
|
||||
but as [npm](https://github.com/npmjs/npm) depends on this, it cannot be changed.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
yarn add config-chain
|
||||
|
||||
# npm users
|
||||
npm install --save config-chain
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const cc = require('config-chain');
|
||||
|
||||
console.log(cc.env('TERM_', process.env));
|
||||
/*
|
||||
{ SESSION_ID: 'w1:5F38',
|
||||
PROGRAM_VERSION: '3.1.2',
|
||||
PROGRAM: 'iTerm.app' }
|
||||
*/
|
||||
```
|
||||
|
||||
The `.env` function gets all the keys on the provided object which are
|
||||
prefixed by the specified prefix, removes the prefix, and puts the values on a new object.
|
||||
|
||||
<br/>
|
||||
|
||||
## Full Usage
|
||||
|
||||
``` js
|
||||
|
||||
// npm install config-chain
|
||||
|
||||
var cc = require('config-chain')
|
||||
, opts = require('optimist').argv //ALWAYS USE OPTIMIST FOR COMMAND LINE OPTIONS.
|
||||
, env = opts.env || process.env.YOUR_APP_ENV || 'dev' //SET YOUR ENV LIKE THIS.
|
||||
|
||||
// EACH ARG TO CONFIGURATOR IS LOADED INTO CONFIGURATION CHAIN
|
||||
// EARLIER ITEMS OVERIDE LATER ITEMS
|
||||
// PUTS COMMAND LINE OPTS FIRST, AND DEFAULTS LAST!
|
||||
|
||||
//strings are interpereted as filenames.
|
||||
//will be loaded synchronously
|
||||
|
||||
var conf =
|
||||
cc(
|
||||
//OVERRIDE SETTINGS WITH COMMAND LINE OPTS
|
||||
opts,
|
||||
|
||||
//ENV VARS IF PREFIXED WITH 'myApp_'
|
||||
|
||||
cc.env('myApp_'), //myApp_foo = 'like this'
|
||||
|
||||
//FILE NAMED BY ENV
|
||||
path.join(__dirname, 'config.' + env + '.json'),
|
||||
|
||||
//IF `env` is PRODUCTION
|
||||
env === 'prod'
|
||||
? path.join(__dirname, 'special.json') //load a special file
|
||||
: null //NULL IS IGNORED!
|
||||
|
||||
//SUBDIR FOR ENV CONFIG
|
||||
path.join(__dirname, 'config', env, 'config.json'),
|
||||
|
||||
//SEARCH PARENT DIRECTORIES FROM CURRENT DIR FOR FILE
|
||||
cc.find('config.json'),
|
||||
|
||||
//PUT DEFAULTS LAST
|
||||
{
|
||||
host: 'localhost'
|
||||
port: 8000
|
||||
})
|
||||
|
||||
var host = conf.get('host')
|
||||
|
||||
// or
|
||||
|
||||
var host = conf.store.host
|
||||
|
||||
```
|
||||
|
||||
Finally, flexible configurations! 👌
|
||||
|
||||
## Custom Configuations
|
||||
|
||||
```javascript
|
||||
var cc = require('config-chain')
|
||||
|
||||
// all the stuff you did before
|
||||
var config = cc({
|
||||
some: 'object'
|
||||
},
|
||||
cc.find('config.json'),
|
||||
cc.env('myApp_')
|
||||
)
|
||||
// CONFIGS AS A SERVICE, aka "CaaS", aka EVERY DEVOPS DREAM OMG!
|
||||
.addUrl('http://configurator:1234/my-configs')
|
||||
// ASYNC FTW!
|
||||
.addFile('/path/to/file.json')
|
||||
|
||||
// OBJECTS ARE OK TOO, they're SYNC but they still ORDER RIGHT
|
||||
// BECAUSE PROMISES ARE USED BUT NO, NOT *THOSE* PROMISES, JUST
|
||||
// ACTUAL PROMISES LIKE YOU MAKE TO YOUR MOM, KEPT OUT OF LOVE
|
||||
.add({ another: 'object' })
|
||||
|
||||
// DIE A THOUSAND DEATHS IF THIS EVER HAPPENS!!
|
||||
.on('error', function (er) {
|
||||
// IF ONLY THERE WAS SOMETHIGN HARDER THAN THROW
|
||||
// MY SORROW COULD BE ADEQUATELY EXPRESSED. /o\
|
||||
throw er
|
||||
})
|
||||
|
||||
// THROW A PARTY IN YOUR FACE WHEN ITS ALL LOADED!!
|
||||
.on('load', function (config) {
|
||||
console.awesome('HOLY SHIT!')
|
||||
})
|
||||
```
|
||||
|
||||
# API Docs
|
||||
|
||||
## cc(...args)
|
||||
|
||||
MAKE A CHAIN AND ADD ALL THE ARGS.
|
||||
|
||||
If the arg is a STRING, then it shall be a JSON FILENAME.
|
||||
|
||||
RETURN THE CHAIN!
|
||||
|
||||
## cc.json(...args)
|
||||
|
||||
Join the args into a JSON filename!
|
||||
|
||||
SYNC I/O!
|
||||
|
||||
## cc.find(relativePath)
|
||||
|
||||
SEEK the RELATIVE PATH by climbing the TREE OF DIRECTORIES.
|
||||
|
||||
RETURN THE FOUND PATH!
|
||||
|
||||
SYNC I/O!
|
||||
|
||||
## cc.parse(content, file, type)
|
||||
|
||||
Parse the content string, and guess the type from either the
|
||||
specified type or the filename.
|
||||
|
||||
RETURN THE RESULTING OBJECT!
|
||||
|
||||
NO I/O!
|
||||
|
||||
## cc.env(prefix, env=process.env)
|
||||
|
||||
Get all the keys on the provided object which are
|
||||
prefixed by the specified prefix, removes the prefix, and puts the values on a new object.
|
||||
|
||||
RETURN THE RESULTING OBJECT!
|
||||
|
||||
NO I/O!
|
||||
|
||||
## cc.ConfigChain()
|
||||
|
||||
The ConfigChain class for CRAY CRAY JQUERY STYLE METHOD CHAINING!
|
||||
|
||||
One of these is returned by the main exported function, as well.
|
||||
|
||||
It inherits (prototypically) from
|
||||
[ProtoList](https://github.com/isaacs/proto-list/), and also inherits
|
||||
(parasitically) from
|
||||
[EventEmitter](http://nodejs.org/api/events.html#events_class_events_eventemitter)
|
||||
|
||||
It has all the methods from both, and except where noted, they are
|
||||
unchanged.
|
||||
|
||||
### LET IT BE KNOWN THAT chain IS AN INSTANCE OF ConfigChain.
|
||||
|
||||
## chain.sources
|
||||
|
||||
A list of all the places where it got stuff. The keys are the names
|
||||
passed to addFile or addUrl etc, and the value is an object with some
|
||||
info about the data source.
|
||||
|
||||
## chain.addFile(filename, type, [name=filename])
|
||||
|
||||
Filename is the name of the file. Name is an arbitrary string to be
|
||||
used later if you desire. Type is either 'ini' or 'json', and will
|
||||
try to guess intelligently if omitted.
|
||||
|
||||
Loaded files can be saved later.
|
||||
|
||||
## chain.addUrl(url, type, [name=url])
|
||||
|
||||
Same as the filename thing, but with a url.
|
||||
|
||||
Can't be saved later.
|
||||
|
||||
## chain.addEnv(prefix, env, [name='env'])
|
||||
|
||||
Add all the keys from the env object that start with the prefix.
|
||||
|
||||
## chain.addString(data, file, type, [name])
|
||||
|
||||
Parse the string and add it to the set. (Mainly used internally.)
|
||||
|
||||
## chain.add(object, [name])
|
||||
|
||||
Add the object to the set.
|
||||
|
||||
## chain.root {Object}
|
||||
|
||||
The root from which all the other config objects in the set descend
|
||||
prototypically.
|
||||
|
||||
Put your defaults here.
|
||||
|
||||
## chain.set(key, value, name)
|
||||
|
||||
Set the key to the value on the named config object. If name is
|
||||
unset, then set it on the first config object in the set. (That is,
|
||||
the one with the highest priority, which was added first.)
|
||||
|
||||
## chain.get(key, [name])
|
||||
|
||||
Get the key from the named config object explicitly, or from the
|
||||
resolved configs if not specified.
|
||||
|
||||
## chain.save(name, type)
|
||||
|
||||
Write the named config object back to its origin.
|
||||
|
||||
Currently only supported for env and file config types.
|
||||
|
||||
For files, encode the data according to the type.
|
||||
|
||||
## chain.on('save', function () {})
|
||||
|
||||
When one or more files are saved, emits `save` event when they're all
|
||||
saved.
|
||||
|
||||
## chain.on('load', function (chain) {})
|
||||
|
||||
When the config chain has loaded all the specified files and urls and
|
||||
such, the 'load' event fires.
|
73
node_modules/decompress-tar/node_modules/is-stream/package.json
generated
vendored
73
node_modules/decompress-tar/node_modules/is-stream/package.json
generated
vendored
|
@ -1,73 +0,0 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"is-stream@1.1.0",
|
||||
"/home/runner/work/ghaction-upx/ghaction-upx"
|
||||
]
|
||||
],
|
||||
"_from": "is-stream@1.1.0",
|
||||
"_id": "is-stream@1.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=",
|
||||
"_location": "/decompress-tar/is-stream",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "is-stream@1.1.0",
|
||||
"name": "is-stream",
|
||||
"escapedName": "is-stream",
|
||||
"rawSpec": "1.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/decompress-tar"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
|
||||
"_spec": "1.1.0",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/is-stream/issues"
|
||||
},
|
||||
"description": "Check if something is a Node.js stream",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"tempfile": "^1.1.0",
|
||||
"xo": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/is-stream#readme",
|
||||
"keywords": [
|
||||
"stream",
|
||||
"type",
|
||||
"streams",
|
||||
"writable",
|
||||
"readable",
|
||||
"duplex",
|
||||
"transform",
|
||||
"check",
|
||||
"detect",
|
||||
"is"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "is-stream",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/is-stream.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "1.1.0"
|
||||
}
|
21
node_modules/decompress-tarbz2/node_modules/is-stream/index.js
generated
vendored
21
node_modules/decompress-tarbz2/node_modules/is-stream/index.js
generated
vendored
|
@ -1,21 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
var isStream = module.exports = function (stream) {
|
||||
return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
|
||||
};
|
||||
|
||||
isStream.writable = function (stream) {
|
||||
return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
|
||||
};
|
||||
|
||||
isStream.readable = function (stream) {
|
||||
return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
|
||||
};
|
||||
|
||||
isStream.duplex = function (stream) {
|
||||
return isStream.writable(stream) && isStream.readable(stream);
|
||||
};
|
||||
|
||||
isStream.transform = function (stream) {
|
||||
return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
|
||||
};
|
73
node_modules/decompress-tarbz2/node_modules/is-stream/package.json
generated
vendored
73
node_modules/decompress-tarbz2/node_modules/is-stream/package.json
generated
vendored
|
@ -1,73 +0,0 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"is-stream@1.1.0",
|
||||
"/home/runner/work/ghaction-upx/ghaction-upx"
|
||||
]
|
||||
],
|
||||
"_from": "is-stream@1.1.0",
|
||||
"_id": "is-stream@1.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=",
|
||||
"_location": "/decompress-tarbz2/is-stream",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "is-stream@1.1.0",
|
||||
"name": "is-stream",
|
||||
"escapedName": "is-stream",
|
||||
"rawSpec": "1.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/decompress-tarbz2"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
|
||||
"_spec": "1.1.0",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/is-stream/issues"
|
||||
},
|
||||
"description": "Check if something is a Node.js stream",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"tempfile": "^1.1.0",
|
||||
"xo": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/is-stream#readme",
|
||||
"keywords": [
|
||||
"stream",
|
||||
"type",
|
||||
"streams",
|
||||
"writable",
|
||||
"readable",
|
||||
"duplex",
|
||||
"transform",
|
||||
"check",
|
||||
"detect",
|
||||
"is"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "is-stream",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/is-stream.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "1.1.0"
|
||||
}
|
42
node_modules/decompress-tarbz2/node_modules/is-stream/readme.md
generated
vendored
42
node_modules/decompress-tarbz2/node_modules/is-stream/readme.md
generated
vendored
|
@ -1,42 +0,0 @@
|
|||
# is-stream [![Build Status](https://travis-ci.org/sindresorhus/is-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/is-stream)
|
||||
|
||||
> Check if something is a [Node.js stream](https://nodejs.org/api/stream.html)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save is-stream
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const fs = require('fs');
|
||||
const isStream = require('is-stream');
|
||||
|
||||
isStream(fs.createReadStream('unicorn.png'));
|
||||
//=> true
|
||||
|
||||
isStream({});
|
||||
//=> false
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### isStream(stream)
|
||||
|
||||
#### isStream.writable(stream)
|
||||
|
||||
#### isStream.readable(stream)
|
||||
|
||||
#### isStream.duplex(stream)
|
||||
|
||||
#### isStream.transform(stream)
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
21
node_modules/decompress-targz/node_modules/is-stream/index.js
generated
vendored
21
node_modules/decompress-targz/node_modules/is-stream/index.js
generated
vendored
|
@ -1,21 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
var isStream = module.exports = function (stream) {
|
||||
return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
|
||||
};
|
||||
|
||||
isStream.writable = function (stream) {
|
||||
return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
|
||||
};
|
||||
|
||||
isStream.readable = function (stream) {
|
||||
return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
|
||||
};
|
||||
|
||||
isStream.duplex = function (stream) {
|
||||
return isStream.writable(stream) && isStream.readable(stream);
|
||||
};
|
||||
|
||||
isStream.transform = function (stream) {
|
||||
return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
|
||||
};
|
42
node_modules/decompress-targz/node_modules/is-stream/readme.md
generated
vendored
42
node_modules/decompress-targz/node_modules/is-stream/readme.md
generated
vendored
|
@ -1,42 +0,0 @@
|
|||
# is-stream [![Build Status](https://travis-ci.org/sindresorhus/is-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/is-stream)
|
||||
|
||||
> Check if something is a [Node.js stream](https://nodejs.org/api/stream.html)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save is-stream
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const fs = require('fs');
|
||||
const isStream = require('is-stream');
|
||||
|
||||
isStream(fs.createReadStream('unicorn.png'));
|
||||
//=> true
|
||||
|
||||
isStream({});
|
||||
//=> false
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### isStream(stream)
|
||||
|
||||
#### isStream.writable(stream)
|
||||
|
||||
#### isStream.readable(stream)
|
||||
|
||||
#### isStream.duplex(stream)
|
||||
|
||||
#### isStream.transform(stream)
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
59
node_modules/decompress/index.js
generated
vendored
59
node_modules/decompress/index.js
generated
vendored
|
@ -19,6 +19,38 @@ const runPlugins = (input, opts) => {
|
|||
return Promise.all(opts.plugins.map(x => x(input, opts))).then(files => files.reduce((a, b) => a.concat(b)));
|
||||
};
|
||||
|
||||
const safeMakeDir = (dir, realOutputPath) => {
|
||||
return fsP.realpath(dir)
|
||||
.catch(_ => {
|
||||
const parent = path.dirname(dir);
|
||||
return safeMakeDir(parent, realOutputPath);
|
||||
})
|
||||
.then(realParentPath => {
|
||||
if (realParentPath.indexOf(realOutputPath) !== 0) {
|
||||
throw (new Error('Refusing to create a directory outside the output path.'));
|
||||
}
|
||||
|
||||
return makeDir(dir).then(fsP.realpath);
|
||||
});
|
||||
};
|
||||
|
||||
const preventWritingThroughSymlink = (destination, realOutputPath) => {
|
||||
return fsP.readlink(destination)
|
||||
.catch(_ => {
|
||||
// Either no file exists, or it's not a symlink. In either case, this is
|
||||
// not an escape we need to worry about in this phase.
|
||||
return null;
|
||||
})
|
||||
.then(symlinkPointsTo => {
|
||||
if (symlinkPointsTo) {
|
||||
throw new Error('Refusing to write into a symlink');
|
||||
}
|
||||
|
||||
// No symlink exists at `destination`, so we can continue
|
||||
return realOutputPath;
|
||||
});
|
||||
};
|
||||
|
||||
const extractFile = (input, output, opts) => runPlugins(input, opts).then(files => {
|
||||
if (opts.strip > 0) {
|
||||
files = files
|
||||
|
@ -47,12 +79,35 @@ const extractFile = (input, output, opts) => runPlugins(input, opts).then(files
|
|||
const now = new Date();
|
||||
|
||||
if (x.type === 'directory') {
|
||||
return makeDir(dest)
|
||||
return makeDir(output)
|
||||
.then(outputPath => fsP.realpath(outputPath))
|
||||
.then(realOutputPath => safeMakeDir(dest, realOutputPath))
|
||||
.then(() => fsP.utimes(dest, now, x.mtime))
|
||||
.then(() => x);
|
||||
}
|
||||
|
||||
return makeDir(path.dirname(dest))
|
||||
return makeDir(output)
|
||||
.then(outputPath => fsP.realpath(outputPath))
|
||||
.then(realOutputPath => {
|
||||
// Attempt to ensure parent directory exists (failing if it's outside the output dir)
|
||||
return safeMakeDir(path.dirname(dest), realOutputPath)
|
||||
.then(() => realOutputPath);
|
||||
})
|
||||
.then(realOutputPath => {
|
||||
if (x.type === 'file') {
|
||||
return preventWritingThroughSymlink(dest, realOutputPath);
|
||||
}
|
||||
|
||||
return realOutputPath;
|
||||
})
|
||||
.then(realOutputPath => {
|
||||
return fsP.realpath(path.dirname(dest))
|
||||
.then(realDestinationDir => {
|
||||
if (realDestinationDir.indexOf(realOutputPath) !== 0) {
|
||||
throw (new Error('Refusing to write outside output directory: ' + realDestinationDir));
|
||||
}
|
||||
});
|
||||
})
|
||||
.then(() => {
|
||||
if (x.type === 'link') {
|
||||
return fsP.link(x.linkname, dest);
|
||||
|
|
22
node_modules/decompress/license
generated
vendored
22
node_modules/decompress/license
generated
vendored
|
@ -1,21 +1,9 @@
|
|||
The MIT License (MIT)
|
||||
MIT License
|
||||
|
||||
Copyright (c) Kevin Mårtensson <kevinmartensson@gmail.com>
|
||||
Copyright (c) Kevin Mårtensson <kevinmartensson@gmail.com> (github.com/kevva)
|
||||
|
||||
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.
|
||||
|
|
85
node_modules/decompress/node_modules/make-dir/index.js
generated
vendored
Normal file
85
node_modules/decompress/node_modules/make-dir/index.js
generated
vendored
Normal file
|
@ -0,0 +1,85 @@
|
|||
'use strict';
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const pify = require('pify');
|
||||
|
||||
const defaults = {
|
||||
mode: 0o777 & (~process.umask()),
|
||||
fs
|
||||
};
|
||||
|
||||
// https://github.com/nodejs/node/issues/8987
|
||||
// https://github.com/libuv/libuv/pull/1088
|
||||
const checkPath = pth => {
|
||||
if (process.platform === 'win32') {
|
||||
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ''));
|
||||
|
||||
if (pathHasInvalidWinCharacters) {
|
||||
const err = new Error(`Path contains invalid characters: ${pth}`);
|
||||
err.code = 'EINVAL';
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = (input, opts) => Promise.resolve().then(() => {
|
||||
checkPath(input);
|
||||
opts = Object.assign({}, defaults, opts);
|
||||
|
||||
const mkdir = pify(opts.fs.mkdir);
|
||||
const stat = pify(opts.fs.stat);
|
||||
|
||||
const make = pth => {
|
||||
return mkdir(pth, opts.mode)
|
||||
.then(() => pth)
|
||||
.catch(err => {
|
||||
if (err.code === 'ENOENT') {
|
||||
if (err.message.includes('null bytes') || path.dirname(pth) === pth) {
|
||||
throw err;
|
||||
}
|
||||
|
||||
return make(path.dirname(pth)).then(() => make(pth));
|
||||
}
|
||||
|
||||
return stat(pth)
|
||||
.then(stats => stats.isDirectory() ? pth : Promise.reject())
|
||||
.catch(() => {
|
||||
throw err;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
return make(path.resolve(input));
|
||||
});
|
||||
|
||||
module.exports.sync = (input, opts) => {
|
||||
checkPath(input);
|
||||
opts = Object.assign({}, defaults, opts);
|
||||
|
||||
const make = pth => {
|
||||
try {
|
||||
opts.fs.mkdirSync(pth, opts.mode);
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT') {
|
||||
if (err.message.includes('null bytes') || path.dirname(pth) === pth) {
|
||||
throw err;
|
||||
}
|
||||
|
||||
make(path.dirname(pth));
|
||||
return make(pth);
|
||||
}
|
||||
|
||||
try {
|
||||
if (!opts.fs.statSync(pth).isDirectory()) {
|
||||
throw new Error('The path is not a directory');
|
||||
}
|
||||
} catch (_) {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
return pth;
|
||||
};
|
||||
|
||||
return make(path.resolve(input));
|
||||
};
|
84
node_modules/decompress/node_modules/make-dir/node_modules/pify/index.js
generated
vendored
Normal file
84
node_modules/decompress/node_modules/make-dir/node_modules/pify/index.js
generated
vendored
Normal file
|
@ -0,0 +1,84 @@
|
|||
'use strict';
|
||||
|
||||
const processFn = (fn, opts) => function () {
|
||||
const P = opts.promiseModule;
|
||||
const args = new Array(arguments.length);
|
||||
|
||||
for (let i = 0; i < arguments.length; i++) {
|
||||
args[i] = arguments[i];
|
||||
}
|
||||
|
||||
return new P((resolve, reject) => {
|
||||
if (opts.errorFirst) {
|
||||
args.push(function (err, result) {
|
||||
if (opts.multiArgs) {
|
||||
const results = new Array(arguments.length - 1);
|
||||
|
||||
for (let i = 1; i < arguments.length; i++) {
|
||||
results[i - 1] = arguments[i];
|
||||
}
|
||||
|
||||
if (err) {
|
||||
results.unshift(err);
|
||||
reject(results);
|
||||
} else {
|
||||
resolve(results);
|
||||
}
|
||||
} else if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
resolve(result);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
args.push(function (result) {
|
||||
if (opts.multiArgs) {
|
||||
const results = new Array(arguments.length - 1);
|
||||
|
||||
for (let i = 0; i < arguments.length; i++) {
|
||||
results[i] = arguments[i];
|
||||
}
|
||||
|
||||
resolve(results);
|
||||
} else {
|
||||
resolve(result);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
fn.apply(this, args);
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = (obj, opts) => {
|
||||
opts = Object.assign({
|
||||
exclude: [/.+(Sync|Stream)$/],
|
||||
errorFirst: true,
|
||||
promiseModule: Promise
|
||||
}, opts);
|
||||
|
||||
const filter = key => {
|
||||
const match = pattern => typeof pattern === 'string' ? key === pattern : pattern.test(key);
|
||||
return opts.include ? opts.include.some(match) : !opts.exclude.some(match);
|
||||
};
|
||||
|
||||
let ret;
|
||||
if (typeof obj === 'function') {
|
||||
ret = function () {
|
||||
if (opts.excludeMain) {
|
||||
return obj.apply(this, arguments);
|
||||
}
|
||||
|
||||
return processFn(obj, opts).apply(this, arguments);
|
||||
};
|
||||
} else {
|
||||
ret = Object.create(Object.getPrototypeOf(obj));
|
||||
}
|
||||
|
||||
for (const key in obj) { // eslint-disable-line guard-for-in
|
||||
const x = obj[key];
|
||||
ret[key] = typeof x === 'function' && filter(key) ? processFn(x, opts) : x;
|
||||
}
|
||||
|
||||
return ret;
|
||||
};
|
|
@ -1,6 +1,6 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Kevin Mårtensson <kevinmartensson@gmail.com> (github.com/kevva)
|
||||
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:
|
||||
|
86
node_modules/decompress/node_modules/make-dir/node_modules/pify/package.json
generated
vendored
Normal file
86
node_modules/decompress/node_modules/make-dir/node_modules/pify/package.json
generated
vendored
Normal file
|
@ -0,0 +1,86 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"pify@3.0.0",
|
||||
"/home/runner/work/ghaction-upx/ghaction-upx"
|
||||
]
|
||||
],
|
||||
"_from": "pify@3.0.0",
|
||||
"_id": "pify@3.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
|
||||
"_location": "/decompress/make-dir/pify",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "pify@3.0.0",
|
||||
"name": "pify",
|
||||
"escapedName": "pify",
|
||||
"rawSpec": "3.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "3.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/decompress/make-dir"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
|
||||
"_spec": "3.0.0",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/pify/issues"
|
||||
},
|
||||
"description": "Promisify a callback-style function",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"pinkie-promise": "^2.0.0",
|
||||
"v8-natives": "^1.0.0",
|
||||
"xo": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/pify#readme",
|
||||
"keywords": [
|
||||
"promise",
|
||||
"promises",
|
||||
"promisify",
|
||||
"all",
|
||||
"denodify",
|
||||
"denodeify",
|
||||
"callback",
|
||||
"cb",
|
||||
"node",
|
||||
"then",
|
||||
"thenify",
|
||||
"convert",
|
||||
"transform",
|
||||
"wrap",
|
||||
"wrapper",
|
||||
"bind",
|
||||
"to",
|
||||
"async",
|
||||
"await",
|
||||
"es2015",
|
||||
"bluebird"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "pify",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/pify.git"
|
||||
},
|
||||
"scripts": {
|
||||
"optimization-test": "node --allow-natives-syntax optimization-test.js",
|
||||
"test": "xo && ava && npm run optimization-test"
|
||||
},
|
||||
"version": "3.0.0"
|
||||
}
|
131
node_modules/decompress/node_modules/make-dir/node_modules/pify/readme.md
generated
vendored
Normal file
131
node_modules/decompress/node_modules/make-dir/node_modules/pify/readme.md
generated
vendored
Normal file
|
@ -0,0 +1,131 @@
|
|||
# pify [![Build Status](https://travis-ci.org/sindresorhus/pify.svg?branch=master)](https://travis-ci.org/sindresorhus/pify)
|
||||
|
||||
> Promisify a callback-style function
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save pify
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const fs = require('fs');
|
||||
const pify = require('pify');
|
||||
|
||||
// Promisify a single function
|
||||
pify(fs.readFile)('package.json', 'utf8').then(data => {
|
||||
console.log(JSON.parse(data).name);
|
||||
//=> 'pify'
|
||||
});
|
||||
|
||||
// Promisify all methods in a module
|
||||
pify(fs).readFile('package.json', 'utf8').then(data => {
|
||||
console.log(JSON.parse(data).name);
|
||||
//=> 'pify'
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### pify(input, [options])
|
||||
|
||||
Returns a `Promise` wrapped version of the supplied function or module.
|
||||
|
||||
#### input
|
||||
|
||||
Type: `Function` `Object`
|
||||
|
||||
Callback-style function or module whose methods you want to promisify.
|
||||
|
||||
#### options
|
||||
|
||||
##### multiArgs
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `false`
|
||||
|
||||
By default, the promisified function will only return the second argument from the callback, which works fine for most APIs. This option can be useful for modules like `request` that return multiple arguments. Turning this on will make it return an array of all arguments from the callback, excluding the error argument, instead of just the second argument. This also applies to rejections, where it returns an array of all the callback arguments, including the error.
|
||||
|
||||
```js
|
||||
const request = require('request');
|
||||
const pify = require('pify');
|
||||
|
||||
pify(request, {multiArgs: true})('https://sindresorhus.com').then(result => {
|
||||
const [httpResponse, body] = result;
|
||||
});
|
||||
```
|
||||
|
||||
##### include
|
||||
|
||||
Type: `string[]` `RegExp[]`
|
||||
|
||||
Methods in a module to promisify. Remaining methods will be left untouched.
|
||||
|
||||
##### exclude
|
||||
|
||||
Type: `string[]` `RegExp[]`<br>
|
||||
Default: `[/.+(Sync|Stream)$/]`
|
||||
|
||||
Methods in a module **not** to promisify. Methods with names ending with `'Sync'` are excluded by default.
|
||||
|
||||
##### excludeMain
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `false`
|
||||
|
||||
If given module is a function itself, it will be promisified. Turn this option on if you want to promisify only methods of the module.
|
||||
|
||||
```js
|
||||
const pify = require('pify');
|
||||
|
||||
function fn() {
|
||||
return true;
|
||||
}
|
||||
|
||||
fn.method = (data, callback) => {
|
||||
setImmediate(() => {
|
||||
callback(null, data);
|
||||
});
|
||||
};
|
||||
|
||||
// Promisify methods but not `fn()`
|
||||
const promiseFn = pify(fn, {excludeMain: true});
|
||||
|
||||
if (promiseFn()) {
|
||||
promiseFn.method('hi').then(data => {
|
||||
console.log(data);
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
##### errorFirst
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
Whether the callback has an error as the first argument. You'll want to set this to `false` if you're dealing with an API that doesn't have an error as the first argument, like `fs.exists()`, some browser APIs, Chrome Extension APIs, etc.
|
||||
|
||||
##### promiseModule
|
||||
|
||||
Type: `Function`
|
||||
|
||||
Custom promise module to use instead of the native one.
|
||||
|
||||
Check out [`pinkie-promise`](https://github.com/floatdrop/pinkie-promise) if you need a tiny promise polyfill.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [p-event](https://github.com/sindresorhus/p-event) - Promisify an event by waiting for it to be emitted
|
||||
- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently
|
||||
- [More…](https://github.com/sindresorhus/promise-fun)
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
89
node_modules/decompress/node_modules/make-dir/package.json
generated
vendored
Normal file
89
node_modules/decompress/node_modules/make-dir/package.json
generated
vendored
Normal file
|
@ -0,0 +1,89 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"make-dir@1.3.0",
|
||||
"/home/runner/work/ghaction-upx/ghaction-upx"
|
||||
]
|
||||
],
|
||||
"_from": "make-dir@1.3.0",
|
||||
"_id": "make-dir@1.3.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==",
|
||||
"_location": "/decompress/make-dir",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "make-dir@1.3.0",
|
||||
"name": "make-dir",
|
||||
"escapedName": "make-dir",
|
||||
"rawSpec": "1.3.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.3.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/decompress"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz",
|
||||
"_spec": "1.3.0",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/make-dir/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"pify": "^3.0.0"
|
||||
},
|
||||
"description": "Make a directory and its parents if needed - Think `mkdir -p`",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"codecov": "^3.0.0",
|
||||
"graceful-fs": "^4.1.11",
|
||||
"nyc": "^11.3.0",
|
||||
"path-type": "^3.0.0",
|
||||
"tempy": "^0.2.1",
|
||||
"xo": "^0.20.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/make-dir#readme",
|
||||
"keywords": [
|
||||
"mkdir",
|
||||
"mkdirp",
|
||||
"make",
|
||||
"directories",
|
||||
"dir",
|
||||
"dirs",
|
||||
"folders",
|
||||
"directory",
|
||||
"folder",
|
||||
"path",
|
||||
"parent",
|
||||
"parents",
|
||||
"intermediate",
|
||||
"recursively",
|
||||
"recursive",
|
||||
"create",
|
||||
"fs",
|
||||
"filesystem",
|
||||
"file-system"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "make-dir",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/make-dir.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && nyc ava"
|
||||
},
|
||||
"version": "1.3.0"
|
||||
}
|
116
node_modules/decompress/node_modules/make-dir/readme.md
generated
vendored
Normal file
116
node_modules/decompress/node_modules/make-dir/readme.md
generated
vendored
Normal file
|
@ -0,0 +1,116 @@
|
|||
# make-dir [![Build Status: macOS & Linux](https://travis-ci.org/sindresorhus/make-dir.svg?branch=master)](https://travis-ci.org/sindresorhus/make-dir) [![Build status: Windows](https://ci.appveyor.com/api/projects/status/e0vtt8y600w91gcs/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/make-dir/branch/master) [![codecov](https://codecov.io/gh/sindresorhus/make-dir/branch/master/graph/badge.svg)](https://codecov.io/gh/sindresorhus/make-dir)
|
||||
|
||||
> Make a directory and its parents if needed - Think `mkdir -p`
|
||||
|
||||
|
||||
## Advantages over [`mkdirp`](https://github.com/substack/node-mkdirp)
|
||||
|
||||
- Promise API *(Async/await ready!)*
|
||||
- Fixes many `mkdirp` issues: [#96](https://github.com/substack/node-mkdirp/pull/96) [#70](https://github.com/substack/node-mkdirp/issues/70) [#66](https://github.com/substack/node-mkdirp/issues/66)
|
||||
- 100% test coverage
|
||||
- CI-tested on macOS, Linux, and Windows
|
||||
- Actively maintained
|
||||
- Doesn't bundle a CLI
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install make-dir
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
$ pwd
|
||||
/Users/sindresorhus/fun
|
||||
$ tree
|
||||
.
|
||||
```
|
||||
|
||||
```js
|
||||
const makeDir = require('make-dir');
|
||||
|
||||
makeDir('unicorn/rainbow/cake').then(path => {
|
||||
console.log(path);
|
||||
//=> '/Users/sindresorhus/fun/unicorn/rainbow/cake'
|
||||
});
|
||||
```
|
||||
|
||||
```
|
||||
$ tree
|
||||
.
|
||||
└── unicorn
|
||||
└── rainbow
|
||||
└── cake
|
||||
```
|
||||
|
||||
Multiple directories:
|
||||
|
||||
```js
|
||||
const makeDir = require('make-dir');
|
||||
|
||||
Promise.all([
|
||||
makeDir('unicorn/rainbow')
|
||||
makeDir('foo/bar')
|
||||
]).then(paths => {
|
||||
console.log(paths);
|
||||
/*
|
||||
[
|
||||
'/Users/sindresorhus/fun/unicorn/rainbow',
|
||||
'/Users/sindresorhus/fun/foo/bar'
|
||||
]
|
||||
*/
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### makeDir(path, [options])
|
||||
|
||||
Returns a `Promise` for the path to the created directory.
|
||||
|
||||
### makeDir.sync(path, [options])
|
||||
|
||||
Returns the path to the created directory.
|
||||
|
||||
#### path
|
||||
|
||||
Type: `string`
|
||||
|
||||
Directory to create.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `Object`
|
||||
|
||||
##### mode
|
||||
|
||||
Type: `integer`<br>
|
||||
Default: `0o777 & (~process.umask())`
|
||||
|
||||
Directory [permissions](https://x-team.com/blog/file-system-permissions-umask-node-js/).
|
||||
|
||||
##### fs
|
||||
|
||||
Type: `Object`<br>
|
||||
Default: `require('fs')`
|
||||
|
||||
Use a custom `fs` implementation. For example [`graceful-fs`](https://github.com/isaacs/node-graceful-fs).
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [make-dir-cli](https://github.com/sindresorhus/make-dir-cli) - CLI for this module
|
||||
- [del](https://github.com/sindresorhus/del) - Delete files and directories
|
||||
- [globby](https://github.com/sindresorhus/globby) - User-friendly glob matching
|
||||
- [cpy](https://github.com/sindresorhus/cpy) - Copy files
|
||||
- [cpy-cli](https://github.com/sindresorhus/cpy-cli) - Copy files on the command-line
|
||||
- [move-file](https://github.com/sindresorhus/move-file) - Move a file
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
32
node_modules/decompress/package.json
generated
vendored
32
node_modules/decompress/package.json
generated
vendored
|
@ -1,37 +1,42 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"decompress@4.2.0",
|
||||
"decompress@4.2.1",
|
||||
"/home/runner/work/ghaction-upx/ghaction-upx"
|
||||
]
|
||||
],
|
||||
"_from": "decompress@4.2.0",
|
||||
"_id": "decompress@4.2.0",
|
||||
"_from": "decompress@4.2.1",
|
||||
"_id": "decompress@4.2.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-eu3YVCflqS2s/lVnSnxQXpbQH50=",
|
||||
"_integrity": "sha512-e48kc2IjU+2Zw8cTb6VZcJQ3lgVbS4uuB1TfCHbiZIP/haNXm+SVyhu+87jts5/3ROpd82GSVCoNs/z8l4ZOaQ==",
|
||||
"_location": "/decompress",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "decompress@4.2.0",
|
||||
"raw": "decompress@4.2.1",
|
||||
"name": "decompress",
|
||||
"escapedName": "decompress",
|
||||
"rawSpec": "4.2.0",
|
||||
"rawSpec": "4.2.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "4.2.0"
|
||||
"fetchSpec": "4.2.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/download"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/decompress/-/decompress-4.2.0.tgz",
|
||||
"_spec": "4.2.0",
|
||||
"_resolved": "https://registry.npmjs.org/decompress/-/decompress-4.2.1.tgz",
|
||||
"_spec": "4.2.1",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx",
|
||||
"author": {
|
||||
"name": "Kevin Mårtensson",
|
||||
"email": "kevinmartensson@gmail.com",
|
||||
"url": "github.com/kevva"
|
||||
},
|
||||
"ava": {
|
||||
"require": [
|
||||
"esm"
|
||||
]
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/kevva/decompress/issues"
|
||||
},
|
||||
|
@ -48,9 +53,11 @@
|
|||
"description": "Extracting archives made easy",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"esm": "^3.2.25",
|
||||
"is-jpg": "^1.0.0",
|
||||
"path-exists": "^3.0.0",
|
||||
"pify": "^2.3.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"xo": "*"
|
||||
},
|
||||
"engines": {
|
||||
|
@ -80,5 +87,10 @@
|
|||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "4.2.0"
|
||||
"version": "4.2.1",
|
||||
"xo": {
|
||||
"rules": {
|
||||
"promise/prefer-await-to-then": "off"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
4
node_modules/decompress/readme.md
generated
vendored
4
node_modules/decompress/readme.md
generated
vendored
|
@ -7,7 +7,7 @@
|
|||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save decompress
|
||||
$ npm install decompress
|
||||
```
|
||||
|
||||
|
||||
|
@ -66,6 +66,8 @@ decompress('unicorn.zip', 'dist', {
|
|||
});
|
||||
```
|
||||
|
||||
*Note that in the current implementation, **`filter` is only applied after fully reading all files from the archive in memory**. Do not rely on this option to limit the amount of memory used by `decompress` to the size of the files included by `filter`. `decompress` will read the entire compressed file into memory regardless.*
|
||||
|
||||
##### map
|
||||
|
||||
Type: `Function`
|
||||
|
|
26
node_modules/download/index.js
generated
vendored
26
node_modules/download/index.js
generated
vendored
|
@ -1,8 +1,7 @@
|
|||
'use strict';
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const url = require('url');
|
||||
const caw = require('caw');
|
||||
const {URL} = require('url');
|
||||
const contentDisposition = require('content-disposition');
|
||||
const archiveType = require('archive-type');
|
||||
const decompress = require('decompress');
|
||||
|
@ -16,7 +15,7 @@ const fileType = require('file-type');
|
|||
const extName = require('ext-name');
|
||||
|
||||
const fsP = pify(fs);
|
||||
const filenameFromPath = res => path.basename(url.parse(res.requestUrl).pathname);
|
||||
const filenameFromPath = res => path.basename(new URL(res.requestUrl).pathname);
|
||||
|
||||
const getExtFromMime = res => {
|
||||
const header = res.headers['content-type'];
|
||||
|
@ -58,37 +57,18 @@ const getFilename = (res, data) => {
|
|||
return filename;
|
||||
};
|
||||
|
||||
const getProtocolFromUri = uri => {
|
||||
let {protocol} = url.parse(uri);
|
||||
|
||||
if (protocol) {
|
||||
protocol = protocol.slice(0, -1);
|
||||
}
|
||||
|
||||
return protocol;
|
||||
};
|
||||
|
||||
module.exports = (uri, output, opts) => {
|
||||
if (typeof output === 'object') {
|
||||
opts = output;
|
||||
output = null;
|
||||
}
|
||||
|
||||
const protocol = getProtocolFromUri(uri);
|
||||
|
||||
opts = Object.assign({
|
||||
encoding: null,
|
||||
rejectUnauthorized: process.env.npm_config_strict_ssl !== 'false'
|
||||
}, opts);
|
||||
|
||||
const agent = caw(opts.proxy, {protocol});
|
||||
const stream = got.stream(uri, Object.assign({agent}, opts))
|
||||
.on('redirect', (response, nextOptions) => {
|
||||
const redirectProtocol = getProtocolFromUri(nextOptions.href);
|
||||
if (redirectProtocol && redirectProtocol !== protocol) {
|
||||
nextOptions.agent = caw(opts.proxy, {protocol: redirectProtocol});
|
||||
}
|
||||
});
|
||||
const stream = got.stream(uri, opts);
|
||||
|
||||
const promise = pEvent(stream, 'response').then(res => {
|
||||
const encoding = opts.encoding === null ? 'buffer' : opts.encoding;
|
||||
|
|
43
node_modules/download/package.json
generated
vendored
43
node_modules/download/package.json
generated
vendored
|
@ -1,31 +1,31 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"download@7.1.0",
|
||||
"download@8.0.0",
|
||||
"/home/runner/work/ghaction-upx/ghaction-upx"
|
||||
]
|
||||
],
|
||||
"_from": "download@7.1.0",
|
||||
"_id": "download@7.1.0",
|
||||
"_from": "download@8.0.0",
|
||||
"_id": "download@8.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-xqnBTVd/E+GxJVrX5/eUJiLYjCGPwMpdL+jGhGU57BvtcA7wwhtHVbXBeUk51kOpW3S7Jn3BQbN9Q1R1Km2qDQ==",
|
||||
"_integrity": "sha512-ASRY5QhDk7FK+XrQtQyvhpDKanLluEEQtWl/J7Lxuf/b+i8RYh997QeXvL85xitrmRKVlx9c7eTrcRdq2GS4eA==",
|
||||
"_location": "/download",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "download@7.1.0",
|
||||
"raw": "download@8.0.0",
|
||||
"name": "download",
|
||||
"escapedName": "download",
|
||||
"rawSpec": "7.1.0",
|
||||
"rawSpec": "8.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "7.1.0"
|
||||
"fetchSpec": "8.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/download/-/download-7.1.0.tgz",
|
||||
"_spec": "7.1.0",
|
||||
"_resolved": "https://registry.npmjs.org/download/-/download-8.0.0.tgz",
|
||||
"_spec": "8.0.0",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx",
|
||||
"author": {
|
||||
"name": "Kevin Mårtensson",
|
||||
|
@ -37,30 +37,29 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"archive-type": "^4.0.0",
|
||||
"caw": "^2.0.1",
|
||||
"content-disposition": "^0.5.2",
|
||||
"decompress": "^4.2.0",
|
||||
"decompress": "^4.2.1",
|
||||
"ext-name": "^5.0.0",
|
||||
"file-type": "^8.1.0",
|
||||
"filenamify": "^2.0.0",
|
||||
"get-stream": "^3.0.0",
|
||||
"file-type": "^11.1.0",
|
||||
"filenamify": "^3.0.0",
|
||||
"get-stream": "^4.1.0",
|
||||
"got": "^8.3.1",
|
||||
"make-dir": "^1.2.0",
|
||||
"make-dir": "^2.1.0",
|
||||
"p-event": "^2.1.0",
|
||||
"pify": "^3.0.0"
|
||||
"pify": "^4.0.1"
|
||||
},
|
||||
"description": "Download and extract files",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"ava": "^1.4.1",
|
||||
"is-zip": "^1.0.0",
|
||||
"nock": "^9.2.5",
|
||||
"nock": "^10.0.6",
|
||||
"path-exists": "^3.0.0",
|
||||
"random-buffer": "^0.1.0",
|
||||
"rimraf": "^2.6.2",
|
||||
"xo": "*"
|
||||
"rimraf": "^3.0.0",
|
||||
"xo": "^0.24.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
"node": ">=10"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
|
@ -82,5 +81,5 @@
|
|||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "7.1.0"
|
||||
"version": "8.0.0"
|
||||
}
|
||||
|
|
39
node_modules/download/readme.md
generated
vendored
39
node_modules/download/readme.md
generated
vendored
|
@ -18,28 +18,28 @@ $ npm install download
|
|||
const fs = require('fs');
|
||||
const download = require('download');
|
||||
|
||||
download('http://unicorn.com/foo.jpg', 'dist').then(() => {
|
||||
console.log('done!');
|
||||
});
|
||||
(async () => {
|
||||
await download('http://unicorn.com/foo.jpg', 'dist');
|
||||
|
||||
download('http://unicorn.com/foo.jpg').then(data => {
|
||||
fs.writeFileSync('dist/foo.jpg', data);
|
||||
});
|
||||
fs.writeFileSync('dist/foo.jpg', await download('http://unicorn.com/foo.jpg'));
|
||||
|
||||
download('unicorn.com/foo.jpg').pipe(fs.createWriteStream('dist/foo.jpg'));
|
||||
download('unicorn.com/foo.jpg').pipe(fs.createWriteStream('dist/foo.jpg'));
|
||||
|
||||
Promise.all([
|
||||
'unicorn.com/foo.jpg',
|
||||
'cats.com/dancing.gif'
|
||||
].map(x => download(x, 'dist'))).then(() => {
|
||||
console.log('files downloaded!');
|
||||
});
|
||||
await Promise.all([
|
||||
'unicorn.com/foo.jpg',
|
||||
'cats.com/dancing.gif'
|
||||
].map(url => download(url, 'dist')));
|
||||
})();
|
||||
```
|
||||
|
||||
### Proxies
|
||||
|
||||
To work with proxies, read the [`got documentation`](https://github.com/sindresorhus/got#proxies).
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### download(url, [destination], [options])
|
||||
### download(url, destination?, options?)
|
||||
|
||||
Returns both a `Promise<Buffer>` and a [Duplex stream](https://nodejs.org/api/stream.html#stream_class_stream_duplex) with [additional events](https://github.com/sindresorhus/got#streams-1).
|
||||
|
||||
|
@ -73,14 +73,3 @@ If set to `true`, try extracting the file using [`decompress`](https://github.co
|
|||
Type: `string`
|
||||
|
||||
Name of the saved file.
|
||||
|
||||
##### proxy
|
||||
|
||||
Type: `string`
|
||||
|
||||
Proxy endpoint.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Kevin Mårtensson](https://github.com/kevva)
|
||||
|
|
205
node_modules/file-type/index.d.ts
generated
vendored
Normal file
205
node_modules/file-type/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,205 @@
|
|||
/// <reference types="node"/>
|
||||
import {Readable as ReadableStream} from 'stream';
|
||||
|
||||
declare namespace fileType {
|
||||
type FileType =
|
||||
| 'jpg'
|
||||
| 'png'
|
||||
| 'gif'
|
||||
| 'webp'
|
||||
| 'flif'
|
||||
| 'cr2'
|
||||
| 'orf'
|
||||
| 'arw'
|
||||
| 'dng'
|
||||
| 'nef'
|
||||
| 'tif'
|
||||
| 'bmp'
|
||||
| 'jxr'
|
||||
| 'psd'
|
||||
| 'zip'
|
||||
| 'tar'
|
||||
| 'rar'
|
||||
| 'gz'
|
||||
| 'bz2'
|
||||
| '7z'
|
||||
| 'dmg'
|
||||
| 'mp4'
|
||||
| 'mid'
|
||||
| 'mkv'
|
||||
| 'webm'
|
||||
| 'mov'
|
||||
| 'avi'
|
||||
| 'wmv'
|
||||
| 'mpg'
|
||||
| 'mp2'
|
||||
| 'mp3'
|
||||
| 'm4a'
|
||||
| 'ogg'
|
||||
| 'opus'
|
||||
| 'flac'
|
||||
| 'wav'
|
||||
| 'qcp'
|
||||
| 'amr'
|
||||
| 'pdf'
|
||||
| 'epub'
|
||||
| 'mobi'
|
||||
| 'exe'
|
||||
| 'swf'
|
||||
| 'rtf'
|
||||
| 'woff'
|
||||
| 'woff2'
|
||||
| 'eot'
|
||||
| 'ttf'
|
||||
| 'otf'
|
||||
| 'ico'
|
||||
| 'flv'
|
||||
| 'ps'
|
||||
| 'xz'
|
||||
| 'sqlite'
|
||||
| 'nes'
|
||||
| 'crx'
|
||||
| 'xpi'
|
||||
| 'cab'
|
||||
| 'deb'
|
||||
| 'ar'
|
||||
| 'rpm'
|
||||
| 'Z'
|
||||
| 'lz'
|
||||
| 'msi'
|
||||
| 'mxf'
|
||||
| 'mts'
|
||||
| 'wasm'
|
||||
| 'blend'
|
||||
| 'bpg'
|
||||
| 'docx'
|
||||
| 'pptx'
|
||||
| 'xlsx'
|
||||
| '3gp'
|
||||
| '3g2'
|
||||
| 'jp2'
|
||||
| 'jpm'
|
||||
| 'jpx'
|
||||
| 'mj2'
|
||||
| 'aif'
|
||||
| 'odt'
|
||||
| 'ods'
|
||||
| 'odp'
|
||||
| 'xml'
|
||||
| 'heic'
|
||||
| 'cur'
|
||||
| 'ktx'
|
||||
| 'ape'
|
||||
| 'wv'
|
||||
| 'asf'
|
||||
| 'wma'
|
||||
| 'wmv'
|
||||
| 'dcm'
|
||||
| 'mpc'
|
||||
| 'ics'
|
||||
| 'glb'
|
||||
| 'pcap'
|
||||
| 'dsf'
|
||||
| 'lnk'
|
||||
| 'alias'
|
||||
| 'voc'
|
||||
| 'ac3'
|
||||
| 'm4a'
|
||||
| 'm4b'
|
||||
| 'm4p'
|
||||
| 'm4v'
|
||||
| 'f4a'
|
||||
| 'f4b'
|
||||
| 'f4p'
|
||||
| 'f4v';
|
||||
|
||||
interface FileTypeResult {
|
||||
/**
|
||||
One of the supported [file types](https://github.com/sindresorhus/file-type#supported-file-types).
|
||||
*/
|
||||
ext: FileType;
|
||||
|
||||
/**
|
||||
The detected [MIME type](https://en.wikipedia.org/wiki/Internet_media_type).
|
||||
*/
|
||||
mime: string;
|
||||
}
|
||||
|
||||
type ReadableStreamWithFileType = ReadableStream & {
|
||||
readonly fileType?: FileTypeResult;
|
||||
};
|
||||
}
|
||||
|
||||
declare const fileType: {
|
||||
/**
|
||||
Detect the file type of a `Buffer`/`Uint8Array`/`ArrayBuffer`. The file type is detected by checking the [magic number](https://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files) of the buffer.
|
||||
|
||||
@param buffer - It only needs the first `.minimumBytes` bytes. The exception is detection of `docx`, `pptx`, and `xlsx` which potentially requires reading the whole file.
|
||||
@returns The detected file type and MIME type or `undefined` when there was no match.
|
||||
|
||||
@example
|
||||
```
|
||||
import readChunk = require('read-chunk');
|
||||
import fileType = require('file-type');
|
||||
|
||||
const buffer = readChunk.sync('unicorn.png', 0, fileType.minimumBytes);
|
||||
|
||||
fileType(buffer);
|
||||
//=> {ext: 'png', mime: 'image/png'}
|
||||
|
||||
|
||||
// Or from a remote location:
|
||||
|
||||
import * as http from 'http';
|
||||
|
||||
const url = 'https://assets-cdn.github.com/images/spinners/octocat-spinner-32.gif';
|
||||
|
||||
http.get(url, response => {
|
||||
response.on('readable', () => {
|
||||
const chunk = response.read(fileType.minimumBytes);
|
||||
response.destroy();
|
||||
console.log(fileType(chunk));
|
||||
//=> {ext: 'gif', mime: 'image/gif'}
|
||||
});
|
||||
});
|
||||
```
|
||||
*/
|
||||
(buffer: Buffer | Uint8Array | ArrayBuffer): fileType.FileTypeResult | undefined;
|
||||
|
||||
/**
|
||||
The minimum amount of bytes needed to detect a file type. Currently, it's 4100 bytes, but it can change, so don't hard-code it.
|
||||
*/
|
||||
readonly minimumBytes: number;
|
||||
|
||||
/**
|
||||
Detect the file type of a readable stream.
|
||||
|
||||
@param readableStream - A readable stream containing a file to examine, see: [`stream.Readable`](https://nodejs.org/api/stream.html#stream_class_stream_readable).
|
||||
@returns A `Promise` which resolves to the original readable stream argument, but with an added `fileType` property, which is an object like the one returned from `fileType()`.
|
||||
|
||||
@example
|
||||
```
|
||||
import * as fs from 'fs';
|
||||
import * as crypto from 'crypto';
|
||||
import fileType = require('file-type');
|
||||
|
||||
(async () => {
|
||||
const read = fs.createReadStream('encrypted.enc');
|
||||
const decipher = crypto.createDecipheriv(alg, key, iv);
|
||||
|
||||
const stream = await fileType.stream(read.pipe(decipher));
|
||||
|
||||
console.log(stream.fileType);
|
||||
//=> {ext: 'mov', mime: 'video/quicktime'}
|
||||
|
||||
const write = fs.createWriteStream(`decrypted.${stream.fileType.ext}`);
|
||||
stream.pipe(write);
|
||||
})();
|
||||
```
|
||||
*/
|
||||
readonly stream: (
|
||||
readableStream: ReadableStream
|
||||
) => Promise<fileType.ReadableStreamWithFileType>;
|
||||
};
|
||||
|
||||
export = fileType;
|
446
node_modules/download/node_modules/file-type/index.js → node_modules/file-type/index.js
generated
vendored
446
node_modules/download/node_modules/file-type/index.js → node_modules/file-type/index.js
generated
vendored
|
@ -1,14 +1,19 @@
|
|||
'use strict';
|
||||
const toBytes = s => [...s].map(c => c.charCodeAt(0));
|
||||
const xpiZipFilename = toBytes('META-INF/mozilla.rsa');
|
||||
const oxmlContentTypes = toBytes('[Content_Types].xml');
|
||||
const oxmlRels = toBytes('_rels/.rels');
|
||||
const {stringToBytes, readUInt64LE, tarHeaderChecksumMatches, uint8ArrayUtf8ByteString} = require('./util');
|
||||
|
||||
module.exports = input => {
|
||||
const buf = input instanceof Uint8Array ? input : new Uint8Array(input);
|
||||
const xpiZipFilename = stringToBytes('META-INF/mozilla.rsa');
|
||||
const oxmlContentTypes = stringToBytes('[Content_Types].xml');
|
||||
const oxmlRels = stringToBytes('_rels/.rels');
|
||||
|
||||
if (!(buf && buf.length > 1)) {
|
||||
return null;
|
||||
const fileType = input => {
|
||||
if (!(input instanceof Uint8Array || input instanceof ArrayBuffer || Buffer.isBuffer(input))) {
|
||||
throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`Buffer\` or \`ArrayBuffer\`, got \`${typeof input}\``);
|
||||
}
|
||||
|
||||
const buffer = input instanceof Uint8Array ? input : new Uint8Array(input);
|
||||
|
||||
if (!(buffer && buffer.length > 1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const check = (header, options) => {
|
||||
|
@ -20,10 +25,10 @@ module.exports = input => {
|
|||
// If a bitmask is set
|
||||
if (options.mask) {
|
||||
// If header doesn't equal `buf` with bits masked off
|
||||
if (header[i] !== (options.mask[i] & buf[i + options.offset])) {
|
||||
if (header[i] !== (options.mask[i] & buffer[i + options.offset])) {
|
||||
return false;
|
||||
}
|
||||
} else if (header[i] !== buf[i + options.offset]) {
|
||||
} else if (header[i] !== buffer[i + options.offset]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +36,7 @@ module.exports = input => {
|
|||
return true;
|
||||
};
|
||||
|
||||
const checkString = (header, options) => check(toBytes(header), options);
|
||||
const checkString = (header, options) => check(stringToBytes(header), options);
|
||||
|
||||
if (check([0xFF, 0xD8, 0xFF])) {
|
||||
return {
|
||||
|
@ -68,7 +73,7 @@ module.exports = input => {
|
|||
};
|
||||
}
|
||||
|
||||
// Needs to be before `tif` check
|
||||
// `cr2`, `orf`, and `arw` need to be before `tif` check
|
||||
if (
|
||||
(check([0x49, 0x49, 0x2A, 0x0]) || check([0x4D, 0x4D, 0x0, 0x2A])) &&
|
||||
check([0x43, 0x52], {offset: 8})
|
||||
|
@ -79,6 +84,34 @@ module.exports = input => {
|
|||
};
|
||||
}
|
||||
|
||||
if (check([0x49, 0x49, 0x52, 0x4F, 0x08, 0x00, 0x00, 0x00, 0x18])) {
|
||||
return {
|
||||
ext: 'orf',
|
||||
mime: 'image/x-olympus-orf'
|
||||
};
|
||||
}
|
||||
|
||||
if (check([0x49, 0x49, 0x2A, 0x00, 0x10, 0xFB, 0x86, 0x01])) {
|
||||
return {
|
||||
ext: 'arw',
|
||||
mime: 'image/x-sony-arw'
|
||||
};
|
||||
}
|
||||
|
||||
if (check([0x49, 0x49, 0x2A, 0x00, 0x08, 0x00, 0x00, 0x00, 0x2D])) {
|
||||
return {
|
||||
ext: 'dng',
|
||||
mime: 'image/x-adobe-dng'
|
||||
};
|
||||
}
|
||||
|
||||
if (check([0x49, 0x49, 0x2A, 0x00, 0x30, 0x3D, 0x72, 0x01, 0x1C])) {
|
||||
return {
|
||||
ext: 'nef',
|
||||
mime: 'image/x-nikon-nef'
|
||||
};
|
||||
}
|
||||
|
||||
if (
|
||||
check([0x49, 0x49, 0x2A, 0x0]) ||
|
||||
check([0x4D, 0x4D, 0x0, 0x2A])
|
||||
|
@ -151,48 +184,61 @@ module.exports = input => {
|
|||
};
|
||||
}
|
||||
|
||||
// https://github.com/file/file/blob/master/magic/Magdir/msooxml
|
||||
if (check(oxmlContentTypes, {offset: 30}) || check(oxmlRels, {offset: 30})) {
|
||||
const sliced = buf.subarray(4, 4 + 2000);
|
||||
const nextZipHeaderIndex = arr => arr.findIndex((el, i, arr) => arr[i] === 0x50 && arr[i + 1] === 0x4B && arr[i + 2] === 0x3 && arr[i + 3] === 0x4);
|
||||
const header2Pos = nextZipHeaderIndex(sliced);
|
||||
// The docx, xlsx and pptx file types extend the Office Open XML file format:
|
||||
// https://en.wikipedia.org/wiki/Office_Open_XML_file_formats
|
||||
// We look for:
|
||||
// - one entry named '[Content_Types].xml' or '_rels/.rels',
|
||||
// - one entry indicating specific type of file.
|
||||
// MS Office, OpenOffice and LibreOffice may put the parts in different order, so the check should not rely on it.
|
||||
const findNextZipHeaderIndex = (arr, startAt = 0) => arr.findIndex((el, i, arr) => i >= startAt && arr[i] === 0x50 && arr[i + 1] === 0x4B && arr[i + 2] === 0x3 && arr[i + 3] === 0x4);
|
||||
|
||||
if (header2Pos !== -1) {
|
||||
const slicedAgain = buf.subarray(header2Pos + 8, header2Pos + 8 + 1000);
|
||||
const header3Pos = nextZipHeaderIndex(slicedAgain);
|
||||
let zipHeaderIndex = 0; // The first zip header was already found at index 0
|
||||
let oxmlFound = false;
|
||||
let type;
|
||||
|
||||
if (header3Pos !== -1) {
|
||||
const offset = 8 + header2Pos + header3Pos + 30;
|
||||
do {
|
||||
const offset = zipHeaderIndex + 30;
|
||||
|
||||
if (checkString('word/', {offset})) {
|
||||
return {
|
||||
ext: 'docx',
|
||||
mime: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
|
||||
};
|
||||
}
|
||||
if (!oxmlFound) {
|
||||
oxmlFound = (check(oxmlContentTypes, {offset}) || check(oxmlRels, {offset}));
|
||||
}
|
||||
|
||||
if (checkString('ppt/', {offset})) {
|
||||
return {
|
||||
ext: 'pptx',
|
||||
mime: 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
|
||||
};
|
||||
}
|
||||
|
||||
if (checkString('xl/', {offset})) {
|
||||
return {
|
||||
ext: 'xlsx',
|
||||
mime: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
};
|
||||
}
|
||||
if (!type) {
|
||||
if (checkString('word/', {offset})) {
|
||||
type = {
|
||||
ext: 'docx',
|
||||
mime: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
|
||||
};
|
||||
} else if (checkString('ppt/', {offset})) {
|
||||
type = {
|
||||
ext: 'pptx',
|
||||
mime: 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
|
||||
};
|
||||
} else if (checkString('xl/', {offset})) {
|
||||
type = {
|
||||
ext: 'xlsx',
|
||||
mime: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
if (oxmlFound && type) {
|
||||
return type;
|
||||
}
|
||||
|
||||
zipHeaderIndex = findNextZipHeaderIndex(buffer, offset);
|
||||
} while (zipHeaderIndex >= 0);
|
||||
|
||||
// No more zip parts available in the buffer, but maybe we are almost certain about the type?
|
||||
if (type) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
check([0x50, 0x4B]) &&
|
||||
(buf[2] === 0x3 || buf[2] === 0x5 || buf[2] === 0x7) &&
|
||||
(buf[3] === 0x4 || buf[3] === 0x6 || buf[3] === 0x8)
|
||||
(buffer[2] === 0x3 || buffer[2] === 0x5 || buffer[2] === 0x7) &&
|
||||
(buffer[3] === 0x4 || buffer[3] === 0x6 || buffer[3] === 0x8)
|
||||
) {
|
||||
return {
|
||||
ext: 'zip',
|
||||
|
@ -200,7 +246,10 @@ module.exports = input => {
|
|||
};
|
||||
}
|
||||
|
||||
if (check([0x75, 0x73, 0x74, 0x61, 0x72], {offset: 257})) {
|
||||
if (
|
||||
check([0x30, 0x30, 0x30, 0x30, 0x30, 0x30], {offset: 148, mask: [0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8]}) && // Valid tar checksum
|
||||
tarHeaderChecksumMatches(buffer)
|
||||
) {
|
||||
return {
|
||||
ext: 'tar',
|
||||
mime: 'application/x-tar'
|
||||
|
@ -209,7 +258,7 @@ module.exports = input => {
|
|||
|
||||
if (
|
||||
check([0x52, 0x61, 0x72, 0x21, 0x1A, 0x7]) &&
|
||||
(buf[6] === 0x0 || buf[6] === 0x1)
|
||||
(buffer[6] === 0x0 || buffer[6] === 0x1)
|
||||
) {
|
||||
return {
|
||||
ext: 'rar',
|
||||
|
@ -245,25 +294,70 @@ module.exports = input => {
|
|||
};
|
||||
}
|
||||
|
||||
if (check([0x33, 0x67, 0x70, 0x35]) || // 3gp5
|
||||
(
|
||||
check([0x0, 0x0, 0x0]) && check([0x66, 0x74, 0x79, 0x70], {offset: 4}) &&
|
||||
(
|
||||
check([0x6D, 0x70, 0x34, 0x31], {offset: 8}) || // MP41
|
||||
check([0x6D, 0x70, 0x34, 0x32], {offset: 8}) || // MP42
|
||||
check([0x69, 0x73, 0x6F, 0x6D], {offset: 8}) || // ISOM
|
||||
check([0x69, 0x73, 0x6F, 0x32], {offset: 8}) || // ISO2
|
||||
check([0x6D, 0x6D, 0x70, 0x34], {offset: 8}) || // MMP4
|
||||
check([0x4D, 0x34, 0x56], {offset: 8}) || // M4V
|
||||
check([0x64, 0x61, 0x73, 0x68], {offset: 8}) // DASH
|
||||
)
|
||||
)) {
|
||||
// `mov` format variants
|
||||
if (
|
||||
check([0x66, 0x72, 0x65, 0x65], {offset: 4}) || // `free`
|
||||
check([0x6D, 0x64, 0x61, 0x74], {offset: 4}) || // `mdat` MJPEG
|
||||
check([0x6D, 0x6F, 0x6F, 0x76], {offset: 4}) || // `moov`
|
||||
check([0x77, 0x69, 0x64, 0x65], {offset: 4}) // `wide`
|
||||
) {
|
||||
return {
|
||||
ext: 'mp4',
|
||||
mime: 'video/mp4'
|
||||
ext: 'mov',
|
||||
mime: 'video/quicktime'
|
||||
};
|
||||
}
|
||||
|
||||
// File Type Box (https://en.wikipedia.org/wiki/ISO_base_media_file_format)
|
||||
// It's not required to be first, but it's recommended to be. Almost all ISO base media files start with `ftyp` box.
|
||||
// `ftyp` box must contain a brand major identifier, which must consist of ISO 8859-1 printable characters.
|
||||
// Here we check for 8859-1 printable characters (for simplicity, it's a mask which also catches one non-printable character).
|
||||
if (
|
||||
check([0x66, 0x74, 0x79, 0x70], {offset: 4}) && // `ftyp`
|
||||
(buffer[8] & 0x60) !== 0x00 && (buffer[9] & 0x60) !== 0x00 && (buffer[10] & 0x60) !== 0x00 && (buffer[11] & 0x60) !== 0x00 // Brand major
|
||||
) {
|
||||
// They all can have MIME `video/mp4` except `application/mp4` special-case which is hard to detect.
|
||||
// For some cases, we're specific, everything else falls to `video/mp4` with `mp4` extension.
|
||||
const brandMajor = uint8ArrayUtf8ByteString(buffer, 8, 12);
|
||||
switch (brandMajor) {
|
||||
case 'mif1':
|
||||
return {ext: 'heic', mime: 'image/heif'};
|
||||
case 'msf1':
|
||||
return {ext: 'heic', mime: 'image/heif-sequence'};
|
||||
case 'heic': case 'heix':
|
||||
return {ext: 'heic', mime: 'image/heic'};
|
||||
case 'hevc': case 'hevx':
|
||||
return {ext: 'heic', mime: 'image/heic-sequence'};
|
||||
case 'qt ':
|
||||
return {ext: 'mov', mime: 'video/quicktime'};
|
||||
case 'M4V ': case 'M4VH': case 'M4VP':
|
||||
return {ext: 'm4v', mime: 'video/x-m4v'};
|
||||
case 'M4P ':
|
||||
return {ext: 'm4p', mime: 'video/mp4'};
|
||||
case 'M4B ':
|
||||
return {ext: 'm4b', mime: 'audio/mp4'};
|
||||
case 'M4A ':
|
||||
return {ext: 'm4a', mime: 'audio/x-m4a'};
|
||||
case 'F4V ':
|
||||
return {ext: 'f4v', mime: 'video/mp4'};
|
||||
case 'F4P ':
|
||||
return {ext: 'f4p', mime: 'video/mp4'};
|
||||
case 'F4A ':
|
||||
return {ext: 'f4a', mime: 'audio/mp4'};
|
||||
case 'F4B ':
|
||||
return {ext: 'f4b', mime: 'audio/mp4'};
|
||||
default:
|
||||
if (brandMajor.startsWith('3g')) {
|
||||
if (brandMajor.startsWith('3g2')) {
|
||||
return {ext: '3g2', mime: 'video/3gpp2'};
|
||||
}
|
||||
|
||||
return {ext: '3gp', mime: 'video/3gpp'};
|
||||
}
|
||||
|
||||
return {ext: 'mp4', mime: 'video/mp4'};
|
||||
}
|
||||
}
|
||||
|
||||
if (check([0x4D, 0x54, 0x68, 0x64])) {
|
||||
return {
|
||||
ext: 'mid',
|
||||
|
@ -273,7 +367,7 @@ module.exports = input => {
|
|||
|
||||
// https://github.com/threatstack/libmagic/blob/master/magic/Magdir/matroska
|
||||
if (check([0x1A, 0x45, 0xDF, 0xA3])) {
|
||||
const sliced = buf.subarray(4, 4 + 4096);
|
||||
const sliced = buffer.subarray(4, 4 + 4096);
|
||||
const idPos = sliced.findIndex((el, i, arr) => arr[i] === 0x42 && arr[i + 1] === 0x82);
|
||||
|
||||
if (idPos !== -1) {
|
||||
|
@ -296,31 +390,22 @@ module.exports = input => {
|
|||
}
|
||||
}
|
||||
|
||||
if (check([0x0, 0x0, 0x0, 0x14, 0x66, 0x74, 0x79, 0x70, 0x71, 0x74, 0x20, 0x20]) ||
|
||||
check([0x66, 0x72, 0x65, 0x65], {offset: 4}) ||
|
||||
check([0x66, 0x74, 0x79, 0x70, 0x71, 0x74, 0x20, 0x20], {offset: 4}) ||
|
||||
check([0x6D, 0x64, 0x61, 0x74], {offset: 4}) || // MJPEG
|
||||
check([0x77, 0x69, 0x64, 0x65], {offset: 4})) {
|
||||
return {
|
||||
ext: 'mov',
|
||||
mime: 'video/quicktime'
|
||||
};
|
||||
}
|
||||
|
||||
// RIFF file format which might be AVI, WAV, QCP, etc
|
||||
if (check([0x52, 0x49, 0x46, 0x46])) {
|
||||
if (check([0x41, 0x56, 0x49], {offset: 8})) {
|
||||
return {
|
||||
ext: 'avi',
|
||||
mime: 'video/x-msvideo'
|
||||
mime: 'video/vnd.avi'
|
||||
};
|
||||
}
|
||||
|
||||
if (check([0x57, 0x41, 0x56, 0x45], {offset: 8})) {
|
||||
return {
|
||||
ext: 'wav',
|
||||
mime: 'audio/x-wav'
|
||||
mime: 'audio/vnd.wave'
|
||||
};
|
||||
}
|
||||
|
||||
// QLCM, QCP file
|
||||
if (check([0x51, 0x4C, 0x43, 0x4D], {offset: 8})) {
|
||||
return {
|
||||
|
@ -330,10 +415,41 @@ module.exports = input => {
|
|||
}
|
||||
}
|
||||
|
||||
// ASF_Header_Object first 80 bytes
|
||||
if (check([0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xA6, 0xD9])) {
|
||||
// Search for header should be in first 1KB of file.
|
||||
|
||||
let offset = 30;
|
||||
do {
|
||||
const objectSize = readUInt64LE(buffer, offset + 16);
|
||||
if (check([0x91, 0x07, 0xDC, 0xB7, 0xB7, 0xA9, 0xCF, 0x11, 0x8E, 0xE6, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65], {offset})) {
|
||||
// Sync on Stream-Properties-Object (B7DC0791-A9B7-11CF-8EE6-00C00C205365)
|
||||
if (check([0x40, 0x9E, 0x69, 0xF8, 0x4D, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B], {offset: offset + 24})) {
|
||||
// Found audio:
|
||||
return {
|
||||
ext: 'wma',
|
||||
mime: 'audio/x-ms-wma'
|
||||
};
|
||||
}
|
||||
|
||||
if (check([0xC0, 0xEF, 0x19, 0xBC, 0x4D, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B], {offset: offset + 24})) {
|
||||
// Found video:
|
||||
return {
|
||||
ext: 'wmv',
|
||||
mime: 'video/x-ms-asf'
|
||||
};
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
offset += objectSize;
|
||||
} while (offset + 24 <= buffer.length);
|
||||
|
||||
// Default to ASF generic extension
|
||||
return {
|
||||
ext: 'wmv',
|
||||
mime: 'video/x-ms-wmv'
|
||||
ext: 'asf',
|
||||
mime: 'application/vnd.ms-asf'
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -347,18 +463,11 @@ module.exports = input => {
|
|||
};
|
||||
}
|
||||
|
||||
if (check([0x66, 0x74, 0x79, 0x70, 0x33, 0x67], {offset: 4})) {
|
||||
return {
|
||||
ext: '3gp',
|
||||
mime: 'video/3gpp'
|
||||
};
|
||||
}
|
||||
|
||||
// Check for MPEG header at different starting offsets
|
||||
for (let start = 0; start < 2 && start < (buf.length - 16); start++) {
|
||||
for (let start = 0; start < 2 && start < (buffer.length - 16); start++) {
|
||||
if (
|
||||
check([0x49, 0x44, 0x33], {offset: start}) || // ID3 header
|
||||
check([0xFF, 0xE2], {offset: start, mask: [0xFF, 0xE2]}) // MPEG 1 or 2 Layer 3 header
|
||||
check([0xFF, 0xE2], {offset: start, mask: [0xFF, 0xE6]}) // MPEG 1 or 2 Layer 3 header
|
||||
) {
|
||||
return {
|
||||
ext: 'mp3',
|
||||
|
@ -367,7 +476,7 @@ module.exports = input => {
|
|||
}
|
||||
|
||||
if (
|
||||
check([0xFF, 0xE4], {offset: start, mask: [0xFF, 0xE4]}) // MPEG 1 or 2 Layer 2 header
|
||||
check([0xFF, 0xE4], {offset: start, mask: [0xFF, 0xE6]}) // MPEG 1 or 2 Layer 2 header
|
||||
) {
|
||||
return {
|
||||
ext: 'mp2',
|
||||
|
@ -394,16 +503,6 @@ module.exports = input => {
|
|||
}
|
||||
}
|
||||
|
||||
if (
|
||||
check([0x66, 0x74, 0x79, 0x70, 0x4D, 0x34, 0x41], {offset: 4}) ||
|
||||
check([0x4D, 0x34, 0x41, 0x20])
|
||||
) {
|
||||
return {
|
||||
ext: 'm4a',
|
||||
mime: 'audio/m4a'
|
||||
};
|
||||
}
|
||||
|
||||
// Needs to be before `ogg` check
|
||||
if (check([0x4F, 0x70, 0x75, 0x73, 0x48, 0x65, 0x61, 0x64], {offset: 28})) {
|
||||
return {
|
||||
|
@ -423,6 +522,7 @@ module.exports = input => {
|
|||
mime: 'video/ogg'
|
||||
};
|
||||
}
|
||||
|
||||
// If '\x01video' in header.
|
||||
if (check([0x01, 0x76, 0x69, 0x64, 0x65, 0x6F, 0x00], {offset: 28})) {
|
||||
return {
|
||||
|
@ -430,6 +530,7 @@ module.exports = input => {
|
|||
mime: 'video/ogg'
|
||||
};
|
||||
}
|
||||
|
||||
// If ' FLAC' in header https://xiph.org/flac/faq.html
|
||||
if (check([0x7F, 0x46, 0x4C, 0x41, 0x43], {offset: 28})) {
|
||||
return {
|
||||
|
@ -468,13 +569,20 @@ module.exports = input => {
|
|||
};
|
||||
}
|
||||
|
||||
if (check([0x4D, 0x41, 0x43, 0x20])) {
|
||||
if (check([0x4D, 0x41, 0x43, 0x20])) { // 'MAC '
|
||||
return {
|
||||
ext: 'ape',
|
||||
mime: 'audio/ape'
|
||||
};
|
||||
}
|
||||
|
||||
if (check([0x77, 0x76, 0x70, 0x6B])) { // 'wvpk'
|
||||
return {
|
||||
ext: 'wv',
|
||||
mime: 'audio/wavpack'
|
||||
};
|
||||
}
|
||||
|
||||
if (check([0x23, 0x21, 0x41, 0x4D, 0x52, 0x0A])) {
|
||||
return {
|
||||
ext: 'amr',
|
||||
|
@ -497,7 +605,7 @@ module.exports = input => {
|
|||
}
|
||||
|
||||
if (
|
||||
(buf[0] === 0x43 || buf[0] === 0x46) &&
|
||||
(buffer[0] === 0x43 || buffer[0] === 0x46) &&
|
||||
check([0x57, 0x53], {offset: 1})
|
||||
) {
|
||||
return {
|
||||
|
@ -556,7 +664,7 @@ module.exports = input => {
|
|||
) {
|
||||
return {
|
||||
ext: 'eot',
|
||||
mime: 'application/octet-stream'
|
||||
mime: 'application/vnd.ms-fontobject'
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -746,7 +854,7 @@ module.exports = input => {
|
|||
}
|
||||
}
|
||||
|
||||
if (check([0x46, 0x4F, 0x52, 0x4D, 0x00])) {
|
||||
if (check([0x46, 0x4F, 0x52, 0x4D])) {
|
||||
return {
|
||||
ext: 'aif',
|
||||
mime: 'audio/aiff'
|
||||
|
@ -767,37 +875,6 @@ module.exports = input => {
|
|||
};
|
||||
}
|
||||
|
||||
// File Type Box (https://en.wikipedia.org/wiki/ISO_base_media_file_format)
|
||||
if (check([0x66, 0x74, 0x79, 0x70], {offset: 4})) {
|
||||
if (check([0x6D, 0x69, 0x66, 0x31], {offset: 8})) {
|
||||
return {
|
||||
ext: 'heic',
|
||||
mime: 'image/heif'
|
||||
};
|
||||
}
|
||||
|
||||
if (check([0x6D, 0x73, 0x66, 0x31], {offset: 8})) {
|
||||
return {
|
||||
ext: 'heic',
|
||||
mime: 'image/heif-sequence'
|
||||
};
|
||||
}
|
||||
|
||||
if (check([0x68, 0x65, 0x69, 0x63], {offset: 8}) || check([0x68, 0x65, 0x69, 0x78], {offset: 8})) {
|
||||
return {
|
||||
ext: 'heic',
|
||||
mime: 'image/heic'
|
||||
};
|
||||
}
|
||||
|
||||
if (check([0x68, 0x65, 0x76, 0x63], {offset: 8}) || check([0x68, 0x65, 0x76, 0x78], {offset: 8})) {
|
||||
return {
|
||||
ext: 'heic',
|
||||
mime: 'image/heic-sequence'
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
if (check([0xAB, 0x4B, 0x54, 0x58, 0x20, 0x31, 0x31, 0xBB, 0x0D, 0x0A, 0x1A, 0x0A])) {
|
||||
return {
|
||||
ext: 'ktx',
|
||||
|
@ -805,5 +882,110 @@ module.exports = input => {
|
|||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
if (check([0x44, 0x49, 0x43, 0x4D], {offset: 128})) {
|
||||
return {
|
||||
ext: 'dcm',
|
||||
mime: 'application/dicom'
|
||||
};
|
||||
}
|
||||
|
||||
// Musepack, SV7
|
||||
if (check([0x4D, 0x50, 0x2B])) {
|
||||
return {
|
||||
ext: 'mpc',
|
||||
mime: 'audio/x-musepack'
|
||||
};
|
||||
}
|
||||
|
||||
// Musepack, SV8
|
||||
if (check([0x4D, 0x50, 0x43, 0x4B])) {
|
||||
return {
|
||||
ext: 'mpc',
|
||||
mime: 'audio/x-musepack'
|
||||
};
|
||||
}
|
||||
|
||||
if (check([0x42, 0x45, 0x47, 0x49, 0x4E, 0x3A])) {
|
||||
return {
|
||||
ext: 'ics',
|
||||
mime: 'text/calendar'
|
||||
};
|
||||
}
|
||||
|
||||
if (check([0x67, 0x6C, 0x54, 0x46, 0x02, 0x00, 0x00, 0x00])) {
|
||||
return {
|
||||
ext: 'glb',
|
||||
mime: 'model/gltf-binary'
|
||||
};
|
||||
}
|
||||
|
||||
if (check([0xD4, 0xC3, 0xB2, 0xA1]) || check([0xA1, 0xB2, 0xC3, 0xD4])) {
|
||||
return {
|
||||
ext: 'pcap',
|
||||
mime: 'application/vnd.tcpdump.pcap'
|
||||
};
|
||||
}
|
||||
|
||||
// Sony DSD Stream File (DSF)
|
||||
if (check([0x44, 0x53, 0x44, 0x20])) {
|
||||
return {
|
||||
ext: 'dsf',
|
||||
mime: 'audio/x-dsf' // Non-standard
|
||||
};
|
||||
}
|
||||
|
||||
if (check([0x4C, 0x00, 0x00, 0x00, 0x01, 0x14, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46])) {
|
||||
return {
|
||||
ext: 'lnk',
|
||||
mime: 'application/x.ms.shortcut' // Invented by us
|
||||
};
|
||||
}
|
||||
|
||||
if (check([0x62, 0x6F, 0x6F, 0x6B, 0x00, 0x00, 0x00, 0x00, 0x6D, 0x61, 0x72, 0x6B, 0x00, 0x00, 0x00, 0x00])) {
|
||||
return {
|
||||
ext: 'alias',
|
||||
mime: 'application/x.apple.alias' // Invented by us
|
||||
};
|
||||
}
|
||||
|
||||
if (checkString('Creative Voice File')) {
|
||||
return {
|
||||
ext: 'voc',
|
||||
mime: 'audio/x-voc'
|
||||
};
|
||||
}
|
||||
|
||||
if (check([0x0B, 0x77])) {
|
||||
return {
|
||||
ext: 'ac3',
|
||||
mime: 'audio/vnd.dolby.dd-raw'
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = fileType;
|
||||
|
||||
Object.defineProperty(fileType, 'minimumBytes', {value: 4100});
|
||||
|
||||
fileType.stream = readableStream => new Promise((resolve, reject) => {
|
||||
// Using `eval` to work around issues when bundling with Webpack
|
||||
const stream = eval('require')('stream'); // eslint-disable-line no-eval
|
||||
|
||||
readableStream.once('readable', () => {
|
||||
const pass = new stream.PassThrough();
|
||||
const chunk = readableStream.read(module.exports.minimumBytes) || readableStream.read();
|
||||
try {
|
||||
pass.fileType = fileType(chunk);
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
|
||||
readableStream.unshift(chunk);
|
||||
|
||||
if (stream.pipeline) {
|
||||
resolve(stream.pipeline(readableStream, pass, () => {}));
|
||||
} else {
|
||||
resolve(readableStream.pipe(pass));
|
||||
}
|
||||
});
|
||||
});
|
2
node_modules/caw/license → node_modules/file-type/license
generated
vendored
2
node_modules/caw/license → node_modules/file-type/license
generated
vendored
|
@ -1,6 +1,6 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Kevin Mårtensson <kevinmartensson@gmail.com> (github.com/kevva)
|
||||
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:
|
||||
|
|
@ -1,31 +1,31 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"file-type@8.1.0",
|
||||
"file-type@11.1.0",
|
||||
"/home/runner/work/ghaction-upx/ghaction-upx"
|
||||
]
|
||||
],
|
||||
"_from": "file-type@8.1.0",
|
||||
"_id": "file-type@8.1.0",
|
||||
"_from": "file-type@11.1.0",
|
||||
"_id": "file-type@11.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-qyQ0pzAy78gVoJsmYeNgl8uH8yKhr1lVhW7JbzJmnlRi0I4R2eEDEJZVKG8agpDnLpacwNbDhLNG/LMdxHD2YQ==",
|
||||
"_location": "/download/file-type",
|
||||
"_integrity": "sha512-rM0UO7Qm9K7TWTtA6AShI/t7H5BPjDeGVDaNyg9BjHAj3PysKy7+8C8D137R88jnR3rFJZQB/tFgydl5sN5m7g==",
|
||||
"_location": "/file-type",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "file-type@8.1.0",
|
||||
"raw": "file-type@11.1.0",
|
||||
"name": "file-type",
|
||||
"escapedName": "file-type",
|
||||
"rawSpec": "8.1.0",
|
||||
"rawSpec": "11.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "8.1.0"
|
||||
"fetchSpec": "11.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/download"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/file-type/-/file-type-8.1.0.tgz",
|
||||
"_spec": "8.1.0",
|
||||
"_resolved": "https://registry.npmjs.org/file-type/-/file-type-11.1.0.tgz",
|
||||
"_spec": "11.1.0",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
|
@ -35,17 +35,22 @@
|
|||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/file-type/issues"
|
||||
},
|
||||
"description": "Detect the file type of a Buffer/Uint8Array",
|
||||
"description": "Detect the file type of a Buffer/Uint8Array/ArrayBuffer",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"read-chunk": "^2.0.0",
|
||||
"xo": "*"
|
||||
"@types/node": "^11.12.2",
|
||||
"ava": "^1.4.1",
|
||||
"pify": "^4.0.1",
|
||||
"read-chunk": "^3.2.0",
|
||||
"tsd": "^0.7.1",
|
||||
"xo": "^0.24.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
"index.js",
|
||||
"index.d.ts",
|
||||
"util.js"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/file-type#readme",
|
||||
"keywords": [
|
||||
|
@ -74,6 +79,10 @@
|
|||
"webp",
|
||||
"flif",
|
||||
"cr2",
|
||||
"orf",
|
||||
"arw",
|
||||
"dng",
|
||||
"nef",
|
||||
"tif",
|
||||
"bmp",
|
||||
"jxr",
|
||||
|
@ -86,7 +95,6 @@
|
|||
"7z",
|
||||
"dmg",
|
||||
"mp4",
|
||||
"m4v",
|
||||
"mid",
|
||||
"mkv",
|
||||
"webm",
|
||||
|
@ -143,7 +151,25 @@
|
|||
"ods",
|
||||
"odp",
|
||||
"xml",
|
||||
"heic"
|
||||
"heic",
|
||||
"wma",
|
||||
"ics",
|
||||
"glb",
|
||||
"pcap",
|
||||
"dsf",
|
||||
"lnk",
|
||||
"alias",
|
||||
"voc",
|
||||
"ac3",
|
||||
"3g2",
|
||||
"m4a",
|
||||
"m4b",
|
||||
"m4p",
|
||||
"m4v",
|
||||
"f4a",
|
||||
"f4b",
|
||||
"f4p",
|
||||
"f4v"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "file-type",
|
||||
|
@ -152,7 +178,7 @@
|
|||
"url": "git+https://github.com/sindresorhus/file-type.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"version": "8.1.0"
|
||||
"version": "11.1.0"
|
||||
}
|
107
node_modules/download/node_modules/file-type/readme.md → node_modules/file-type/readme.md
generated
vendored
107
node_modules/download/node_modules/file-type/readme.md → node_modules/file-type/readme.md
generated
vendored
|
@ -1,8 +1,8 @@
|
|||
# file-type [![Build Status](https://travis-ci.org/sindresorhus/file-type.svg?branch=master)](https://travis-ci.org/sindresorhus/file-type)
|
||||
|
||||
> Detect the file type of a Buffer/Uint8Array
|
||||
> Detect the file type of a Buffer/Uint8Array/ArrayBuffer
|
||||
|
||||
The file type is detected by checking the [magic number](http://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files) of the buffer.
|
||||
The file type is detected by checking the [magic number](https://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files) of the buffer.
|
||||
|
||||
|
||||
## Install
|
||||
|
@ -23,7 +23,8 @@ $ npm install file-type
|
|||
```js
|
||||
const readChunk = require('read-chunk');
|
||||
const fileType = require('file-type');
|
||||
const buffer = readChunk.sync('unicorn.png', 0, 4100);
|
||||
|
||||
const buffer = readChunk.sync('unicorn.png', 0, fileType.minimumBytes);
|
||||
|
||||
fileType(buffer);
|
||||
//=> {ext: 'png', mime: 'image/png'}
|
||||
|
@ -34,17 +35,41 @@ Or from a remote location:
|
|||
```js
|
||||
const http = require('http');
|
||||
const fileType = require('file-type');
|
||||
const url = 'http://assets-cdn.github.com/images/spinners/octocat-spinner-32.gif';
|
||||
|
||||
http.get(url, res => {
|
||||
res.once('data', chunk => {
|
||||
res.destroy();
|
||||
const url = 'https://assets-cdn.github.com/images/spinners/octocat-spinner-32.gif';
|
||||
|
||||
http.get(url, response => {
|
||||
response.on('readable', () => {
|
||||
const chunk = response.read(fileType.minimumBytes);
|
||||
response.destroy();
|
||||
console.log(fileType(chunk));
|
||||
//=> {ext: 'gif', mime: 'image/gif'}
|
||||
});
|
||||
});
|
||||
```
|
||||
|
||||
Or from a stream:
|
||||
|
||||
```js
|
||||
const fs = require('fs');
|
||||
const crypto = require('crypto');
|
||||
const fileType = require('file-type');
|
||||
|
||||
(async () => {
|
||||
const read = fs.createReadStream('encrypted.enc');
|
||||
const decipher = crypto.createDecipheriv(alg, key, iv);
|
||||
|
||||
const stream = await fileType.stream(read.pipe(decipher));
|
||||
|
||||
console.log(stream.fileType);
|
||||
//=> {ext: 'mov', mime: 'video/quicktime'}
|
||||
|
||||
const write = fs.createWriteStream(`decrypted.${stream.fileType.ext}`);
|
||||
stream.pipe(write);
|
||||
})();
|
||||
```
|
||||
|
||||
|
||||
##### Browser
|
||||
|
||||
```js
|
||||
|
@ -68,15 +93,33 @@ xhr.send();
|
|||
Returns an `Object` with:
|
||||
|
||||
- `ext` - One of the [supported file types](#supported-file-types)
|
||||
- `mime` - The [MIME type](http://en.wikipedia.org/wiki/Internet_media_type)
|
||||
- `mime` - The [MIME type](https://en.wikipedia.org/wiki/Internet_media_type)
|
||||
|
||||
Or `null` when no match.
|
||||
Or `undefined` when there is no match.
|
||||
|
||||
#### input
|
||||
|
||||
Type: `Buffer` `Uint8Array`
|
||||
Type: `Buffer | Uint8Array | ArrayBuffer`
|
||||
|
||||
It only needs the first 4100 bytes.
|
||||
It only needs the first `.minimumBytes` bytes. The exception is detection of `docx`, `pptx`, and `xlsx` which potentially requires reading the whole file.
|
||||
|
||||
### fileType.minimumBytes
|
||||
|
||||
Type: `number`
|
||||
|
||||
The minimum amount of bytes needed to detect a file type. Currently, it's 4100 bytes, but it can change, so don't hardcode it.
|
||||
|
||||
### fileType.stream(readableStream)
|
||||
|
||||
Detect the file type of a readable stream.
|
||||
|
||||
Returns a `Promise` which resolves to the original readable stream argument, but with an added `fileType` property, which is an object like the one returned from `fileType()`.
|
||||
|
||||
*Note:* This method is only for Node.js.
|
||||
|
||||
#### readableStream
|
||||
|
||||
Type: [`stream.Readable`](https://nodejs.org/api/stream.html#stream_class_stream_readable)
|
||||
|
||||
|
||||
## Supported file types
|
||||
|
@ -86,7 +129,11 @@ It only needs the first 4100 bytes.
|
|||
- [`gif`](https://en.wikipedia.org/wiki/GIF)
|
||||
- [`webp`](https://en.wikipedia.org/wiki/WebP)
|
||||
- [`flif`](https://en.wikipedia.org/wiki/Free_Lossless_Image_Format)
|
||||
- [`cr2`](http://fileinfo.com/extension/cr2)
|
||||
- [`cr2`](https://fileinfo.com/extension/cr2) - Canon Raw image file (v2)
|
||||
- [`orf`](https://en.wikipedia.org/wiki/ORF_format) - Olympus Raw image file
|
||||
- [`arw`](https://en.wikipedia.org/wiki/Raw_image_format#ARW) - Sony Alpha Raw image file
|
||||
- [`dng`](https://en.wikipedia.org/wiki/Digital_Negative) - Adobe Digital Negative image file
|
||||
- [`nef`](https://www.nikonusa.com/en/learn-and-explore/a/products-and-innovation/nikon-electronic-format-nef.html) - Nikon Electronic Format image file
|
||||
- [`tif`](https://en.wikipedia.org/wiki/Tagged_Image_File_Format)
|
||||
- [`bmp`](https://en.wikipedia.org/wiki/BMP_file_format)
|
||||
- [`jxr`](https://en.wikipedia.org/wiki/JPEG_XR)
|
||||
|
@ -99,7 +146,6 @@ It only needs the first 4100 bytes.
|
|||
- [`7z`](https://en.wikipedia.org/wiki/7z)
|
||||
- [`dmg`](https://en.wikipedia.org/wiki/Apple_Disk_Image)
|
||||
- [`mp4`](https://en.wikipedia.org/wiki/MPEG-4_Part_14#Filename_extensions)
|
||||
- [`m4v`](https://en.wikipedia.org/wiki/M4V)
|
||||
- [`mid`](https://en.wikipedia.org/wiki/MIDI)
|
||||
- [`mkv`](https://en.wikipedia.org/wiki/Matroska)
|
||||
- [`webm`](https://en.wikipedia.org/wiki/WebM)
|
||||
|
@ -132,14 +178,14 @@ It only needs the first 4100 bytes.
|
|||
- [`ps`](https://en.wikipedia.org/wiki/Postscript)
|
||||
- [`xz`](https://en.wikipedia.org/wiki/Xz)
|
||||
- [`sqlite`](https://www.sqlite.org/fileformat2.html)
|
||||
- [`nes`](http://fileinfo.com/extension/nes)
|
||||
- [`nes`](https://fileinfo.com/extension/nes)
|
||||
- [`crx`](https://developer.chrome.com/extensions/crx)
|
||||
- [`xpi`](https://en.wikipedia.org/wiki/XPInstall)
|
||||
- [`cab`](https://en.wikipedia.org/wiki/Cabinet_(file_format))
|
||||
- [`deb`](https://en.wikipedia.org/wiki/Deb_(file_format))
|
||||
- [`ar`](https://en.wikipedia.org/wiki/Ar_(Unix))
|
||||
- [`rpm`](http://fileinfo.com/extension/rpm)
|
||||
- [`Z`](http://fileinfo.com/extension/z)
|
||||
- [`rpm`](https://fileinfo.com/extension/rpm)
|
||||
- [`Z`](https://fileinfo.com/extension/z)
|
||||
- [`lz`](https://en.wikipedia.org/wiki/Lzip)
|
||||
- [`msi`](https://en.wikipedia.org/wiki/Windows_Installer)
|
||||
- [`mxf`](https://en.wikipedia.org/wiki/Material_Exchange_Format)
|
||||
|
@ -150,7 +196,6 @@ It only needs the first 4100 bytes.
|
|||
- [`docx`](https://en.wikipedia.org/wiki/Office_Open_XML)
|
||||
- [`pptx`](https://en.wikipedia.org/wiki/Office_Open_XML)
|
||||
- [`xlsx`](https://en.wikipedia.org/wiki/Office_Open_XML)
|
||||
- [`3gp`](https://en.wikipedia.org/wiki/3GP_and_3G2)
|
||||
- [`jp2`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
|
||||
- [`jpm`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
|
||||
- [`jpx`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
|
||||
|
@ -160,14 +205,38 @@ It only needs the first 4100 bytes.
|
|||
- [`ods`](https://en.wikipedia.org/wiki/OpenDocument) - OpenDocument for spreadsheets
|
||||
- [`odp`](https://en.wikipedia.org/wiki/OpenDocument) - OpenDocument for presentations
|
||||
- [`xml`](https://en.wikipedia.org/wiki/XML)
|
||||
- [`heic`](http://nokiatech.github.io/heif/technical.html)
|
||||
- [`heic`](https://nokiatech.github.io/heif/technical.html)
|
||||
- [`cur`](https://en.wikipedia.org/wiki/ICO_(file_format))
|
||||
- [`ktx`](https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/)
|
||||
- [`ape`](https://en.wikipedia.org/wiki/Monkey%27s_Audio) - Monkey's Audio
|
||||
- [`wv`](https://en.wikipedia.org/wiki/WavPack) - WavPack
|
||||
- [`asf`](https://en.wikipedia.org/wiki/Advanced_Systems_Format) - Advanced Systems Format
|
||||
- [`wma`](https://en.wikipedia.org/wiki/Windows_Media_Audio) - Windows Media Audio
|
||||
- [`wmv`](https://en.wikipedia.org/wiki/Windows_Media_Video) - Windows Media Video
|
||||
- [`dcm`](https://en.wikipedia.org/wiki/DICOM#Data_format) - DICOM Image File
|
||||
- [`mpc`](https://en.wikipedia.org/wiki/Musepack) - Musepack (SV7 & SV8)
|
||||
- [`ics`](https://en.wikipedia.org/wiki/ICalendar#Data_format) - iCalendar
|
||||
- [`glb`](https://github.com/KhronosGroup/glTF) - GL Transmission Format
|
||||
- [`pcap`](https://wiki.wireshark.org/Development/LibpcapFileFormat) - Libpcap File Format
|
||||
- [`dsf`](https://dsd-guide.com/sites/default/files/white-papers/DSFFileFormatSpec_E.pdf) - Sony DSD Stream File (DSF)
|
||||
- [`lnk`](https://en.wikipedia.org/wiki/Shortcut_%28computing%29#Microsoft_Windows) - Microsoft Windows file shortcut
|
||||
- [`alias`](https://en.wikipedia.org/wiki/Alias_%28Mac_OS%29) - macOS Alias file
|
||||
- [`voc`](https://wiki.multimedia.cx/index.php/Creative_Voice) - Creative Voice File
|
||||
- [`ac3`](https://www.atsc.org/standard/a522012-digital-audio-compression-ac-3-e-ac-3-standard-12172012/) - ATSC A/52 Audio File
|
||||
- [`3gp`](https://en.wikipedia.org/wiki/3GP_and_3G2#3GP) - Multimedia container format defined by the Third Generation Partnership Project (3GPP) for 3G UMTS multimedia services
|
||||
- [`3g2`](https://en.wikipedia.org/wiki/3GP_and_3G2#3G2) - Multimedia container format defined by the 3GPP2 for 3G CDMA2000 multimedia services
|
||||
- [`m4v`](https://en.wikipedia.org/wiki/M4V) - MPEG-4 Visual bitstreams
|
||||
- [`m4p`](https://en.wikipedia.org/wiki/MPEG-4_Part_14#Filename_extensions) - MPEG-4 files with audio streams encrypted by FairPlay Digital Rights Management as were sold through the iTunes Store
|
||||
- [`m4a`](https://en.wikipedia.org/wiki/M4A) - Audio-only MPEG-4 files
|
||||
- [`m4b`](https://en.wikipedia.org/wiki/M4B) - Audiobook and podcast MPEG-4 files, which also contain metadata including chapter markers, images, and hyperlinks
|
||||
- [`f4v`](https://en.wikipedia.org/wiki/Flash_Video) - ISO base media file format used by Adobe Flash Player
|
||||
- [`f4p`](https://en.wikipedia.org/wiki/Flash_Video) - ISO base media file format protected by Adobe Access DRM used by Adobe Flash Player
|
||||
- [`f4a`](https://en.wikipedia.org/wiki/Flash_Video) - Audio-only ISO base media file format used by Adobe Flash Player
|
||||
- [`f4b`](https://en.wikipedia.org/wiki/Flash_Video) - Audiobook and podcast ISO base media file format used by Adobe Flash Player
|
||||
|
||||
*SVG isn't included as it requires the whole file to be read, but you can get it [here](https://github.com/sindresorhus/is-svg).*
|
||||
|
||||
*Pull request welcome for additional commonly used file types.*
|
||||
*Pull requests are welcome for additional commonly used file types.*
|
||||
|
||||
|
||||
## Related
|
58
node_modules/file-type/util.js
generated
vendored
Normal file
58
node_modules/file-type/util.js
generated
vendored
Normal file
|
@ -0,0 +1,58 @@
|
|||
'use strict';
|
||||
|
||||
exports.stringToBytes = string => [...string].map(character => character.charCodeAt(0));
|
||||
|
||||
const uint8ArrayUtf8ByteString = (array, start, end) => {
|
||||
return String.fromCharCode(...array.slice(start, end));
|
||||
};
|
||||
|
||||
exports.readUInt64LE = (buffer, offset = 0) => {
|
||||
let n = buffer[offset];
|
||||
let mul = 1;
|
||||
let i = 0;
|
||||
|
||||
while (++i < 8) {
|
||||
mul *= 0x100;
|
||||
n += buffer[offset + i] * mul;
|
||||
}
|
||||
|
||||
return n;
|
||||
};
|
||||
|
||||
exports.tarHeaderChecksumMatches = buffer => { // Does not check if checksum field characters are valid
|
||||
if (buffer.length < 512) { // `tar` header size, cannot compute checksum without it
|
||||
return false;
|
||||
}
|
||||
|
||||
const MASK_8TH_BIT = 0x80;
|
||||
|
||||
let sum = 256; // Intitalize sum, with 256 as sum of 8 spaces in checksum field
|
||||
let signedBitSum = 0; // Initialize signed bit sum
|
||||
|
||||
for (let i = 0; i < 148; i++) {
|
||||
const byte = buffer[i];
|
||||
sum += byte;
|
||||
signedBitSum += byte & MASK_8TH_BIT; // Add signed bit to signed bit sum
|
||||
}
|
||||
|
||||
// Skip checksum field
|
||||
|
||||
for (let i = 156; i < 512; i++) {
|
||||
const byte = buffer[i];
|
||||
sum += byte;
|
||||
signedBitSum += byte & MASK_8TH_BIT; // Add signed bit to signed bit sum
|
||||
}
|
||||
|
||||
const readSum = parseInt(uint8ArrayUtf8ByteString(buffer, 148, 154), 8); // Read sum in header
|
||||
|
||||
// Some implementations compute checksum incorrectly using signed bytes
|
||||
return (
|
||||
// Checksum in header equals the sum we calculated
|
||||
readSum === sum ||
|
||||
|
||||
// Checksum in header equals sum we calculated plus signed-to-unsigned delta
|
||||
readSum === (sum - (signedBitSum << 1))
|
||||
);
|
||||
};
|
||||
|
||||
exports.uint8ArrayUtf8ByteString = uint8ArrayUtf8ByteString;
|
30
node_modules/filenamify/index.d.ts
generated
vendored
Normal file
30
node_modules/filenamify/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
export interface Options {
|
||||
/**
|
||||
* String to use as replacement for reserved filename characters.
|
||||
*
|
||||
* Cannot contain: `<` `>` `:` `"` `/` `\` `|` `?` `*`
|
||||
*
|
||||
* @default '!'
|
||||
*/
|
||||
readonly replacement?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Accepts a filename and returns a valid filename.
|
||||
*
|
||||
* @param input - A string to convert to a valid filename.
|
||||
*/
|
||||
export interface Filenamify {
|
||||
(input: string, options?: Options): string;
|
||||
|
||||
/**
|
||||
* Accepts a path and returns the path with a valid filename.
|
||||
*
|
||||
* @param input - A string to convert to a valid path with a filename.
|
||||
*/
|
||||
path(input: string, options?: Options): string;
|
||||
}
|
||||
|
||||
declare const filenamify: Filenamify;
|
||||
|
||||
export default filenamify;
|
13
node_modules/filenamify/index.js
generated
vendored
13
node_modules/filenamify/index.js
generated
vendored
|
@ -10,13 +10,11 @@ const MAX_FILENAME_LENGTH = 100;
|
|||
const reControlChars = /[\u0000-\u001f\u0080-\u009f]/g; // eslint-disable-line no-control-regex
|
||||
const reRelativePath = /^\.+/;
|
||||
|
||||
const fn = (string, options) => {
|
||||
const filenamify = (string, options = {}) => {
|
||||
if (typeof string !== 'string') {
|
||||
throw new TypeError('Expected a string');
|
||||
}
|
||||
|
||||
options = options || {};
|
||||
|
||||
const replacement = options.replacement === undefined ? '!' : options.replacement;
|
||||
|
||||
if (filenameReservedRegex().test(replacement) && reControlChars.test(replacement)) {
|
||||
|
@ -38,9 +36,10 @@ const fn = (string, options) => {
|
|||
return string;
|
||||
};
|
||||
|
||||
fn.path = (pth, options) => {
|
||||
pth = path.resolve(pth);
|
||||
return path.join(path.dirname(pth), fn(path.basename(pth), options));
|
||||
filenamify.path = (filePath, options) => {
|
||||
filePath = path.resolve(filePath);
|
||||
return path.join(path.dirname(filePath), filenamify(path.basename(filePath), options));
|
||||
};
|
||||
|
||||
module.exports = fn;
|
||||
module.exports = filenamify;
|
||||
module.exports.default = filenamify;
|
||||
|
|
32
node_modules/filenamify/package.json
generated
vendored
32
node_modules/filenamify/package.json
generated
vendored
|
@ -1,31 +1,31 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"filenamify@2.1.0",
|
||||
"filenamify@3.0.0",
|
||||
"/home/runner/work/ghaction-upx/ghaction-upx"
|
||||
]
|
||||
],
|
||||
"_from": "filenamify@2.1.0",
|
||||
"_id": "filenamify@2.1.0",
|
||||
"_from": "filenamify@3.0.0",
|
||||
"_id": "filenamify@3.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-ICw7NTT6RsDp2rnYKVd8Fu4cr6ITzGy3+u4vUujPkabyaz+03F24NWEX7fs5fp+kBonlaqPH8fAO2NM+SXt/JA==",
|
||||
"_integrity": "sha512-5EFZ//MsvJgXjBAFJ+Bh2YaCTRF/VP1YOmGrgt+KJ4SFRLjI87EIdwLLuT6wQX0I4F9W41xutobzczjsOKlI/g==",
|
||||
"_location": "/filenamify",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "filenamify@2.1.0",
|
||||
"raw": "filenamify@3.0.0",
|
||||
"name": "filenamify",
|
||||
"escapedName": "filenamify",
|
||||
"rawSpec": "2.1.0",
|
||||
"rawSpec": "3.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "2.1.0"
|
||||
"fetchSpec": "3.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/download"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/filenamify/-/filenamify-2.1.0.tgz",
|
||||
"_spec": "2.1.0",
|
||||
"_resolved": "https://registry.npmjs.org/filenamify/-/filenamify-3.0.0.tgz",
|
||||
"_spec": "3.0.0",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
|
@ -42,14 +42,16 @@
|
|||
},
|
||||
"description": "Convert a string to a valid safe filename",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
"ava": "^1.3.1",
|
||||
"tsd-check": "^0.3.0",
|
||||
"xo": "^0.24.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
"node": ">=6"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/filenamify#readme",
|
||||
"keywords": [
|
||||
|
@ -72,7 +74,7 @@
|
|||
"url": "git+https://github.com/sindresorhus/filenamify.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
"test": "xo && ava && tsd-check"
|
||||
},
|
||||
"version": "2.1.0"
|
||||
"version": "3.0.0"
|
||||
}
|
||||
|
|
5
node_modules/filenamify/readme.md
generated
vendored
5
node_modules/filenamify/readme.md
generated
vendored
|
@ -39,8 +39,12 @@ Accepts a path and returns the path with a valid filename.
|
|||
|
||||
Type: `string`
|
||||
|
||||
A string to convert to a valid filename.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `Object`
|
||||
|
||||
##### replacement
|
||||
|
||||
Type: `string`<br>
|
||||
|
@ -53,6 +57,7 @@ Cannot contain: `<` `>` `:` `"` `/` `\` `|` `?` `*`
|
|||
|
||||
## Related
|
||||
|
||||
- [filenamify-cli](https://github.com/sindresorhus/filenamify-cli) - CLI for this module
|
||||
- [filenamify-url](https://github.com/sindresorhus/filenamify-url) - Convert a URL to a valid filename
|
||||
- [valid-filename](https://github.com/sindresorhus/valid-filename) - Check if a string is a valid filename
|
||||
- [unused-filename](https://github.com/sindresorhus/unused-filename) - Get a unused filename by appending a number if it exists
|
||||
|
|
13
node_modules/get-proxy/index.js
generated
vendored
13
node_modules/get-proxy/index.js
generated
vendored
|
@ -1,13 +0,0 @@
|
|||
'use strict';
|
||||
const npmConf = require('npm-conf')();
|
||||
|
||||
module.exports = () => {
|
||||
return process.env.HTTPS_PROXY ||
|
||||
process.env.https_proxy ||
|
||||
process.env.HTTP_PROXY ||
|
||||
process.env.http_proxy ||
|
||||
npmConf.get('https-proxy') ||
|
||||
npmConf.get('http-proxy') ||
|
||||
npmConf.get('proxy') ||
|
||||
null;
|
||||
};
|
68
node_modules/get-proxy/package.json
generated
vendored
68
node_modules/get-proxy/package.json
generated
vendored
|
@ -1,68 +0,0 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"get-proxy@2.1.0",
|
||||
"/home/runner/work/ghaction-upx/ghaction-upx"
|
||||
]
|
||||
],
|
||||
"_from": "get-proxy@2.1.0",
|
||||
"_id": "get-proxy@2.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-zmZIaQTWnNQb4R4fJUEp/FC51eZsc6EkErspy3xtIYStaq8EB/hDIWipxsal+E8rz0qD7f2sL/NA9Xee4RInJw==",
|
||||
"_location": "/get-proxy",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "get-proxy@2.1.0",
|
||||
"name": "get-proxy",
|
||||
"escapedName": "get-proxy",
|
||||
"rawSpec": "2.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "2.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/caw"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/get-proxy/-/get-proxy-2.1.0.tgz",
|
||||
"_spec": "2.1.0",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx",
|
||||
"author": {
|
||||
"name": "Kevin Mårtensson",
|
||||
"email": "kevinmartensson@gmail.com",
|
||||
"url": "https://github.com/kevva"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/kevva/get-proxy/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"npm-conf": "^1.1.0"
|
||||
},
|
||||
"description": "Get configured proxy",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/kevva/get-proxy#readme",
|
||||
"keywords": [
|
||||
"env",
|
||||
"get",
|
||||
"proxy"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "get-proxy",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/kevva/get-proxy.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "2.1.0"
|
||||
}
|
25
node_modules/get-proxy/readme.md
generated
vendored
25
node_modules/get-proxy/readme.md
generated
vendored
|
@ -1,25 +0,0 @@
|
|||
# get-proxy [![Build Status](https://travis-ci.org/kevva/get-proxy.svg?branch=master)](http://travis-ci.org/kevva/get-proxy)
|
||||
|
||||
> Get configured proxy
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install get-proxy
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const getProxy = require('get-proxy');
|
||||
|
||||
getProxy();
|
||||
//=> 'http://192.168.0.1:8080'
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Kevin Mårtensson](https://github.com/kevva)
|
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'
|
||||
});
|
||||
}
|
||||
})()
|
||||
```
|
||||
|
||||
|
||||
|
|
51
node_modules/got/node_modules/get-stream/buffer-stream.js
generated
vendored
Normal file
51
node_modules/got/node_modules/get-stream/buffer-stream.js
generated
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
'use strict';
|
||||
const PassThrough = require('stream').PassThrough;
|
||||
|
||||
module.exports = opts => {
|
||||
opts = Object.assign({}, opts);
|
||||
|
||||
const array = opts.array;
|
||||
let encoding = opts.encoding;
|
||||
const buffer = encoding === 'buffer';
|
||||
let objectMode = false;
|
||||
|
||||
if (array) {
|
||||
objectMode = !(encoding || buffer);
|
||||
} else {
|
||||
encoding = encoding || 'utf8';
|
||||
}
|
||||
|
||||
if (buffer) {
|
||||
encoding = null;
|
||||
}
|
||||
|
||||
let len = 0;
|
||||
const ret = [];
|
||||
const stream = new PassThrough({objectMode});
|
||||
|
||||
if (encoding) {
|
||||
stream.setEncoding(encoding);
|
||||
}
|
||||
|
||||
stream.on('data', chunk => {
|
||||
ret.push(chunk);
|
||||
|
||||
if (objectMode) {
|
||||
len = ret.length;
|
||||
} else {
|
||||
len += chunk.length;
|
||||
}
|
||||
});
|
||||
|
||||
stream.getBufferedValue = () => {
|
||||
if (array) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
return buffer ? Buffer.concat(ret, len) : ret.join('');
|
||||
};
|
||||
|
||||
stream.getBufferedLength = () => len;
|
||||
|
||||
return stream;
|
||||
};
|
51
node_modules/got/node_modules/get-stream/index.js
generated
vendored
Normal file
51
node_modules/got/node_modules/get-stream/index.js
generated
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
'use strict';
|
||||
const bufferStream = require('./buffer-stream');
|
||||
|
||||
function getStream(inputStream, opts) {
|
||||
if (!inputStream) {
|
||||
return Promise.reject(new Error('Expected a stream'));
|
||||
}
|
||||
|
||||
opts = Object.assign({maxBuffer: Infinity}, opts);
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
reject(err);
|
||||
};
|
||||
|
||||
stream = bufferStream(opts);
|
||||
inputStream.once('error', error);
|
||||
inputStream.pipe(stream);
|
||||
|
||||
stream.on('data', () => {
|
||||
if (stream.getBufferedLength() > maxBuffer) {
|
||||
reject(new Error('maxBuffer exceeded'));
|
||||
}
|
||||
});
|
||||
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());
|
||||
}
|
||||
|
||||
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}));
|
83
node_modules/got/node_modules/get-stream/package.json
generated
vendored
Normal file
83
node_modules/got/node_modules/get-stream/package.json
generated
vendored
Normal file
|
@ -0,0 +1,83 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"get-stream@3.0.0",
|
||||
"/home/runner/work/ghaction-upx/ghaction-upx"
|
||||
]
|
||||
],
|
||||
"_from": "get-stream@3.0.0",
|
||||
"_id": "get-stream@3.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=",
|
||||
"_location": "/got/get-stream",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "get-stream@3.0.0",
|
||||
"name": "get-stream",
|
||||
"escapedName": "get-stream",
|
||||
"rawSpec": "3.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "3.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/got"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
|
||||
"_spec": "3.0.0",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/get-stream/issues"
|
||||
},
|
||||
"description": "Get a stream as a string, buffer, or array",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"into-stream": "^3.0.0",
|
||||
"xo": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"buffer-stream.js"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/get-stream#readme",
|
||||
"keywords": [
|
||||
"get",
|
||||
"stream",
|
||||
"promise",
|
||||
"concat",
|
||||
"string",
|
||||
"str",
|
||||
"text",
|
||||
"buffer",
|
||||
"read",
|
||||
"data",
|
||||
"consume",
|
||||
"readable",
|
||||
"readablestream",
|
||||
"array",
|
||||
"object",
|
||||
"obj"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "get-stream",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/get-stream.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "3.0.0",
|
||||
"xo": {
|
||||
"esnext": true
|
||||
}
|
||||
}
|
117
node_modules/got/node_modules/get-stream/readme.md
generated
vendored
Normal file
117
node_modules/got/node_modules/get-stream/readme.md
generated
vendored
Normal file
|
@ -0,0 +1,117 @@
|
|||
# get-stream [![Build Status](https://travis-ci.org/sindresorhus/get-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/get-stream)
|
||||
|
||||
> Get a stream as a string, buffer, or array
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save get-stream
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const fs = require('fs');
|
||||
const getStream = require('get-stream');
|
||||
const stream = fs.createReadStream('unicorn.txt');
|
||||
|
||||
getStream(stream).then(str => {
|
||||
console.log(str);
|
||||
/*
|
||||
,,))))))));,
|
||||
__)))))))))))))),
|
||||
\|/ -\(((((''''((((((((.
|
||||
-*-==//////(('' . `)))))),
|
||||
/|\ ))| o ;-. '((((( ,(,
|
||||
( `| / ) ;))))' ,_))^;(~
|
||||
| | | ,))((((_ _____------~~~-. %,;(;(>';'~
|
||||
o_); ; )))(((` ~---~ `:: \ %%~~)(v;(`('~
|
||||
; ''''```` `: `:::|\,__,%% );`'; ~
|
||||
| _ ) / `:|`----' `-'
|
||||
______/\/~ | / /
|
||||
/~;;.____/;;' / ___--,-( `;;;/
|
||||
/ // _;______;'------~~~~~ /;;/\ /
|
||||
// | | / ; \;;,\
|
||||
(<_ | ; /',/-----' _>
|
||||
\_| ||_ //~;~~~~~~~~~
|
||||
`\_| (,~~
|
||||
\~\
|
||||
~~
|
||||
*/
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
The methods returns a promise that resolves when the `end` event fires on the stream, indicating that there is no more data to be read. The stream is switched to flowing mode.
|
||||
|
||||
### getStream(stream, [options])
|
||||
|
||||
Get the `stream` as a string.
|
||||
|
||||
#### options
|
||||
|
||||
##### encoding
|
||||
|
||||
Type: `string`<br>
|
||||
Default: `utf8`
|
||||
|
||||
[Encoding](https://nodejs.org/api/buffer.html#buffer_buffer) of the incoming stream.
|
||||
|
||||
##### maxBuffer
|
||||
|
||||
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.
|
||||
|
||||
### getStream.buffer(stream, [options])
|
||||
|
||||
Get the `stream` as a buffer.
|
||||
|
||||
It honors the `maxBuffer` option as above, but it refers to byte length rather than string length.
|
||||
|
||||
### getStream.array(stream, [options])
|
||||
|
||||
Get the `stream` as an array of values.
|
||||
|
||||
It honors both the `maxBuffer` and `encoding` options. The behavior changes slightly based on the encoding chosen:
|
||||
|
||||
- When `encoding` is unset, it assumes an [object mode stream](https://nodesource.com/blog/understanding-object-streams/) and collects values emitted from `stream` unmodified. In this case `maxBuffer` refers to the number of items in the array (not the sum of their sizes).
|
||||
|
||||
- When `encoding` is set to `buffer`, it collects an array of buffers. `maxBuffer` refers to the summed byte lengths of every buffer in the array.
|
||||
|
||||
- When `encoding` is set to anything else, it collects an array of strings. `maxBuffer` refers to the summed character lengths of every string in the array.
|
||||
|
||||
|
||||
## Errors
|
||||
|
||||
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);
|
||||
//=> 'unicorn'
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## FAQ
|
||||
|
||||
### How is this different from [`concat-stream`](https://github.com/maxogden/concat-stream)?
|
||||
|
||||
This module accepts a stream instead of being one and returns a promise instead of using a callback. The API is simpler and it only supports returning a string, buffer, or array. It doesn't have a fragile type inference. You explicitly choose what you want. And it doesn't depend on the huge `readable-stream` package.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [get-stdin](https://github.com/sindresorhus/get-stdin) - Get stdin as a string or buffer
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
84
node_modules/got/node_modules/pify/index.js
generated
vendored
Normal file
84
node_modules/got/node_modules/pify/index.js
generated
vendored
Normal file
|
@ -0,0 +1,84 @@
|
|||
'use strict';
|
||||
|
||||
const processFn = (fn, opts) => function () {
|
||||
const P = opts.promiseModule;
|
||||
const args = new Array(arguments.length);
|
||||
|
||||
for (let i = 0; i < arguments.length; i++) {
|
||||
args[i] = arguments[i];
|
||||
}
|
||||
|
||||
return new P((resolve, reject) => {
|
||||
if (opts.errorFirst) {
|
||||
args.push(function (err, result) {
|
||||
if (opts.multiArgs) {
|
||||
const results = new Array(arguments.length - 1);
|
||||
|
||||
for (let i = 1; i < arguments.length; i++) {
|
||||
results[i - 1] = arguments[i];
|
||||
}
|
||||
|
||||
if (err) {
|
||||
results.unshift(err);
|
||||
reject(results);
|
||||
} else {
|
||||
resolve(results);
|
||||
}
|
||||
} else if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
resolve(result);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
args.push(function (result) {
|
||||
if (opts.multiArgs) {
|
||||
const results = new Array(arguments.length - 1);
|
||||
|
||||
for (let i = 0; i < arguments.length; i++) {
|
||||
results[i] = arguments[i];
|
||||
}
|
||||
|
||||
resolve(results);
|
||||
} else {
|
||||
resolve(result);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
fn.apply(this, args);
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = (obj, opts) => {
|
||||
opts = Object.assign({
|
||||
exclude: [/.+(Sync|Stream)$/],
|
||||
errorFirst: true,
|
||||
promiseModule: Promise
|
||||
}, opts);
|
||||
|
||||
const filter = key => {
|
||||
const match = pattern => typeof pattern === 'string' ? key === pattern : pattern.test(key);
|
||||
return opts.include ? opts.include.some(match) : !opts.exclude.some(match);
|
||||
};
|
||||
|
||||
let ret;
|
||||
if (typeof obj === 'function') {
|
||||
ret = function () {
|
||||
if (opts.excludeMain) {
|
||||
return obj.apply(this, arguments);
|
||||
}
|
||||
|
||||
return processFn(obj, opts).apply(this, arguments);
|
||||
};
|
||||
} else {
|
||||
ret = Object.create(Object.getPrototypeOf(obj));
|
||||
}
|
||||
|
||||
for (const key in obj) { // eslint-disable-line guard-for-in
|
||||
const x = obj[key];
|
||||
ret[key] = typeof x === 'function' && filter(key) ? processFn(x, opts) : x;
|
||||
}
|
||||
|
||||
return ret;
|
||||
};
|
2
node_modules/npm-conf/license → node_modules/got/node_modules/pify/license
generated
vendored
2
node_modules/npm-conf/license → node_modules/got/node_modules/pify/license
generated
vendored
|
@ -1,6 +1,6 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Kevin Mårtensson <kevinmartensson@gmail.com> (github.com/kevva)
|
||||
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:
|
||||
|
86
node_modules/got/node_modules/pify/package.json
generated
vendored
Normal file
86
node_modules/got/node_modules/pify/package.json
generated
vendored
Normal file
|
@ -0,0 +1,86 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"pify@3.0.0",
|
||||
"/home/runner/work/ghaction-upx/ghaction-upx"
|
||||
]
|
||||
],
|
||||
"_from": "pify@3.0.0",
|
||||
"_id": "pify@3.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
|
||||
"_location": "/got/pify",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "pify@3.0.0",
|
||||
"name": "pify",
|
||||
"escapedName": "pify",
|
||||
"rawSpec": "3.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "3.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/got"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
|
||||
"_spec": "3.0.0",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/pify/issues"
|
||||
},
|
||||
"description": "Promisify a callback-style function",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"pinkie-promise": "^2.0.0",
|
||||
"v8-natives": "^1.0.0",
|
||||
"xo": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/pify#readme",
|
||||
"keywords": [
|
||||
"promise",
|
||||
"promises",
|
||||
"promisify",
|
||||
"all",
|
||||
"denodify",
|
||||
"denodeify",
|
||||
"callback",
|
||||
"cb",
|
||||
"node",
|
||||
"then",
|
||||
"thenify",
|
||||
"convert",
|
||||
"transform",
|
||||
"wrap",
|
||||
"wrapper",
|
||||
"bind",
|
||||
"to",
|
||||
"async",
|
||||
"await",
|
||||
"es2015",
|
||||
"bluebird"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "pify",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/pify.git"
|
||||
},
|
||||
"scripts": {
|
||||
"optimization-test": "node --allow-natives-syntax optimization-test.js",
|
||||
"test": "xo && ava && npm run optimization-test"
|
||||
},
|
||||
"version": "3.0.0"
|
||||
}
|
131
node_modules/got/node_modules/pify/readme.md
generated
vendored
Normal file
131
node_modules/got/node_modules/pify/readme.md
generated
vendored
Normal file
|
@ -0,0 +1,131 @@
|
|||
# pify [![Build Status](https://travis-ci.org/sindresorhus/pify.svg?branch=master)](https://travis-ci.org/sindresorhus/pify)
|
||||
|
||||
> Promisify a callback-style function
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save pify
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const fs = require('fs');
|
||||
const pify = require('pify');
|
||||
|
||||
// Promisify a single function
|
||||
pify(fs.readFile)('package.json', 'utf8').then(data => {
|
||||
console.log(JSON.parse(data).name);
|
||||
//=> 'pify'
|
||||
});
|
||||
|
||||
// Promisify all methods in a module
|
||||
pify(fs).readFile('package.json', 'utf8').then(data => {
|
||||
console.log(JSON.parse(data).name);
|
||||
//=> 'pify'
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### pify(input, [options])
|
||||
|
||||
Returns a `Promise` wrapped version of the supplied function or module.
|
||||
|
||||
#### input
|
||||
|
||||
Type: `Function` `Object`
|
||||
|
||||
Callback-style function or module whose methods you want to promisify.
|
||||
|
||||
#### options
|
||||
|
||||
##### multiArgs
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `false`
|
||||
|
||||
By default, the promisified function will only return the second argument from the callback, which works fine for most APIs. This option can be useful for modules like `request` that return multiple arguments. Turning this on will make it return an array of all arguments from the callback, excluding the error argument, instead of just the second argument. This also applies to rejections, where it returns an array of all the callback arguments, including the error.
|
||||
|
||||
```js
|
||||
const request = require('request');
|
||||
const pify = require('pify');
|
||||
|
||||
pify(request, {multiArgs: true})('https://sindresorhus.com').then(result => {
|
||||
const [httpResponse, body] = result;
|
||||
});
|
||||
```
|
||||
|
||||
##### include
|
||||
|
||||
Type: `string[]` `RegExp[]`
|
||||
|
||||
Methods in a module to promisify. Remaining methods will be left untouched.
|
||||
|
||||
##### exclude
|
||||
|
||||
Type: `string[]` `RegExp[]`<br>
|
||||
Default: `[/.+(Sync|Stream)$/]`
|
||||
|
||||
Methods in a module **not** to promisify. Methods with names ending with `'Sync'` are excluded by default.
|
||||
|
||||
##### excludeMain
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `false`
|
||||
|
||||
If given module is a function itself, it will be promisified. Turn this option on if you want to promisify only methods of the module.
|
||||
|
||||
```js
|
||||
const pify = require('pify');
|
||||
|
||||
function fn() {
|
||||
return true;
|
||||
}
|
||||
|
||||
fn.method = (data, callback) => {
|
||||
setImmediate(() => {
|
||||
callback(null, data);
|
||||
});
|
||||
};
|
||||
|
||||
// Promisify methods but not `fn()`
|
||||
const promiseFn = pify(fn, {excludeMain: true});
|
||||
|
||||
if (promiseFn()) {
|
||||
promiseFn.method('hi').then(data => {
|
||||
console.log(data);
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
##### errorFirst
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
Whether the callback has an error as the first argument. You'll want to set this to `false` if you're dealing with an API that doesn't have an error as the first argument, like `fs.exists()`, some browser APIs, Chrome Extension APIs, etc.
|
||||
|
||||
##### promiseModule
|
||||
|
||||
Type: `Function`
|
||||
|
||||
Custom promise module to use instead of the native one.
|
||||
|
||||
Check out [`pinkie-promise`](https://github.com/floatdrop/pinkie-promise) if you need a tiny promise polyfill.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [p-event](https://github.com/sindresorhus/p-event) - Promisify an event by waiting for it to be emitted
|
||||
- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently
|
||||
- [More…](https://github.com/sindresorhus/promise-fun)
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
10
node_modules/graceful-fs/graceful-fs.js
generated
vendored
10
node_modules/graceful-fs/graceful-fs.js
generated
vendored
|
@ -234,22 +234,24 @@ function patch (fs) {
|
|||
})
|
||||
|
||||
// legacy names
|
||||
var FileReadStream = ReadStream
|
||||
Object.defineProperty(fs, 'FileReadStream', {
|
||||
get: function () {
|
||||
return ReadStream
|
||||
return FileReadStream
|
||||
},
|
||||
set: function (val) {
|
||||
ReadStream = val
|
||||
FileReadStream = val
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
})
|
||||
var FileWriteStream = WriteStream
|
||||
Object.defineProperty(fs, 'FileWriteStream', {
|
||||
get: function () {
|
||||
return WriteStream
|
||||
return FileWriteStream
|
||||
},
|
||||
set: function (val) {
|
||||
WriteStream = val
|
||||
FileWriteStream = val
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
|
|
20
node_modules/graceful-fs/package.json
generated
vendored
20
node_modules/graceful-fs/package.json
generated
vendored
|
@ -1,31 +1,31 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"graceful-fs@4.2.2",
|
||||
"graceful-fs@4.2.3",
|
||||
"/home/runner/work/ghaction-upx/ghaction-upx"
|
||||
]
|
||||
],
|
||||
"_from": "graceful-fs@4.2.2",
|
||||
"_id": "graceful-fs@4.2.2",
|
||||
"_from": "graceful-fs@4.2.3",
|
||||
"_id": "graceful-fs@4.2.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==",
|
||||
"_integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==",
|
||||
"_location": "/graceful-fs",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "graceful-fs@4.2.2",
|
||||
"raw": "graceful-fs@4.2.3",
|
||||
"name": "graceful-fs",
|
||||
"escapedName": "graceful-fs",
|
||||
"rawSpec": "4.2.2",
|
||||
"rawSpec": "4.2.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "4.2.2"
|
||||
"fetchSpec": "4.2.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/decompress"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz",
|
||||
"_spec": "4.2.2",
|
||||
"_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz",
|
||||
"_spec": "4.2.3",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx",
|
||||
"bugs": {
|
||||
"url": "https://github.com/isaacs/node-graceful-fs/issues"
|
||||
|
@ -78,5 +78,5 @@
|
|||
"preversion": "npm test",
|
||||
"test": "node test.js | tap -"
|
||||
},
|
||||
"version": "4.2.2"
|
||||
"version": "4.2.3"
|
||||
}
|
||||
|
|
102
node_modules/ini/README.md
generated
vendored
102
node_modules/ini/README.md
generated
vendored
|
@ -1,102 +0,0 @@
|
|||
An ini format parser and serializer for node.
|
||||
|
||||
Sections are treated as nested objects. Items before the first
|
||||
heading are saved on the object directly.
|
||||
|
||||
## Usage
|
||||
|
||||
Consider an ini-file `config.ini` that looks like this:
|
||||
|
||||
; this comment is being ignored
|
||||
scope = global
|
||||
|
||||
[database]
|
||||
user = dbuser
|
||||
password = dbpassword
|
||||
database = use_this_database
|
||||
|
||||
[paths.default]
|
||||
datadir = /var/lib/data
|
||||
array[] = first value
|
||||
array[] = second value
|
||||
array[] = third value
|
||||
|
||||
You can read, manipulate and write the ini-file like so:
|
||||
|
||||
var fs = require('fs')
|
||||
, ini = require('ini')
|
||||
|
||||
var config = ini.parse(fs.readFileSync('./config.ini', 'utf-8'))
|
||||
|
||||
config.scope = 'local'
|
||||
config.database.database = 'use_another_database'
|
||||
config.paths.default.tmpdir = '/tmp'
|
||||
delete config.paths.default.datadir
|
||||
config.paths.default.array.push('fourth value')
|
||||
|
||||
fs.writeFileSync('./config_modified.ini', ini.stringify(config, { section: 'section' }))
|
||||
|
||||
This will result in a file called `config_modified.ini` being written
|
||||
to the filesystem with the following content:
|
||||
|
||||
[section]
|
||||
scope=local
|
||||
[section.database]
|
||||
user=dbuser
|
||||
password=dbpassword
|
||||
database=use_another_database
|
||||
[section.paths.default]
|
||||
tmpdir=/tmp
|
||||
array[]=first value
|
||||
array[]=second value
|
||||
array[]=third value
|
||||
array[]=fourth value
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### decode(inistring)
|
||||
|
||||
Decode the ini-style formatted `inistring` into a nested object.
|
||||
|
||||
### parse(inistring)
|
||||
|
||||
Alias for `decode(inistring)`
|
||||
|
||||
### encode(object, [options])
|
||||
|
||||
Encode the object `object` into an ini-style formatted string. If the
|
||||
optional parameter `section` is given, then all top-level properties
|
||||
of the object are put into this section and the `section`-string is
|
||||
prepended to all sub-sections, see the usage example above.
|
||||
|
||||
The `options` object may contain the following:
|
||||
|
||||
* `section` A string which will be the first `section` in the encoded
|
||||
ini data. Defaults to none.
|
||||
* `whitespace` Boolean to specify whether to put whitespace around the
|
||||
`=` character. By default, whitespace is omitted, to be friendly to
|
||||
some persnickety old parsers that don't tolerate it well. But some
|
||||
find that it's more human-readable and pretty with the whitespace.
|
||||
|
||||
For backwards compatibility reasons, if a `string` options is passed
|
||||
in, then it is assumed to be the `section` value.
|
||||
|
||||
### stringify(object, [options])
|
||||
|
||||
Alias for `encode(object, [options])`
|
||||
|
||||
### safe(val)
|
||||
|
||||
Escapes the string `val` such that it is safe to be used as a key or
|
||||
value in an ini-file. Basically escapes quotes. For example
|
||||
|
||||
ini.safe('"unsafe string"')
|
||||
|
||||
would result in
|
||||
|
||||
"\"unsafe string\""
|
||||
|
||||
### unsafe(val)
|
||||
|
||||
Unescapes the string `val`
|
194
node_modules/ini/ini.js
generated
vendored
194
node_modules/ini/ini.js
generated
vendored
|
@ -1,194 +0,0 @@
|
|||
exports.parse = exports.decode = decode
|
||||
|
||||
exports.stringify = exports.encode = encode
|
||||
|
||||
exports.safe = safe
|
||||
exports.unsafe = unsafe
|
||||
|
||||
var eol = typeof process !== 'undefined' &&
|
||||
process.platform === 'win32' ? '\r\n' : '\n'
|
||||
|
||||
function encode (obj, opt) {
|
||||
var children = []
|
||||
var out = ''
|
||||
|
||||
if (typeof opt === 'string') {
|
||||
opt = {
|
||||
section: opt,
|
||||
whitespace: false
|
||||
}
|
||||
} else {
|
||||
opt = opt || {}
|
||||
opt.whitespace = opt.whitespace === true
|
||||
}
|
||||
|
||||
var separator = opt.whitespace ? ' = ' : '='
|
||||
|
||||
Object.keys(obj).forEach(function (k, _, __) {
|
||||
var val = obj[k]
|
||||
if (val && Array.isArray(val)) {
|
||||
val.forEach(function (item) {
|
||||
out += safe(k + '[]') + separator + safe(item) + '\n'
|
||||
})
|
||||
} else if (val && typeof val === 'object') {
|
||||
children.push(k)
|
||||
} else {
|
||||
out += safe(k) + separator + safe(val) + eol
|
||||
}
|
||||
})
|
||||
|
||||
if (opt.section && out.length) {
|
||||
out = '[' + safe(opt.section) + ']' + eol + out
|
||||
}
|
||||
|
||||
children.forEach(function (k, _, __) {
|
||||
var nk = dotSplit(k).join('\\.')
|
||||
var section = (opt.section ? opt.section + '.' : '') + nk
|
||||
var child = encode(obj[k], {
|
||||
section: section,
|
||||
whitespace: opt.whitespace
|
||||
})
|
||||
if (out.length && child.length) {
|
||||
out += eol
|
||||
}
|
||||
out += child
|
||||
})
|
||||
|
||||
return out
|
||||
}
|
||||
|
||||
function dotSplit (str) {
|
||||
return str.replace(/\1/g, '\u0002LITERAL\\1LITERAL\u0002')
|
||||
.replace(/\\\./g, '\u0001')
|
||||
.split(/\./).map(function (part) {
|
||||
return part.replace(/\1/g, '\\.')
|
||||
.replace(/\2LITERAL\\1LITERAL\2/g, '\u0001')
|
||||
})
|
||||
}
|
||||
|
||||
function decode (str) {
|
||||
var out = {}
|
||||
var p = out
|
||||
var section = null
|
||||
// section |key = value
|
||||
var re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i
|
||||
var lines = str.split(/[\r\n]+/g)
|
||||
|
||||
lines.forEach(function (line, _, __) {
|
||||
if (!line || line.match(/^\s*[;#]/)) return
|
||||
var match = line.match(re)
|
||||
if (!match) return
|
||||
if (match[1] !== undefined) {
|
||||
section = unsafe(match[1])
|
||||
p = out[section] = out[section] || {}
|
||||
return
|
||||
}
|
||||
var key = unsafe(match[2])
|
||||
var value = match[3] ? unsafe(match[4]) : true
|
||||
switch (value) {
|
||||
case 'true':
|
||||
case 'false':
|
||||
case 'null': value = JSON.parse(value)
|
||||
}
|
||||
|
||||
// Convert keys with '[]' suffix to an array
|
||||
if (key.length > 2 && key.slice(-2) === '[]') {
|
||||
key = key.substring(0, key.length - 2)
|
||||
if (!p[key]) {
|
||||
p[key] = []
|
||||
} else if (!Array.isArray(p[key])) {
|
||||
p[key] = [p[key]]
|
||||
}
|
||||
}
|
||||
|
||||
// safeguard against resetting a previously defined
|
||||
// array by accidentally forgetting the brackets
|
||||
if (Array.isArray(p[key])) {
|
||||
p[key].push(value)
|
||||
} else {
|
||||
p[key] = value
|
||||
}
|
||||
})
|
||||
|
||||
// {a:{y:1},"a.b":{x:2}} --> {a:{y:1,b:{x:2}}}
|
||||
// use a filter to return the keys that have to be deleted.
|
||||
Object.keys(out).filter(function (k, _, __) {
|
||||
if (!out[k] ||
|
||||
typeof out[k] !== 'object' ||
|
||||
Array.isArray(out[k])) {
|
||||
return false
|
||||
}
|
||||
// see if the parent section is also an object.
|
||||
// if so, add it to that, and mark this one for deletion
|
||||
var parts = dotSplit(k)
|
||||
var p = out
|
||||
var l = parts.pop()
|
||||
var nl = l.replace(/\\\./g, '.')
|
||||
parts.forEach(function (part, _, __) {
|
||||
if (!p[part] || typeof p[part] !== 'object') p[part] = {}
|
||||
p = p[part]
|
||||
})
|
||||
if (p === out && nl === l) {
|
||||
return false
|
||||
}
|
||||
p[nl] = out[k]
|
||||
return true
|
||||
}).forEach(function (del, _, __) {
|
||||
delete out[del]
|
||||
})
|
||||
|
||||
return out
|
||||
}
|
||||
|
||||
function isQuoted (val) {
|
||||
return (val.charAt(0) === '"' && val.slice(-1) === '"') ||
|
||||
(val.charAt(0) === "'" && val.slice(-1) === "'")
|
||||
}
|
||||
|
||||
function safe (val) {
|
||||
return (typeof val !== 'string' ||
|
||||
val.match(/[=\r\n]/) ||
|
||||
val.match(/^\[/) ||
|
||||
(val.length > 1 &&
|
||||
isQuoted(val)) ||
|
||||
val !== val.trim())
|
||||
? JSON.stringify(val)
|
||||
: val.replace(/;/g, '\\;').replace(/#/g, '\\#')
|
||||
}
|
||||
|
||||
function unsafe (val, doUnesc) {
|
||||
val = (val || '').trim()
|
||||
if (isQuoted(val)) {
|
||||
// remove the single quotes before calling JSON.parse
|
||||
if (val.charAt(0) === "'") {
|
||||
val = val.substr(1, val.length - 2)
|
||||
}
|
||||
try { val = JSON.parse(val) } catch (_) {}
|
||||
} else {
|
||||
// walk the val to find the first not-escaped ; character
|
||||
var esc = false
|
||||
var unesc = ''
|
||||
for (var i = 0, l = val.length; i < l; i++) {
|
||||
var c = val.charAt(i)
|
||||
if (esc) {
|
||||
if ('\\;#'.indexOf(c) !== -1) {
|
||||
unesc += c
|
||||
} else {
|
||||
unesc += '\\' + c
|
||||
}
|
||||
esc = false
|
||||
} else if (';#'.indexOf(c) !== -1) {
|
||||
break
|
||||
} else if (c === '\\') {
|
||||
esc = true
|
||||
} else {
|
||||
unesc += c
|
||||
}
|
||||
}
|
||||
if (esc) {
|
||||
unesc += '\\'
|
||||
}
|
||||
return unesc.trim()
|
||||
}
|
||||
return val
|
||||
}
|
66
node_modules/ini/package.json
generated
vendored
66
node_modules/ini/package.json
generated
vendored
|
@ -1,66 +0,0 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"ini@1.3.5",
|
||||
"/home/runner/work/ghaction-upx/ghaction-upx"
|
||||
]
|
||||
],
|
||||
"_from": "ini@1.3.5",
|
||||
"_id": "ini@1.3.5",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==",
|
||||
"_location": "/ini",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "ini@1.3.5",
|
||||
"name": "ini",
|
||||
"escapedName": "ini",
|
||||
"rawSpec": "1.3.5",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.3.5"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/config-chain"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
|
||||
"_spec": "1.3.5",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx",
|
||||
"author": {
|
||||
"name": "Isaac Z. Schlueter",
|
||||
"email": "i@izs.me",
|
||||
"url": "http://blog.izs.me/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/isaacs/ini/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "An ini encoder/decoder for node",
|
||||
"devDependencies": {
|
||||
"standard": "^10.0.3",
|
||||
"tap": "^10.7.3 || 11"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"files": [
|
||||
"ini.js"
|
||||
],
|
||||
"homepage": "https://github.com/isaacs/ini#readme",
|
||||
"license": "ISC",
|
||||
"main": "ini.js",
|
||||
"name": "ini",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/isaacs/ini.git"
|
||||
},
|
||||
"scripts": {
|
||||
"postpublish": "git push origin --all; git push origin --tags",
|
||||
"postversion": "npm publish",
|
||||
"pretest": "standard ini.js",
|
||||
"preversion": "npm test",
|
||||
"test": "tap test/*.js --100 -J"
|
||||
},
|
||||
"version": "1.3.5"
|
||||
}
|
|
@ -9,7 +9,7 @@
|
|||
"_id": "is-stream@1.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=",
|
||||
"_location": "/decompress-targz/is-stream",
|
||||
"_location": "/is-stream",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
|
@ -22,7 +22,10 @@
|
|||
"fetchSpec": "1.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/decompress-targz"
|
||||
"/decompress-tar",
|
||||
"/decompress-tarbz2",
|
||||
"/decompress-targz",
|
||||
"/execa"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
|
||||
"_spec": "1.1.0",
|
1
node_modules/isurl/package.json
generated
vendored
1
node_modules/isurl/package.json
generated
vendored
|
@ -22,7 +22,6 @@
|
|||
"fetchSpec": "1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/caw",
|
||||
"/got"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz",
|
||||
|
|
39
node_modules/make-dir/index.d.ts
generated
vendored
Normal file
39
node_modules/make-dir/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,39 @@
|
|||
/// <reference types="node"/>
|
||||
import * as fs from 'fs';
|
||||
|
||||
export interface Options {
|
||||
/**
|
||||
* Directory [permissions](https://x-team.com/blog/file-system-permissions-umask-node-js/).
|
||||
*
|
||||
* @default 0o777 & (~process.umask())
|
||||
*/
|
||||
readonly mode?: number;
|
||||
|
||||
/**
|
||||
* Use a custom `fs` implementation. For example [`graceful-fs`](https://github.com/isaacs/node-graceful-fs).
|
||||
*
|
||||
* Using a custom `fs` implementation will block the use of the native `recursive` option if `fs.mkdir` or `fs.mkdirSync` is not the native function.
|
||||
*
|
||||
* @default require('fs')
|
||||
*/
|
||||
readonly fs?: typeof fs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a directory and its parents if needed - Think `mkdir -p`.
|
||||
*
|
||||
* @param path - Directory to create.
|
||||
* @returns A `Promise` for the path to the created directory.
|
||||
*/
|
||||
export default function makeDir(
|
||||
path: string,
|
||||
options?: Options
|
||||
): Promise<string>;
|
||||
|
||||
/**
|
||||
* Synchronously make a directory and its parents if needed - Think `mkdir -p`.
|
||||
*
|
||||
* @param path - Directory to create.
|
||||
* @returns The path to the created directory.
|
||||
*/
|
||||
export function sync(path: string, options?: Options): string;
|
100
node_modules/make-dir/index.js
generated
vendored
100
node_modules/make-dir/index.js
generated
vendored
|
@ -2,12 +2,15 @@
|
|||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const pify = require('pify');
|
||||
const semver = require('semver');
|
||||
|
||||
const defaults = {
|
||||
mode: 0o777 & (~process.umask()),
|
||||
fs
|
||||
};
|
||||
|
||||
const useNativeRecursiveOption = semver.satisfies(process.version, '>=10.12.0');
|
||||
|
||||
// https://github.com/nodejs/node/issues/8987
|
||||
// https://github.com/libuv/libuv/pull/1088
|
||||
const checkPath = pth => {
|
||||
|
@ -15,27 +18,56 @@ const checkPath = pth => {
|
|||
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ''));
|
||||
|
||||
if (pathHasInvalidWinCharacters) {
|
||||
const err = new Error(`Path contains invalid characters: ${pth}`);
|
||||
err.code = 'EINVAL';
|
||||
throw err;
|
||||
const error = new Error(`Path contains invalid characters: ${pth}`);
|
||||
error.code = 'EINVAL';
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = (input, opts) => Promise.resolve().then(() => {
|
||||
checkPath(input);
|
||||
opts = Object.assign({}, defaults, opts);
|
||||
const permissionError = pth => {
|
||||
// This replicates the exception of `fs.mkdir` with native the
|
||||
// `recusive` option when run on an invalid drive under Windows.
|
||||
const error = new Error(`operation not permitted, mkdir '${pth}'`);
|
||||
error.code = 'EPERM';
|
||||
error.errno = -4048;
|
||||
error.path = pth;
|
||||
error.syscall = 'mkdir';
|
||||
return error;
|
||||
};
|
||||
|
||||
const mkdir = pify(opts.fs.mkdir);
|
||||
const stat = pify(opts.fs.stat);
|
||||
const makeDir = (input, options) => Promise.resolve().then(() => {
|
||||
checkPath(input);
|
||||
options = Object.assign({}, defaults, options);
|
||||
|
||||
// TODO: Use util.promisify when targeting Node.js 8
|
||||
const mkdir = pify(options.fs.mkdir);
|
||||
const stat = pify(options.fs.stat);
|
||||
|
||||
if (useNativeRecursiveOption && options.fs.mkdir === fs.mkdir) {
|
||||
const pth = path.resolve(input);
|
||||
|
||||
return mkdir(pth, {
|
||||
mode: options.mode,
|
||||
recursive: true
|
||||
}).then(() => pth);
|
||||
}
|
||||
|
||||
const make = pth => {
|
||||
return mkdir(pth, opts.mode)
|
||||
return mkdir(pth, options.mode)
|
||||
.then(() => pth)
|
||||
.catch(err => {
|
||||
if (err.code === 'ENOENT') {
|
||||
if (err.message.includes('null bytes') || path.dirname(pth) === pth) {
|
||||
throw err;
|
||||
.catch(error => {
|
||||
if (error.code === 'EPERM') {
|
||||
throw error;
|
||||
}
|
||||
|
||||
if (error.code === 'ENOENT') {
|
||||
if (path.dirname(pth) === pth) {
|
||||
throw permissionError(pth);
|
||||
}
|
||||
|
||||
if (error.message.includes('null bytes')) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
return make(path.dirname(pth)).then(() => make(pth));
|
||||
|
@ -44,7 +76,7 @@ module.exports = (input, opts) => Promise.resolve().then(() => {
|
|||
return stat(pth)
|
||||
.then(stats => stats.isDirectory() ? pth : Promise.reject())
|
||||
.catch(() => {
|
||||
throw err;
|
||||
throw error;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -52,17 +84,39 @@ module.exports = (input, opts) => Promise.resolve().then(() => {
|
|||
return make(path.resolve(input));
|
||||
});
|
||||
|
||||
module.exports.sync = (input, opts) => {
|
||||
module.exports = makeDir;
|
||||
module.exports.default = makeDir;
|
||||
|
||||
module.exports.sync = (input, options) => {
|
||||
checkPath(input);
|
||||
opts = Object.assign({}, defaults, opts);
|
||||
options = Object.assign({}, defaults, options);
|
||||
|
||||
if (useNativeRecursiveOption && options.fs.mkdirSync === fs.mkdirSync) {
|
||||
const pth = path.resolve(input);
|
||||
|
||||
fs.mkdirSync(pth, {
|
||||
mode: options.mode,
|
||||
recursive: true
|
||||
});
|
||||
|
||||
return pth;
|
||||
}
|
||||
|
||||
const make = pth => {
|
||||
try {
|
||||
opts.fs.mkdirSync(pth, opts.mode);
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT') {
|
||||
if (err.message.includes('null bytes') || path.dirname(pth) === pth) {
|
||||
throw err;
|
||||
options.fs.mkdirSync(pth, options.mode);
|
||||
} catch (error) {
|
||||
if (error.code === 'EPERM') {
|
||||
throw error;
|
||||
}
|
||||
|
||||
if (error.code === 'ENOENT') {
|
||||
if (path.dirname(pth) === pth) {
|
||||
throw permissionError(pth);
|
||||
}
|
||||
|
||||
if (error.message.includes('null bytes')) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
make(path.dirname(pth));
|
||||
|
@ -70,11 +124,11 @@ module.exports.sync = (input, opts) => {
|
|||
}
|
||||
|
||||
try {
|
||||
if (!opts.fs.statSync(pth).isDirectory()) {
|
||||
if (!options.fs.statSync(pth).isDirectory()) {
|
||||
throw new Error('The path is not a directory');
|
||||
}
|
||||
} catch (_) {
|
||||
throw err;
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
1
node_modules/make-dir/node_modules/.bin/semver
generated
vendored
Symbolic link
1
node_modules/make-dir/node_modules/.bin/semver
generated
vendored
Symbolic link
|
@ -0,0 +1 @@
|
|||
../semver/bin/semver
|
39
node_modules/make-dir/node_modules/semver/CHANGELOG.md
generated
vendored
Normal file
39
node_modules/make-dir/node_modules/semver/CHANGELOG.md
generated
vendored
Normal file
|
@ -0,0 +1,39 @@
|
|||
# changes log
|
||||
|
||||
## 5.7
|
||||
|
||||
* Add `minVersion` method
|
||||
|
||||
## 5.6
|
||||
|
||||
* Move boolean `loose` param to an options object, with
|
||||
backwards-compatibility protection.
|
||||
* Add ability to opt out of special prerelease version handling with
|
||||
the `includePrerelease` option flag.
|
||||
|
||||
## 5.5
|
||||
|
||||
* Add version coercion capabilities
|
||||
|
||||
## 5.4
|
||||
|
||||
* Add intersection checking
|
||||
|
||||
## 5.3
|
||||
|
||||
* Add `minSatisfying` method
|
||||
|
||||
## 5.2
|
||||
|
||||
* Add `prerelease(v)` that returns prerelease components
|
||||
|
||||
## 5.1
|
||||
|
||||
* Add Backus-Naur for ranges
|
||||
* Remove excessively cute inspection methods
|
||||
|
||||
## 5.0
|
||||
|
||||
* Remove AMD/Browserified build artifacts
|
||||
* Fix ltr and gtr when using the `*` range
|
||||
* Fix for range `*` with a prerelease identifier
|
0
node_modules/ini/LICENSE → node_modules/make-dir/node_modules/semver/LICENSE
generated
vendored
0
node_modules/ini/LICENSE → node_modules/make-dir/node_modules/semver/LICENSE
generated
vendored
412
node_modules/make-dir/node_modules/semver/README.md
generated
vendored
Normal file
412
node_modules/make-dir/node_modules/semver/README.md
generated
vendored
Normal file
|
@ -0,0 +1,412 @@
|
|||
semver(1) -- The semantic versioner for npm
|
||||
===========================================
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
npm install --save semver
|
||||
````
|
||||
|
||||
## Usage
|
||||
|
||||
As a node module:
|
||||
|
||||
```js
|
||||
const semver = require('semver')
|
||||
|
||||
semver.valid('1.2.3') // '1.2.3'
|
||||
semver.valid('a.b.c') // null
|
||||
semver.clean(' =v1.2.3 ') // '1.2.3'
|
||||
semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
|
||||
semver.gt('1.2.3', '9.8.7') // false
|
||||
semver.lt('1.2.3', '9.8.7') // true
|
||||
semver.minVersion('>=1.0.0') // '1.0.0'
|
||||
semver.valid(semver.coerce('v2')) // '2.0.0'
|
||||
semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
|
||||
```
|
||||
|
||||
As a command-line utility:
|
||||
|
||||
```
|
||||
$ semver -h
|
||||
|
||||
A JavaScript implementation of the https://semver.org/ specification
|
||||
Copyright Isaac Z. Schlueter
|
||||
|
||||
Usage: semver [options] <version> [<version> [...]]
|
||||
Prints valid versions sorted by SemVer precedence
|
||||
|
||||
Options:
|
||||
-r --range <range>
|
||||
Print versions that match the specified range.
|
||||
|
||||
-i --increment [<level>]
|
||||
Increment a version by the specified level. Level can
|
||||
be one of: major, minor, patch, premajor, preminor,
|
||||
prepatch, or prerelease. Default level is 'patch'.
|
||||
Only one version may be specified.
|
||||
|
||||
--preid <identifier>
|
||||
Identifier to be used to prefix premajor, preminor,
|
||||
prepatch or prerelease version increments.
|
||||
|
||||
-l --loose
|
||||
Interpret versions and ranges loosely
|
||||
|
||||
-p --include-prerelease
|
||||
Always include prerelease versions in range matching
|
||||
|
||||
-c --coerce
|
||||
Coerce a string into SemVer if possible
|
||||
(does not imply --loose)
|
||||
|
||||
Program exits successfully if any valid version satisfies
|
||||
all supplied ranges, and prints all satisfying versions.
|
||||
|
||||
If no satisfying versions are found, then exits failure.
|
||||
|
||||
Versions are printed in ascending order, so supplying
|
||||
multiple versions to the utility will just sort them.
|
||||
```
|
||||
|
||||
## Versions
|
||||
|
||||
A "version" is described by the `v2.0.0` specification found at
|
||||
<https://semver.org/>.
|
||||
|
||||
A leading `"="` or `"v"` character is stripped off and ignored.
|
||||
|
||||
## Ranges
|
||||
|
||||
A `version range` is a set of `comparators` which specify versions
|
||||
that satisfy the range.
|
||||
|
||||
A `comparator` is composed of an `operator` and a `version`. The set
|
||||
of primitive `operators` is:
|
||||
|
||||
* `<` Less than
|
||||
* `<=` Less than or equal to
|
||||
* `>` Greater than
|
||||
* `>=` Greater than or equal to
|
||||
* `=` Equal. If no operator is specified, then equality is assumed,
|
||||
so this operator is optional, but MAY be included.
|
||||
|
||||
For example, the comparator `>=1.2.7` would match the versions
|
||||
`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
|
||||
or `1.1.0`.
|
||||
|
||||
Comparators can be joined by whitespace to form a `comparator set`,
|
||||
which is satisfied by the **intersection** of all of the comparators
|
||||
it includes.
|
||||
|
||||
A range is composed of one or more comparator sets, joined by `||`. A
|
||||
version matches a range if and only if every comparator in at least
|
||||
one of the `||`-separated comparator sets is satisfied by the version.
|
||||
|
||||
For example, the range `>=1.2.7 <1.3.0` would match the versions
|
||||
`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
|
||||
or `1.1.0`.
|
||||
|
||||
The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
|
||||
`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.
|
||||
|
||||
### Prerelease Tags
|
||||
|
||||
If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
|
||||
it will only be allowed to satisfy comparator sets if at least one
|
||||
comparator with the same `[major, minor, patch]` tuple also has a
|
||||
prerelease tag.
|
||||
|
||||
For example, the range `>1.2.3-alpha.3` would be allowed to match the
|
||||
version `1.2.3-alpha.7`, but it would *not* be satisfied by
|
||||
`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
|
||||
than" `1.2.3-alpha.3` according to the SemVer sort rules. The version
|
||||
range only accepts prerelease tags on the `1.2.3` version. The
|
||||
version `3.4.5` *would* satisfy the range, because it does not have a
|
||||
prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
|
||||
|
||||
The purpose for this behavior is twofold. First, prerelease versions
|
||||
frequently are updated very quickly, and contain many breaking changes
|
||||
that are (by the author's design) not yet fit for public consumption.
|
||||
Therefore, by default, they are excluded from range matching
|
||||
semantics.
|
||||
|
||||
Second, a user who has opted into using a prerelease version has
|
||||
clearly indicated the intent to use *that specific* set of
|
||||
alpha/beta/rc versions. By including a prerelease tag in the range,
|
||||
the user is indicating that they are aware of the risk. However, it
|
||||
is still not appropriate to assume that they have opted into taking a
|
||||
similar risk on the *next* set of prerelease versions.
|
||||
|
||||
Note that this behavior can be suppressed (treating all prerelease
|
||||
versions as if they were normal versions, for the purpose of range
|
||||
matching) by setting the `includePrerelease` flag on the options
|
||||
object to any
|
||||
[functions](https://github.com/npm/node-semver#functions) that do
|
||||
range matching.
|
||||
|
||||
#### Prerelease Identifiers
|
||||
|
||||
The method `.inc` takes an additional `identifier` string argument that
|
||||
will append the value of the string as a prerelease identifier:
|
||||
|
||||
```javascript
|
||||
semver.inc('1.2.3', 'prerelease', 'beta')
|
||||
// '1.2.4-beta.0'
|
||||
```
|
||||
|
||||
command-line example:
|
||||
|
||||
```bash
|
||||
$ semver 1.2.3 -i prerelease --preid beta
|
||||
1.2.4-beta.0
|
||||
```
|
||||
|
||||
Which then can be used to increment further:
|
||||
|
||||
```bash
|
||||
$ semver 1.2.4-beta.0 -i prerelease
|
||||
1.2.4-beta.1
|
||||
```
|
||||
|
||||
### Advanced Range Syntax
|
||||
|
||||
Advanced range syntax desugars to primitive comparators in
|
||||
deterministic ways.
|
||||
|
||||
Advanced ranges may be combined in the same way as primitive
|
||||
comparators using white space or `||`.
|
||||
|
||||
#### Hyphen Ranges `X.Y.Z - A.B.C`
|
||||
|
||||
Specifies an inclusive set.
|
||||
|
||||
* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
|
||||
|
||||
If a partial version is provided as the first version in the inclusive
|
||||
range, then the missing pieces are replaced with zeroes.
|
||||
|
||||
* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`
|
||||
|
||||
If a partial version is provided as the second version in the
|
||||
inclusive range, then all versions that start with the supplied parts
|
||||
of the tuple are accepted, but nothing that would be greater than the
|
||||
provided tuple parts.
|
||||
|
||||
* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0`
|
||||
* `1.2.3 - 2` := `>=1.2.3 <3.0.0`
|
||||
|
||||
#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
|
||||
|
||||
Any of `X`, `x`, or `*` may be used to "stand in" for one of the
|
||||
numeric values in the `[major, minor, patch]` tuple.
|
||||
|
||||
* `*` := `>=0.0.0` (Any version satisfies)
|
||||
* `1.x` := `>=1.0.0 <2.0.0` (Matching major version)
|
||||
* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions)
|
||||
|
||||
A partial version range is treated as an X-Range, so the special
|
||||
character is in fact optional.
|
||||
|
||||
* `""` (empty string) := `*` := `>=0.0.0`
|
||||
* `1` := `1.x.x` := `>=1.0.0 <2.0.0`
|
||||
* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0`
|
||||
|
||||
#### Tilde Ranges `~1.2.3` `~1.2` `~1`
|
||||
|
||||
Allows patch-level changes if a minor version is specified on the
|
||||
comparator. Allows minor-level changes if not.
|
||||
|
||||
* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0`
|
||||
* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`)
|
||||
* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`)
|
||||
* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0`
|
||||
* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`)
|
||||
* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`)
|
||||
* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in
|
||||
the `1.2.3` version will be allowed, if they are greater than or
|
||||
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
|
||||
`1.2.4-beta.2` would not, because it is a prerelease of a
|
||||
different `[major, minor, patch]` tuple.
|
||||
|
||||
#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
|
||||
|
||||
Allows changes that do not modify the left-most non-zero digit in the
|
||||
`[major, minor, patch]` tuple. In other words, this allows patch and
|
||||
minor updates for versions `1.0.0` and above, patch updates for
|
||||
versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
|
||||
|
||||
Many authors treat a `0.x` version as if the `x` were the major
|
||||
"breaking-change" indicator.
|
||||
|
||||
Caret ranges are ideal when an author may make breaking changes
|
||||
between `0.2.4` and `0.3.0` releases, which is a common practice.
|
||||
However, it presumes that there will *not* be breaking changes between
|
||||
`0.2.4` and `0.2.5`. It allows for changes that are presumed to be
|
||||
additive (but non-breaking), according to commonly observed practices.
|
||||
|
||||
* `^1.2.3` := `>=1.2.3 <2.0.0`
|
||||
* `^0.2.3` := `>=0.2.3 <0.3.0`
|
||||
* `^0.0.3` := `>=0.0.3 <0.0.4`
|
||||
* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in
|
||||
the `1.2.3` version will be allowed, if they are greater than or
|
||||
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
|
||||
`1.2.4-beta.2` would not, because it is a prerelease of a
|
||||
different `[major, minor, patch]` tuple.
|
||||
* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the
|
||||
`0.0.3` version *only* will be allowed, if they are greater than or
|
||||
equal to `beta`. So, `0.0.3-pr.2` would be allowed.
|
||||
|
||||
When parsing caret ranges, a missing `patch` value desugars to the
|
||||
number `0`, but will allow flexibility within that value, even if the
|
||||
major and minor versions are both `0`.
|
||||
|
||||
* `^1.2.x` := `>=1.2.0 <2.0.0`
|
||||
* `^0.0.x` := `>=0.0.0 <0.1.0`
|
||||
* `^0.0` := `>=0.0.0 <0.1.0`
|
||||
|
||||
A missing `minor` and `patch` values will desugar to zero, but also
|
||||
allow flexibility within those values, even if the major version is
|
||||
zero.
|
||||
|
||||
* `^1.x` := `>=1.0.0 <2.0.0`
|
||||
* `^0.x` := `>=0.0.0 <1.0.0`
|
||||
|
||||
### Range Grammar
|
||||
|
||||
Putting all this together, here is a Backus-Naur grammar for ranges,
|
||||
for the benefit of parser authors:
|
||||
|
||||
```bnf
|
||||
range-set ::= range ( logical-or range ) *
|
||||
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
|
||||
range ::= hyphen | simple ( ' ' simple ) * | ''
|
||||
hyphen ::= partial ' - ' partial
|
||||
simple ::= primitive | partial | tilde | caret
|
||||
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
|
||||
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
|
||||
xr ::= 'x' | 'X' | '*' | nr
|
||||
nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
|
||||
tilde ::= '~' partial
|
||||
caret ::= '^' partial
|
||||
qualifier ::= ( '-' pre )? ( '+' build )?
|
||||
pre ::= parts
|
||||
build ::= parts
|
||||
parts ::= part ( '.' part ) *
|
||||
part ::= nr | [-0-9A-Za-z]+
|
||||
```
|
||||
|
||||
## Functions
|
||||
|
||||
All methods and classes take a final `options` object argument. All
|
||||
options in this object are `false` by default. The options supported
|
||||
are:
|
||||
|
||||
- `loose` Be more forgiving about not-quite-valid semver strings.
|
||||
(Any resulting output will always be 100% strict compliant, of
|
||||
course.) For backwards compatibility reasons, if the `options`
|
||||
argument is a boolean value instead of an object, it is interpreted
|
||||
to be the `loose` param.
|
||||
- `includePrerelease` Set to suppress the [default
|
||||
behavior](https://github.com/npm/node-semver#prerelease-tags) of
|
||||
excluding prerelease tagged versions from ranges unless they are
|
||||
explicitly opted into.
|
||||
|
||||
Strict-mode Comparators and Ranges will be strict about the SemVer
|
||||
strings that they parse.
|
||||
|
||||
* `valid(v)`: Return the parsed version, or null if it's not valid.
|
||||
* `inc(v, release)`: Return the version incremented by the release
|
||||
type (`major`, `premajor`, `minor`, `preminor`, `patch`,
|
||||
`prepatch`, or `prerelease`), or null if it's not valid
|
||||
* `premajor` in one call will bump the version up to the next major
|
||||
version and down to a prerelease of that major version.
|
||||
`preminor`, and `prepatch` work the same way.
|
||||
* If called from a non-prerelease version, the `prerelease` will work the
|
||||
same as `prepatch`. It increments the patch version, then makes a
|
||||
prerelease. If the input version is already a prerelease it simply
|
||||
increments it.
|
||||
* `prerelease(v)`: Returns an array of prerelease components, or null
|
||||
if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
|
||||
* `major(v)`: Return the major version number.
|
||||
* `minor(v)`: Return the minor version number.
|
||||
* `patch(v)`: Return the patch version number.
|
||||
* `intersects(r1, r2, loose)`: Return true if the two supplied ranges
|
||||
or comparators intersect.
|
||||
* `parse(v)`: Attempt to parse a string as a semantic version, returning either
|
||||
a `SemVer` object or `null`.
|
||||
|
||||
### Comparison
|
||||
|
||||
* `gt(v1, v2)`: `v1 > v2`
|
||||
* `gte(v1, v2)`: `v1 >= v2`
|
||||
* `lt(v1, v2)`: `v1 < v2`
|
||||
* `lte(v1, v2)`: `v1 <= v2`
|
||||
* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
|
||||
even if they're not the exact same string. You already know how to
|
||||
compare strings.
|
||||
* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
|
||||
* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
|
||||
the corresponding function above. `"==="` and `"!=="` do simple
|
||||
string comparison, but are included for completeness. Throws if an
|
||||
invalid comparison string is provided.
|
||||
* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
|
||||
`v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
|
||||
* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions
|
||||
in descending order when passed to `Array.sort()`.
|
||||
* `diff(v1, v2)`: Returns difference between two versions by the release type
|
||||
(`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
|
||||
or null if the versions are the same.
|
||||
|
||||
### Comparators
|
||||
|
||||
* `intersects(comparator)`: Return true if the comparators intersect
|
||||
|
||||
### Ranges
|
||||
|
||||
* `validRange(range)`: Return the valid range or null if it's not valid
|
||||
* `satisfies(version, range)`: Return true if the version satisfies the
|
||||
range.
|
||||
* `maxSatisfying(versions, range)`: Return the highest version in the list
|
||||
that satisfies the range, or `null` if none of them do.
|
||||
* `minSatisfying(versions, range)`: Return the lowest version in the list
|
||||
that satisfies the range, or `null` if none of them do.
|
||||
* `minVersion(range)`: Return the lowest version that can possibly match
|
||||
the given range.
|
||||
* `gtr(version, range)`: Return `true` if version is greater than all the
|
||||
versions possible in the range.
|
||||
* `ltr(version, range)`: Return `true` if version is less than all the
|
||||
versions possible in the range.
|
||||
* `outside(version, range, hilo)`: Return true if the version is outside
|
||||
the bounds of the range in either the high or low direction. The
|
||||
`hilo` argument must be either the string `'>'` or `'<'`. (This is
|
||||
the function called by `gtr` and `ltr`.)
|
||||
* `intersects(range)`: Return true if any of the ranges comparators intersect
|
||||
|
||||
Note that, since ranges may be non-contiguous, a version might not be
|
||||
greater than a range, less than a range, *or* satisfy a range! For
|
||||
example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
|
||||
until `2.0.0`, so the version `1.2.10` would not be greater than the
|
||||
range (because `2.0.1` satisfies, which is higher), nor less than the
|
||||
range (since `1.2.8` satisfies, which is lower), and it also does not
|
||||
satisfy the range.
|
||||
|
||||
If you want to know if a version satisfies or does not satisfy a
|
||||
range, use the `satisfies(version, range)` function.
|
||||
|
||||
### Coercion
|
||||
|
||||
* `coerce(version)`: Coerces a string to semver if possible
|
||||
|
||||
This aims to provide a very forgiving translation of a non-semver string to
|
||||
semver. It looks for the first digit in a string, and consumes all
|
||||
remaining characters which satisfy at least a partial semver (e.g., `1`,
|
||||
`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer
|
||||
versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All
|
||||
surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes
|
||||
`3.4.0`). Only text which lacks digits will fail coercion (`version one`
|
||||
is not valid). The maximum length for any semver component considered for
|
||||
coercion is 16 characters; longer components will be ignored
|
||||
(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any
|
||||
semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
|
||||
components are invalid (`9999999999999999.4.7.4` is likely invalid).
|
160
node_modules/make-dir/node_modules/semver/bin/semver
generated
vendored
Executable file
160
node_modules/make-dir/node_modules/semver/bin/semver
generated
vendored
Executable file
|
@ -0,0 +1,160 @@
|
|||
#!/usr/bin/env node
|
||||
// Standalone semver comparison program.
|
||||
// Exits successfully and prints matching version(s) if
|
||||
// any supplied version is valid and passes all tests.
|
||||
|
||||
var argv = process.argv.slice(2)
|
||||
|
||||
var versions = []
|
||||
|
||||
var range = []
|
||||
|
||||
var inc = null
|
||||
|
||||
var version = require('../package.json').version
|
||||
|
||||
var loose = false
|
||||
|
||||
var includePrerelease = false
|
||||
|
||||
var coerce = false
|
||||
|
||||
var identifier
|
||||
|
||||
var semver = require('../semver')
|
||||
|
||||
var reverse = false
|
||||
|
||||
var options = {}
|
||||
|
||||
main()
|
||||
|
||||
function main () {
|
||||
if (!argv.length) return help()
|
||||
while (argv.length) {
|
||||
var a = argv.shift()
|
||||
var indexOfEqualSign = a.indexOf('=')
|
||||
if (indexOfEqualSign !== -1) {
|
||||
a = a.slice(0, indexOfEqualSign)
|
||||
argv.unshift(a.slice(indexOfEqualSign + 1))
|
||||
}
|
||||
switch (a) {
|
||||
case '-rv': case '-rev': case '--rev': case '--reverse':
|
||||
reverse = true
|
||||
break
|
||||
case '-l': case '--loose':
|
||||
loose = true
|
||||
break
|
||||
case '-p': case '--include-prerelease':
|
||||
includePrerelease = true
|
||||
break
|
||||
case '-v': case '--version':
|
||||
versions.push(argv.shift())
|
||||
break
|
||||
case '-i': case '--inc': case '--increment':
|
||||
switch (argv[0]) {
|
||||
case 'major': case 'minor': case 'patch': case 'prerelease':
|
||||
case 'premajor': case 'preminor': case 'prepatch':
|
||||
inc = argv.shift()
|
||||
break
|
||||
default:
|
||||
inc = 'patch'
|
||||
break
|
||||
}
|
||||
break
|
||||
case '--preid':
|
||||
identifier = argv.shift()
|
||||
break
|
||||
case '-r': case '--range':
|
||||
range.push(argv.shift())
|
||||
break
|
||||
case '-c': case '--coerce':
|
||||
coerce = true
|
||||
break
|
||||
case '-h': case '--help': case '-?':
|
||||
return help()
|
||||
default:
|
||||
versions.push(a)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
var options = { loose: loose, includePrerelease: includePrerelease }
|
||||
|
||||
versions = versions.map(function (v) {
|
||||
return coerce ? (semver.coerce(v) || { version: v }).version : v
|
||||
}).filter(function (v) {
|
||||
return semver.valid(v)
|
||||
})
|
||||
if (!versions.length) return fail()
|
||||
if (inc && (versions.length !== 1 || range.length)) { return failInc() }
|
||||
|
||||
for (var i = 0, l = range.length; i < l; i++) {
|
||||
versions = versions.filter(function (v) {
|
||||
return semver.satisfies(v, range[i], options)
|
||||
})
|
||||
if (!versions.length) return fail()
|
||||
}
|
||||
return success(versions)
|
||||
}
|
||||
|
||||
function failInc () {
|
||||
console.error('--inc can only be used on a single version with no range')
|
||||
fail()
|
||||
}
|
||||
|
||||
function fail () { process.exit(1) }
|
||||
|
||||
function success () {
|
||||
var compare = reverse ? 'rcompare' : 'compare'
|
||||
versions.sort(function (a, b) {
|
||||
return semver[compare](a, b, options)
|
||||
}).map(function (v) {
|
||||
return semver.clean(v, options)
|
||||
}).map(function (v) {
|
||||
return inc ? semver.inc(v, inc, options, identifier) : v
|
||||
}).forEach(function (v, i, _) { console.log(v) })
|
||||
}
|
||||
|
||||
function help () {
|
||||
console.log(['SemVer ' + version,
|
||||
'',
|
||||
'A JavaScript implementation of the https://semver.org/ specification',
|
||||
'Copyright Isaac Z. Schlueter',
|
||||
'',
|
||||
'Usage: semver [options] <version> [<version> [...]]',
|
||||
'Prints valid versions sorted by SemVer precedence',
|
||||
'',
|
||||
'Options:',
|
||||
'-r --range <range>',
|
||||
' Print versions that match the specified range.',
|
||||
'',
|
||||
'-i --increment [<level>]',
|
||||
' Increment a version by the specified level. Level can',
|
||||
' be one of: major, minor, patch, premajor, preminor,',
|
||||
" prepatch, or prerelease. Default level is 'patch'.",
|
||||
' Only one version may be specified.',
|
||||
'',
|
||||
'--preid <identifier>',
|
||||
' Identifier to be used to prefix premajor, preminor,',
|
||||
' prepatch or prerelease version increments.',
|
||||
'',
|
||||
'-l --loose',
|
||||
' Interpret versions and ranges loosely',
|
||||
'',
|
||||
'-p --include-prerelease',
|
||||
' Always include prerelease versions in range matching',
|
||||
'',
|
||||
'-c --coerce',
|
||||
' Coerce a string into SemVer if possible',
|
||||
' (does not imply --loose)',
|
||||
'',
|
||||
'Program exits successfully if any valid version satisfies',
|
||||
'all supplied ranges, and prints all satisfying versions.',
|
||||
'',
|
||||
'If no satisfying versions are found, then exits failure.',
|
||||
'',
|
||||
'Versions are printed in ascending order, so supplying',
|
||||
'multiple versions to the utility will just sort them.'
|
||||
].join('\n'))
|
||||
}
|
63
node_modules/make-dir/node_modules/semver/package.json
generated
vendored
Normal file
63
node_modules/make-dir/node_modules/semver/package.json
generated
vendored
Normal file
|
@ -0,0 +1,63 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"semver@5.7.1",
|
||||
"/home/runner/work/ghaction-upx/ghaction-upx"
|
||||
]
|
||||
],
|
||||
"_from": "semver@5.7.1",
|
||||
"_id": "semver@5.7.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
|
||||
"_location": "/make-dir/semver",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "semver@5.7.1",
|
||||
"name": "semver",
|
||||
"escapedName": "semver",
|
||||
"rawSpec": "5.7.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "5.7.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/make-dir"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
|
||||
"_spec": "5.7.1",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx",
|
||||
"bin": {
|
||||
"semver": "bin/semver"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/npm/node-semver/issues"
|
||||
},
|
||||
"description": "The semantic version parser used by npm.",
|
||||
"devDependencies": {
|
||||
"tap": "^13.0.0-rc.18"
|
||||
},
|
||||
"files": [
|
||||
"bin",
|
||||
"range.bnf",
|
||||
"semver.js"
|
||||
],
|
||||
"homepage": "https://github.com/npm/node-semver#readme",
|
||||
"license": "ISC",
|
||||
"main": "semver.js",
|
||||
"name": "semver",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/npm/node-semver.git"
|
||||
},
|
||||
"scripts": {
|
||||
"postpublish": "git push origin --all; git push origin --tags",
|
||||
"postversion": "npm publish",
|
||||
"preversion": "npm test",
|
||||
"test": "tap"
|
||||
},
|
||||
"tap": {
|
||||
"check-coverage": true
|
||||
},
|
||||
"version": "5.7.1"
|
||||
}
|
16
node_modules/make-dir/node_modules/semver/range.bnf
generated
vendored
Normal file
16
node_modules/make-dir/node_modules/semver/range.bnf
generated
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
range-set ::= range ( logical-or range ) *
|
||||
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
|
||||
range ::= hyphen | simple ( ' ' simple ) * | ''
|
||||
hyphen ::= partial ' - ' partial
|
||||
simple ::= primitive | partial | tilde | caret
|
||||
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
|
||||
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
|
||||
xr ::= 'x' | 'X' | '*' | nr
|
||||
nr ::= '0' | [1-9] ( [0-9] ) *
|
||||
tilde ::= '~' partial
|
||||
caret ::= '^' partial
|
||||
qualifier ::= ( '-' pre )? ( '+' build )?
|
||||
pre ::= parts
|
||||
build ::= parts
|
||||
parts ::= part ( '.' part ) *
|
||||
part ::= nr | [-0-9A-Za-z]+
|
1483
node_modules/make-dir/node_modules/semver/semver.js
generated
vendored
Normal file
1483
node_modules/make-dir/node_modules/semver/semver.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
40
node_modules/make-dir/package.json
generated
vendored
40
node_modules/make-dir/package.json
generated
vendored
|
@ -1,32 +1,31 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"make-dir@1.3.0",
|
||||
"make-dir@2.1.0",
|
||||
"/home/runner/work/ghaction-upx/ghaction-upx"
|
||||
]
|
||||
],
|
||||
"_from": "make-dir@1.3.0",
|
||||
"_id": "make-dir@1.3.0",
|
||||
"_from": "make-dir@2.1.0",
|
||||
"_id": "make-dir@2.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==",
|
||||
"_integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==",
|
||||
"_location": "/make-dir",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "make-dir@1.3.0",
|
||||
"raw": "make-dir@2.1.0",
|
||||
"name": "make-dir",
|
||||
"escapedName": "make-dir",
|
||||
"rawSpec": "1.3.0",
|
||||
"rawSpec": "2.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.3.0"
|
||||
"fetchSpec": "2.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/decompress",
|
||||
"/download"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz",
|
||||
"_spec": "1.3.0",
|
||||
"_resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
|
||||
"_spec": "2.1.0",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
|
@ -37,23 +36,28 @@
|
|||
"url": "https://github.com/sindresorhus/make-dir/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"pify": "^3.0.0"
|
||||
"pify": "^4.0.1",
|
||||
"semver": "^5.6.0"
|
||||
},
|
||||
"description": "Make a directory and its parents if needed - Think `mkdir -p`",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"@types/graceful-fs": "^4.1.3",
|
||||
"@types/node": "^11.10.4",
|
||||
"ava": "^1.2.0",
|
||||
"codecov": "^3.0.0",
|
||||
"graceful-fs": "^4.1.11",
|
||||
"nyc": "^11.3.0",
|
||||
"nyc": "^13.1.0",
|
||||
"path-type": "^3.0.0",
|
||||
"tempy": "^0.2.1",
|
||||
"xo": "^0.20.0"
|
||||
"tsd-check": "^0.3.0",
|
||||
"xo": "^0.24.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
"node": ">=6"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/make-dir#readme",
|
||||
"keywords": [
|
||||
|
@ -84,7 +88,7 @@
|
|||
"url": "git+https://github.com/sindresorhus/make-dir.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && nyc ava"
|
||||
"test": "xo && nyc ava && tsd-check"
|
||||
},
|
||||
"version": "1.3.0"
|
||||
"version": "2.1.0"
|
||||
}
|
||||
|
|
23
node_modules/make-dir/readme.md
generated
vendored
23
node_modules/make-dir/readme.md
generated
vendored
|
@ -1,4 +1,4 @@
|
|||
# make-dir [![Build Status: macOS & Linux](https://travis-ci.org/sindresorhus/make-dir.svg?branch=master)](https://travis-ci.org/sindresorhus/make-dir) [![Build status: Windows](https://ci.appveyor.com/api/projects/status/e0vtt8y600w91gcs/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/make-dir/branch/master) [![codecov](https://codecov.io/gh/sindresorhus/make-dir/branch/master/graph/badge.svg)](https://codecov.io/gh/sindresorhus/make-dir)
|
||||
# make-dir [![Build Status](https://travis-ci.org/sindresorhus/make-dir.svg?branch=master)](https://travis-ci.org/sindresorhus/make-dir) [![codecov](https://codecov.io/gh/sindresorhus/make-dir/branch/master/graph/badge.svg)](https://codecov.io/gh/sindresorhus/make-dir)
|
||||
|
||||
> Make a directory and its parents if needed - Think `mkdir -p`
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
|||
- CI-tested on macOS, Linux, and Windows
|
||||
- Actively maintained
|
||||
- Doesn't bundle a CLI
|
||||
- Uses native the `fs.mkdir/mkdirSync` [`recursive` option](https://nodejs.org/dist/latest/docs/api/fs.html#fs_fs_mkdir_path_options_callback) in Node.js >=10.12.0 unless [overridden](#fs)
|
||||
|
||||
|
||||
## Install
|
||||
|
@ -32,10 +33,12 @@ $ tree
|
|||
```js
|
||||
const makeDir = require('make-dir');
|
||||
|
||||
makeDir('unicorn/rainbow/cake').then(path => {
|
||||
(async () => {
|
||||
const path = await makeDir('unicorn/rainbow/cake');
|
||||
|
||||
console.log(path);
|
||||
//=> '/Users/sindresorhus/fun/unicorn/rainbow/cake'
|
||||
});
|
||||
})();
|
||||
```
|
||||
|
||||
```
|
||||
|
@ -51,10 +54,12 @@ Multiple directories:
|
|||
```js
|
||||
const makeDir = require('make-dir');
|
||||
|
||||
Promise.all([
|
||||
makeDir('unicorn/rainbow')
|
||||
makeDir('foo/bar')
|
||||
]).then(paths => {
|
||||
(async () => {
|
||||
const paths = await Promise.all([
|
||||
makeDir('unicorn/rainbow'),
|
||||
makeDir('foo/bar')
|
||||
]);
|
||||
|
||||
console.log(paths);
|
||||
/*
|
||||
[
|
||||
|
@ -62,7 +67,7 @@ Promise.all([
|
|||
'/Users/sindresorhus/fun/foo/bar'
|
||||
]
|
||||
*/
|
||||
});
|
||||
})();
|
||||
```
|
||||
|
||||
|
||||
|
@ -100,6 +105,8 @@ Default: `require('fs')`
|
|||
|
||||
Use a custom `fs` implementation. For example [`graceful-fs`](https://github.com/isaacs/node-graceful-fs).
|
||||
|
||||
Using a custom `fs` implementation will block the use of the native `recursive` option if `fs.mkdir` or `fs.mkdirSync` is not the native function.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
|
|
15
node_modules/mime-db/HISTORY.md
generated
vendored
15
node_modules/mime-db/HISTORY.md
generated
vendored
|
@ -1,3 +1,18 @@
|
|||
1.43.0 / 2020-01-05
|
||||
===================
|
||||
|
||||
* Add `application/x-keepass2` with extension `.kdbx`
|
||||
* Add extension `.mxmf` to `audio/mobile-xmf`
|
||||
* Add extensions from IANA for `application/*+xml` types
|
||||
* Add new upstream MIME types
|
||||
|
||||
1.42.0 / 2019-09-25
|
||||
===================
|
||||
|
||||
* Add `image/vnd.ms-dds` with extension `.dds`
|
||||
* Add new upstream MIME types
|
||||
* Remove compressible from `multipart/mixed`
|
||||
|
||||
1.41.0 / 2019-08-30
|
||||
===================
|
||||
|
||||
|
|
8
node_modules/mime-db/README.md
generated
vendored
8
node_modules/mime-db/README.md
generated
vendored
|
@ -76,13 +76,19 @@ and the values being an object with the following keys:
|
|||
|
||||
To update the build, run `npm run build`.
|
||||
|
||||
## Adding Custom Media Types
|
||||
### Adding Custom Media Types
|
||||
|
||||
The best way to get new media types included in this library is to register
|
||||
them with the IANA. The community registration procedure is outlined in
|
||||
[RFC 6838 section 5](http://tools.ietf.org/html/rfc6838#section-5). Types
|
||||
registered with the IANA are automatically pulled into this library.
|
||||
|
||||
If that is not possible / feasible, they can be added directly here as a
|
||||
"custom" type. To do this, it is required to have a primary source that
|
||||
definitively lists the media type. If an extension is going to be listed as
|
||||
associateed with this media type, the source must definitively link the
|
||||
media type and extension as well.
|
||||
|
||||
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-db/master
|
||||
[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master
|
||||
[node-image]: https://badgen.net/npm/node/mime-db
|
||||
|
|
188
node_modules/mime-db/db.json
generated
vendored
188
node_modules/mime-db/db.json
generated
vendored
|
@ -92,7 +92,8 @@
|
|||
},
|
||||
"application/atomdeleted+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["atomdeleted"]
|
||||
},
|
||||
"application/atomicmail": {
|
||||
"source": "iana"
|
||||
|
@ -104,15 +105,22 @@
|
|||
},
|
||||
"application/atsc-dwd+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["dwd"]
|
||||
},
|
||||
"application/atsc-held+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true,
|
||||
"extensions": ["held"]
|
||||
},
|
||||
"application/atsc-rdt+json": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
},
|
||||
"application/atsc-rsat+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["rsat"]
|
||||
},
|
||||
"application/atxml": {
|
||||
"source": "iana"
|
||||
|
@ -142,7 +150,8 @@
|
|||
},
|
||||
"application/calendar+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["xcs"]
|
||||
},
|
||||
"application/call-completion": {
|
||||
"source": "iana"
|
||||
|
@ -153,6 +162,9 @@
|
|||
"application/cbor": {
|
||||
"source": "iana"
|
||||
},
|
||||
"application/cbor-seq": {
|
||||
"source": "iana"
|
||||
},
|
||||
"application/cccex": {
|
||||
"source": "iana"
|
||||
},
|
||||
|
@ -167,7 +179,8 @@
|
|||
},
|
||||
"application/cdfx+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["cdfx"]
|
||||
},
|
||||
"application/cdmi-capability": {
|
||||
"source": "iana",
|
||||
|
@ -206,6 +219,10 @@
|
|||
"application/cfw": {
|
||||
"source": "iana"
|
||||
},
|
||||
"application/clue+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
},
|
||||
"application/clue_info+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
|
@ -403,7 +420,8 @@
|
|||
},
|
||||
"application/emotionml+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["emotionml"]
|
||||
},
|
||||
"application/encaprtp": {
|
||||
"source": "iana"
|
||||
|
@ -436,7 +454,8 @@
|
|||
},
|
||||
"application/fdt+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["fdt"]
|
||||
},
|
||||
"application/fhir+json": {
|
||||
"source": "iana",
|
||||
|
@ -577,7 +596,8 @@
|
|||
},
|
||||
"application/its+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["its"]
|
||||
},
|
||||
"application/java-archive": {
|
||||
"source": "apache",
|
||||
|
@ -662,7 +682,8 @@
|
|||
},
|
||||
"application/lgr+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["lgr"]
|
||||
},
|
||||
"application/link-format": {
|
||||
"source": "iana"
|
||||
|
@ -821,11 +842,13 @@
|
|||
},
|
||||
"application/mmt-aei+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["maei"]
|
||||
},
|
||||
"application/mmt-usd+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["musd"]
|
||||
},
|
||||
"application/mods+xml": {
|
||||
"source": "iana",
|
||||
|
@ -863,11 +886,13 @@
|
|||
},
|
||||
"application/mrb-consumer+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["xdf"]
|
||||
},
|
||||
"application/mrb-publish+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["xdf"]
|
||||
},
|
||||
"application/msc-ivr+xml": {
|
||||
"source": "iana",
|
||||
|
@ -886,6 +911,9 @@
|
|||
"source": "iana",
|
||||
"compressible": true
|
||||
},
|
||||
"application/multipart-core": {
|
||||
"source": "iana"
|
||||
},
|
||||
"application/mxf": {
|
||||
"source": "iana",
|
||||
"extensions": ["mxf"]
|
||||
|
@ -970,7 +998,8 @@
|
|||
},
|
||||
"application/p2p-overlay+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["relo"]
|
||||
},
|
||||
"application/parityfec": {
|
||||
"source": "iana"
|
||||
|
@ -1088,7 +1117,8 @@
|
|||
},
|
||||
"application/provenance+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["provx"]
|
||||
},
|
||||
"application/prs.alvestrand.titrax-sheet": {
|
||||
"source": "iana"
|
||||
|
@ -1182,15 +1212,18 @@
|
|||
},
|
||||
"application/route-apd+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["rapd"]
|
||||
},
|
||||
"application/route-s-tsid+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["sls"]
|
||||
},
|
||||
"application/route-usd+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["rusd"]
|
||||
},
|
||||
"application/rpki-ghostbusters": {
|
||||
"source": "iana",
|
||||
|
@ -1284,7 +1317,8 @@
|
|||
},
|
||||
"application/senml+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["senmlx"]
|
||||
},
|
||||
"application/senml-exi": {
|
||||
"source": "iana"
|
||||
|
@ -1298,7 +1332,8 @@
|
|||
},
|
||||
"application/sensml+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["sensmlx"]
|
||||
},
|
||||
"application/sensml-exi": {
|
||||
"source": "iana"
|
||||
|
@ -1420,6 +1455,11 @@
|
|||
"source": "iana",
|
||||
"compressible": true
|
||||
},
|
||||
"application/swid+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true,
|
||||
"extensions": ["swidtag"]
|
||||
},
|
||||
"application/tamp-apex-update": {
|
||||
"source": "iana"
|
||||
},
|
||||
|
@ -1505,7 +1545,8 @@
|
|||
},
|
||||
"application/ttml+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["ttml"]
|
||||
},
|
||||
"application/tve-trigger": {
|
||||
"source": "iana"
|
||||
|
@ -1525,7 +1566,8 @@
|
|||
},
|
||||
"application/urc-ressheet+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["rsheet"]
|
||||
},
|
||||
"application/urc-targetdesc+xml": {
|
||||
"source": "iana",
|
||||
|
@ -1551,7 +1593,8 @@
|
|||
},
|
||||
"application/vnd.1000minds.decision-model+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["1km"]
|
||||
},
|
||||
"application/vnd.3gpp-prose+xml": {
|
||||
"source": "iana",
|
||||
|
@ -1788,9 +1831,36 @@
|
|||
"application/vnd.afpc.afplinedata": {
|
||||
"source": "iana"
|
||||
},
|
||||
"application/vnd.afpc.afplinedata-pagedef": {
|
||||
"source": "iana"
|
||||
},
|
||||
"application/vnd.afpc.foca-charset": {
|
||||
"source": "iana"
|
||||
},
|
||||
"application/vnd.afpc.foca-codedfont": {
|
||||
"source": "iana"
|
||||
},
|
||||
"application/vnd.afpc.foca-codepage": {
|
||||
"source": "iana"
|
||||
},
|
||||
"application/vnd.afpc.modca": {
|
||||
"source": "iana"
|
||||
},
|
||||
"application/vnd.afpc.modca-formdef": {
|
||||
"source": "iana"
|
||||
},
|
||||
"application/vnd.afpc.modca-mediummap": {
|
||||
"source": "iana"
|
||||
},
|
||||
"application/vnd.afpc.modca-objectcontainer": {
|
||||
"source": "iana"
|
||||
},
|
||||
"application/vnd.afpc.modca-overlay": {
|
||||
"source": "iana"
|
||||
},
|
||||
"application/vnd.afpc.modca-pagesegment": {
|
||||
"source": "iana"
|
||||
},
|
||||
"application/vnd.ah-barcode": {
|
||||
"source": "iana"
|
||||
},
|
||||
|
@ -1865,6 +1935,10 @@
|
|||
"source": "iana",
|
||||
"compressible": true
|
||||
},
|
||||
"application/vnd.aplextor.warrp+json": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
},
|
||||
"application/vnd.apothekende.reservation+json": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
|
@ -1929,7 +2003,8 @@
|
|||
},
|
||||
"application/vnd.balsamiq.bmml+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["bmml"]
|
||||
},
|
||||
"application/vnd.balsamiq.bmpr": {
|
||||
"source": "iana"
|
||||
|
@ -2579,6 +2654,10 @@
|
|||
"application/vnd.ffsns": {
|
||||
"source": "iana"
|
||||
},
|
||||
"application/vnd.ficlab.flb+zip": {
|
||||
"source": "iana",
|
||||
"compressible": false
|
||||
},
|
||||
"application/vnd.filmit.zfc": {
|
||||
"source": "iana"
|
||||
},
|
||||
|
@ -2677,6 +2756,10 @@
|
|||
"source": "iana",
|
||||
"extensions": ["txd"]
|
||||
},
|
||||
"application/vnd.gentics.grd+json": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
},
|
||||
"application/vnd.geo+json": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
|
@ -3643,7 +3726,8 @@
|
|||
},
|
||||
"application/vnd.nokia.n-gage.ac+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["ac"]
|
||||
},
|
||||
"application/vnd.nokia.n-gage.data": {
|
||||
"source": "iana",
|
||||
|
@ -3997,7 +4081,8 @@
|
|||
},
|
||||
"application/vnd.openblox.game+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["obgx"]
|
||||
},
|
||||
"application/vnd.openblox.game-binary": {
|
||||
"source": "iana"
|
||||
|
@ -4011,7 +4096,8 @@
|
|||
},
|
||||
"application/vnd.openstreetmap.data+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["osm"]
|
||||
},
|
||||
"application/vnd.openxmlformats-officedocument.custom-properties+xml": {
|
||||
"source": "iana",
|
||||
|
@ -4690,7 +4776,8 @@
|
|||
},
|
||||
"application/vnd.software602.filler.form+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["fo"]
|
||||
},
|
||||
"application/vnd.software602.filler.form-xml-zip": {
|
||||
"source": "iana"
|
||||
|
@ -4837,7 +4924,8 @@
|
|||
},
|
||||
"application/vnd.syncml.dmddf+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["ddf"]
|
||||
},
|
||||
"application/vnd.syncml.dmtnds+wbxml": {
|
||||
"source": "iana"
|
||||
|
@ -5474,6 +5562,9 @@
|
|||
"application/x-javascript": {
|
||||
"compressible": true
|
||||
},
|
||||
"application/x-keepass2": {
|
||||
"extensions": ["kdbx"]
|
||||
},
|
||||
"application/x-latex": {
|
||||
"source": "apache",
|
||||
"compressible": false,
|
||||
|
@ -5786,11 +5877,13 @@
|
|||
},
|
||||
"application/xcap-att+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["xav"]
|
||||
},
|
||||
"application/xcap-caps+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["xca"]
|
||||
},
|
||||
"application/xcap-diff+xml": {
|
||||
"source": "iana",
|
||||
|
@ -5799,15 +5892,18 @@
|
|||
},
|
||||
"application/xcap-el+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["xel"]
|
||||
},
|
||||
"application/xcap-error+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["xer"]
|
||||
},
|
||||
"application/xcap-ns+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["xns"]
|
||||
},
|
||||
"application/xcon-conference-info+xml": {
|
||||
"source": "iana",
|
||||
|
@ -5833,7 +5929,8 @@
|
|||
},
|
||||
"application/xliff+xml": {
|
||||
"source": "iana",
|
||||
"compressible": true
|
||||
"compressible": true,
|
||||
"extensions": ["xlf"]
|
||||
},
|
||||
"application/xml": {
|
||||
"source": "iana",
|
||||
|
@ -6153,7 +6250,8 @@
|
|||
"extensions": ["mid","midi","kar","rmi"]
|
||||
},
|
||||
"audio/mobile-xmf": {
|
||||
"source": "iana"
|
||||
"source": "iana",
|
||||
"extensions": ["mxmf"]
|
||||
},
|
||||
"audio/mp3": {
|
||||
"compressible": false,
|
||||
|
@ -6670,6 +6768,14 @@
|
|||
"source": "iana",
|
||||
"extensions": ["jxrs"]
|
||||
},
|
||||
"image/jxs": {
|
||||
"source": "iana",
|
||||
"extensions": ["jxs"]
|
||||
},
|
||||
"image/jxsc": {
|
||||
"source": "iana",
|
||||
"extensions": ["jxsc"]
|
||||
},
|
||||
"image/jxsi": {
|
||||
"source": "iana",
|
||||
"extensions": ["jxsi"]
|
||||
|
@ -6791,6 +6897,9 @@
|
|||
"image/vnd.mozilla.apng": {
|
||||
"source": "iana"
|
||||
},
|
||||
"image/vnd.ms-dds": {
|
||||
"extensions": ["dds"]
|
||||
},
|
||||
"image/vnd.ms-modi": {
|
||||
"source": "iana",
|
||||
"extensions": ["mdi"]
|
||||
|
@ -7143,8 +7252,7 @@
|
|||
"source": "iana"
|
||||
},
|
||||
"multipart/mixed": {
|
||||
"source": "iana",
|
||||
"compressible": false
|
||||
"source": "iana"
|
||||
},
|
||||
"multipart/multilingual": {
|
||||
"source": "iana"
|
||||
|
@ -7411,6 +7519,9 @@
|
|||
"text/vnd.esmertec.theme-descriptor": {
|
||||
"source": "iana"
|
||||
},
|
||||
"text/vnd.ficlab.flt": {
|
||||
"source": "iana"
|
||||
},
|
||||
"text/vnd.fly": {
|
||||
"source": "iana",
|
||||
"extensions": ["fly"]
|
||||
|
@ -7489,6 +7600,7 @@
|
|||
"extensions": ["wmls"]
|
||||
},
|
||||
"text/vtt": {
|
||||
"source": "iana",
|
||||
"charset": "UTF-8",
|
||||
"compressible": true,
|
||||
"extensions": ["vtt"]
|
||||
|
|
34
node_modules/mime-db/package.json
generated
vendored
34
node_modules/mime-db/package.json
generated
vendored
|
@ -1,31 +1,31 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"mime-db@1.41.0",
|
||||
"mime-db@1.43.0",
|
||||
"/home/runner/work/ghaction-upx/ghaction-upx"
|
||||
]
|
||||
],
|
||||
"_from": "mime-db@1.41.0",
|
||||
"_id": "mime-db@1.41.0",
|
||||
"_from": "mime-db@1.43.0",
|
||||
"_id": "mime-db@1.43.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-B5gxBI+2K431XW8C2rcc/lhppbuji67nf9v39eH8pkWoZDxnAL0PxdpH32KYRScniF8qDHBDlI+ipgg5WrCUYw==",
|
||||
"_integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==",
|
||||
"_location": "/mime-db",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "mime-db@1.41.0",
|
||||
"raw": "mime-db@1.43.0",
|
||||
"name": "mime-db",
|
||||
"escapedName": "mime-db",
|
||||
"rawSpec": "1.41.0",
|
||||
"rawSpec": "1.43.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.41.0"
|
||||
"fetchSpec": "1.43.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/ext-list"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.41.0.tgz",
|
||||
"_spec": "1.41.0",
|
||||
"_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz",
|
||||
"_spec": "1.43.0",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jshttp/mime-db/issues"
|
||||
|
@ -48,19 +48,19 @@
|
|||
],
|
||||
"description": "Media Type Database",
|
||||
"devDependencies": {
|
||||
"bluebird": "3.5.5",
|
||||
"bluebird": "3.7.2",
|
||||
"co": "4.6.0",
|
||||
"cogent": "1.0.1",
|
||||
"csv-parse": "4.4.5",
|
||||
"eslint": "6.2.2",
|
||||
"csv-parse": "4.8.3",
|
||||
"eslint": "6.8.0",
|
||||
"eslint-config-standard": "14.1.0",
|
||||
"eslint-plugin-import": "2.18.2",
|
||||
"eslint-plugin-node": "9.2.0",
|
||||
"eslint-plugin-import": "2.19.1",
|
||||
"eslint-plugin-node": "11.0.0",
|
||||
"eslint-plugin-promise": "4.2.1",
|
||||
"eslint-plugin-standard": "4.0.1",
|
||||
"gnode": "0.1.2",
|
||||
"mocha": "6.2.0",
|
||||
"nyc": "14.1.1",
|
||||
"mocha": "7.0.0",
|
||||
"nyc": "15.0.0",
|
||||
"raw-body": "2.4.1",
|
||||
"stream-to-array": "2.3.0"
|
||||
},
|
||||
|
@ -100,5 +100,5 @@
|
|||
"update": "npm run fetch && npm run build",
|
||||
"version": "node scripts/version-history.js && git add HISTORY.md"
|
||||
},
|
||||
"version": "1.41.0"
|
||||
"version": "1.43.0"
|
||||
}
|
||||
|
|
43
node_modules/npm-conf/index.js
generated
vendored
43
node_modules/npm-conf/index.js
generated
vendored
|
@ -1,43 +0,0 @@
|
|||
'use strict';
|
||||
const path = require('path');
|
||||
const Conf = require('./lib/conf');
|
||||
const defaults = require('./lib/defaults');
|
||||
|
||||
// https://github.com/npm/npm/blob/latest/lib/config/core.js#L101-L200
|
||||
module.exports = opts => {
|
||||
const conf = new Conf(Object.assign({}, defaults.defaults));
|
||||
|
||||
conf.add(Object.assign({}, opts), 'cli');
|
||||
conf.addEnv();
|
||||
conf.loadPrefix();
|
||||
|
||||
const projectConf = path.resolve(conf.localPrefix, '.npmrc');
|
||||
const userConf = conf.get('userconfig');
|
||||
|
||||
if (!conf.get('global') && projectConf !== userConf) {
|
||||
conf.addFile(projectConf, 'project');
|
||||
} else {
|
||||
conf.add({}, 'project');
|
||||
}
|
||||
|
||||
conf.addFile(conf.get('userconfig'), 'user');
|
||||
|
||||
if (conf.get('prefix')) {
|
||||
const etc = path.resolve(conf.get('prefix'), 'etc');
|
||||
conf.root.globalconfig = path.resolve(etc, 'npmrc');
|
||||
conf.root.globalignorefile = path.resolve(etc, 'npmignore');
|
||||
}
|
||||
|
||||
conf.addFile(conf.get('globalconfig'), 'global');
|
||||
conf.loadUser();
|
||||
|
||||
const caFile = conf.get('cafile');
|
||||
|
||||
if (caFile) {
|
||||
conf.loadCAFile(caFile);
|
||||
}
|
||||
|
||||
return conf;
|
||||
};
|
||||
|
||||
module.exports.defaults = Object.assign({}, defaults.defaults);
|
174
node_modules/npm-conf/lib/conf.js
generated
vendored
174
node_modules/npm-conf/lib/conf.js
generated
vendored
|
@ -1,174 +0,0 @@
|
|||
'use strict';
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const ConfigChain = require('config-chain').ConfigChain;
|
||||
const util = require('./util');
|
||||
|
||||
class Conf extends ConfigChain {
|
||||
// https://github.com/npm/npm/blob/latest/lib/config/core.js#L208-L222
|
||||
constructor(base) {
|
||||
super(base);
|
||||
this.root = base;
|
||||
}
|
||||
|
||||
// https://github.com/npm/npm/blob/latest/lib/config/core.js#L332-L342
|
||||
add(data, marker) {
|
||||
try {
|
||||
for (const x of Object.keys(data)) {
|
||||
data[x] = util.parseField(data[x], x);
|
||||
}
|
||||
} catch (err) {
|
||||
throw err;
|
||||
}
|
||||
|
||||
return super.add(data, marker);
|
||||
}
|
||||
|
||||
// https://github.com/npm/npm/blob/latest/lib/config/core.js#L312-L325
|
||||
addFile(file, name) {
|
||||
name = name || file;
|
||||
|
||||
const marker = {__source__: name};
|
||||
|
||||
this.sources[name] = {path: file, type: 'ini'};
|
||||
this.push(marker);
|
||||
this._await();
|
||||
|
||||
try {
|
||||
const contents = fs.readFileSync(file, 'utf8');
|
||||
this.addString(contents, file, 'ini', marker);
|
||||
} catch (err) {
|
||||
this.add({}, marker);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
// https://github.com/npm/npm/blob/latest/lib/config/core.js#L344-L360
|
||||
addEnv(env) {
|
||||
env = env || process.env;
|
||||
|
||||
const conf = {};
|
||||
|
||||
Object.keys(env)
|
||||
.filter(x => /^npm_config_/i.test(x))
|
||||
.forEach(x => {
|
||||
if (!env[x]) {
|
||||
return;
|
||||
}
|
||||
|
||||
const p = x.toLowerCase()
|
||||
.replace(/^npm_config_/, '')
|
||||
.replace(/(?!^)_/g, '-');
|
||||
|
||||
conf[p] = env[x];
|
||||
});
|
||||
|
||||
return super.addEnv('', conf, 'env');
|
||||
}
|
||||
|
||||
// https://github.com/npm/npm/blob/latest/lib/config/load-prefix.js
|
||||
loadPrefix() {
|
||||
const cli = this.list[0];
|
||||
|
||||
Object.defineProperty(this, 'prefix', {
|
||||
enumerable: true,
|
||||
set: prefix => {
|
||||
const g = this.get('global');
|
||||
this[g ? 'globalPrefix' : 'localPrefix'] = prefix;
|
||||
},
|
||||
get: () => {
|
||||
const g = this.get('global');
|
||||
return g ? this.globalPrefix : this.localPrefix;
|
||||
}
|
||||
});
|
||||
|
||||
Object.defineProperty(this, 'globalPrefix', {
|
||||
enumerable: true,
|
||||
set: prefix => {
|
||||
this.set('prefix', prefix);
|
||||
},
|
||||
get: () => {
|
||||
return path.resolve(this.get('prefix'));
|
||||
}
|
||||
});
|
||||
|
||||
let p;
|
||||
|
||||
Object.defineProperty(this, 'localPrefix', {
|
||||
enumerable: true,
|
||||
set: prefix => {
|
||||
p = prefix;
|
||||
},
|
||||
get: () => {
|
||||
return p;
|
||||
}
|
||||
});
|
||||
|
||||
if (Object.prototype.hasOwnProperty.call(cli, 'prefix')) {
|
||||
p = path.resolve(cli.prefix);
|
||||
} else {
|
||||
try {
|
||||
const prefix = util.findPrefix(process.cwd());
|
||||
p = prefix;
|
||||
} catch (err) {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
// https://github.com/npm/npm/blob/latest/lib/config/load-cafile.js
|
||||
loadCAFile(file) {
|
||||
if (!file) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const contents = fs.readFileSync(file, 'utf8');
|
||||
const delim = '-----END CERTIFICATE-----';
|
||||
const output = contents
|
||||
.split(delim)
|
||||
.filter(x => Boolean(x.trim()))
|
||||
.map(x => x.trimLeft() + delim);
|
||||
|
||||
this.set('ca', output);
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT') {
|
||||
return;
|
||||
}
|
||||
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
// https://github.com/npm/npm/blob/latest/lib/config/set-user.js
|
||||
loadUser() {
|
||||
const defConf = this.root;
|
||||
|
||||
if (this.get('global')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (process.env.SUDO_UID) {
|
||||
defConf.user = Number(process.env.SUDO_UID);
|
||||
return;
|
||||
}
|
||||
|
||||
const prefix = path.resolve(this.get('prefix'));
|
||||
|
||||
try {
|
||||
const stats = fs.statSync(prefix);
|
||||
defConf.user = stats.uid;
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT') {
|
||||
return;
|
||||
}
|
||||
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Conf;
|
169
node_modules/npm-conf/lib/defaults.js
generated
vendored
169
node_modules/npm-conf/lib/defaults.js
generated
vendored
|
@ -1,169 +0,0 @@
|
|||
|
||||
// Generated with `lib/make.js`
|
||||
'use strict';
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
|
||||
const temp = os.tmpdir();
|
||||
const uidOrPid = process.getuid ? process.getuid() : process.pid;
|
||||
const hasUnicode = () => true;
|
||||
const isWindows = process.platform === 'win32';
|
||||
|
||||
const osenv = {
|
||||
editor: () => process.env.EDITOR || process.env.VISUAL || (isWindows ? 'notepad.exe' : 'vi'),
|
||||
shell: () => isWindows ? (process.env.COMSPEC || 'cmd.exe') : (process.env.SHELL || '/bin/bash')
|
||||
};
|
||||
|
||||
const umask = {
|
||||
fromString: () => process.umask()
|
||||
};
|
||||
|
||||
let home = os.homedir();
|
||||
|
||||
if (home) {
|
||||
process.env.HOME = home;
|
||||
} else {
|
||||
home = path.resolve(temp, 'npm-' + uidOrPid);
|
||||
}
|
||||
|
||||
const cacheExtra = process.platform === 'win32' ? 'npm-cache' : '.npm';
|
||||
const cacheRoot = process.platform === 'win32' ? process.env.APPDATA : home;
|
||||
const cache = path.resolve(cacheRoot, cacheExtra);
|
||||
|
||||
let defaults;
|
||||
let globalPrefix;
|
||||
|
||||
Object.defineProperty(exports, 'defaults', {
|
||||
get: function () {
|
||||
if (defaults) return defaults;
|
||||
|
||||
if (process.env.PREFIX) {
|
||||
globalPrefix = process.env.PREFIX;
|
||||
} else if (process.platform === 'win32') {
|
||||
// c:\node\node.exe --> prefix=c:\node\
|
||||
globalPrefix = path.dirname(process.execPath);
|
||||
} else {
|
||||
// /usr/local/bin/node --> prefix=/usr/local
|
||||
globalPrefix = path.dirname(path.dirname(process.execPath)); // destdir only is respected on Unix
|
||||
|
||||
if (process.env.DESTDIR) {
|
||||
globalPrefix = path.join(process.env.DESTDIR, globalPrefix);
|
||||
}
|
||||
}
|
||||
|
||||
defaults = {
|
||||
access: null,
|
||||
'allow-same-version': false,
|
||||
'always-auth': false,
|
||||
also: null,
|
||||
'auth-type': 'legacy',
|
||||
'bin-links': true,
|
||||
browser: null,
|
||||
ca: null,
|
||||
cafile: null,
|
||||
cache: cache,
|
||||
'cache-lock-stale': 60000,
|
||||
'cache-lock-retries': 10,
|
||||
'cache-lock-wait': 10000,
|
||||
'cache-max': Infinity,
|
||||
'cache-min': 10,
|
||||
cert: null,
|
||||
color: true,
|
||||
depth: Infinity,
|
||||
description: true,
|
||||
dev: false,
|
||||
'dry-run': false,
|
||||
editor: osenv.editor(),
|
||||
'engine-strict': false,
|
||||
force: false,
|
||||
'fetch-retries': 2,
|
||||
'fetch-retry-factor': 10,
|
||||
'fetch-retry-mintimeout': 10000,
|
||||
'fetch-retry-maxtimeout': 60000,
|
||||
git: 'git',
|
||||
'git-tag-version': true,
|
||||
global: false,
|
||||
globalconfig: path.resolve(globalPrefix, 'etc', 'npmrc'),
|
||||
'global-style': false,
|
||||
group: process.platform === 'win32' ? 0 : process.env.SUDO_GID || process.getgid && process.getgid(),
|
||||
'ham-it-up': false,
|
||||
heading: 'npm',
|
||||
'if-present': false,
|
||||
'ignore-prepublish': false,
|
||||
'ignore-scripts': false,
|
||||
'init-module': path.resolve(home, '.npm-init.js'),
|
||||
'init-author-name': '',
|
||||
'init-author-email': '',
|
||||
'init-author-url': '',
|
||||
'init-version': '1.0.0',
|
||||
'init-license': 'ISC',
|
||||
json: false,
|
||||
key: null,
|
||||
'legacy-bundling': false,
|
||||
link: false,
|
||||
'local-address': undefined,
|
||||
loglevel: 'notice',
|
||||
logstream: process.stderr,
|
||||
'logs-max': 10,
|
||||
long: false,
|
||||
maxsockets: 50,
|
||||
message: '%s',
|
||||
'metrics-registry': null,
|
||||
'node-version': process.version,
|
||||
'offline': false,
|
||||
'onload-script': false,
|
||||
only: null,
|
||||
optional: true,
|
||||
'package-lock': true,
|
||||
parseable: false,
|
||||
'prefer-offline': false,
|
||||
'prefer-online': false,
|
||||
prefix: globalPrefix,
|
||||
production: process.env.NODE_ENV === 'production',
|
||||
'progress': !process.env.TRAVIS && !process.env.CI,
|
||||
'proprietary-attribs': true,
|
||||
proxy: null,
|
||||
'https-proxy': null,
|
||||
'user-agent': 'npm/{npm-version} ' + 'node/{node-version} ' + '{platform} ' + '{arch}',
|
||||
'rebuild-bundle': true,
|
||||
registry: 'https://registry.npmjs.org/',
|
||||
rollback: true,
|
||||
save: true,
|
||||
'save-bundle': false,
|
||||
'save-dev': false,
|
||||
'save-exact': false,
|
||||
'save-optional': false,
|
||||
'save-prefix': '^',
|
||||
'save-prod': false,
|
||||
scope: '',
|
||||
'script-shell': null,
|
||||
'scripts-prepend-node-path': 'warn-only',
|
||||
searchopts: '',
|
||||
searchexclude: null,
|
||||
searchlimit: 20,
|
||||
searchstaleness: 15 * 60,
|
||||
'send-metrics': false,
|
||||
shell: osenv.shell(),
|
||||
shrinkwrap: true,
|
||||
'sign-git-tag': false,
|
||||
'sso-poll-frequency': 500,
|
||||
'sso-type': 'oauth',
|
||||
'strict-ssl': true,
|
||||
tag: 'latest',
|
||||
'tag-version-prefix': 'v',
|
||||
timing: false,
|
||||
tmp: temp,
|
||||
unicode: hasUnicode(),
|
||||
'unsafe-perm': process.platform === 'win32' || process.platform === 'cygwin' || !(process.getuid && process.setuid && process.getgid && process.setgid) || process.getuid() !== 0,
|
||||
usage: false,
|
||||
user: process.platform === 'win32' ? 0 : 'nobody',
|
||||
userconfig: path.resolve(home, '.npmrc'),
|
||||
umask: process.umask ? process.umask() : umask.fromString('022'),
|
||||
version: false,
|
||||
versions: false,
|
||||
viewer: process.platform === 'win32' ? 'browser' : 'man',
|
||||
_exit: true
|
||||
};
|
||||
return defaults;
|
||||
}
|
||||
})
|
91
node_modules/npm-conf/lib/make.js
generated
vendored
91
node_modules/npm-conf/lib/make.js
generated
vendored
|
@ -1,91 +0,0 @@
|
|||
'use strict';
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const babylon = require('babylon');
|
||||
const generate = require('babel-generator').default;
|
||||
const traverse = require('babel-traverse').default;
|
||||
|
||||
const defaultsTemplate = body => `
|
||||
// Generated with \`lib/make.js\`
|
||||
'use strict';
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
|
||||
const temp = os.tmpdir();
|
||||
const uidOrPid = process.getuid ? process.getuid() : process.pid;
|
||||
const hasUnicode = () => true;
|
||||
const isWindows = process.platform === 'win32';
|
||||
|
||||
const osenv = {
|
||||
editor: () => process.env.EDITOR || process.env.VISUAL || (isWindows ? 'notepad.exe' : 'vi'),
|
||||
shell: () => isWindows ? (process.env.COMSPEC || 'cmd.exe') : (process.env.SHELL || '/bin/bash')
|
||||
};
|
||||
|
||||
const umask = {
|
||||
fromString: () => process.umask()
|
||||
};
|
||||
|
||||
let home = os.homedir();
|
||||
|
||||
if (home) {
|
||||
process.env.HOME = home;
|
||||
} else {
|
||||
home = path.resolve(temp, 'npm-' + uidOrPid);
|
||||
}
|
||||
|
||||
const cacheExtra = process.platform === 'win32' ? 'npm-cache' : '.npm';
|
||||
const cacheRoot = process.platform === 'win32' ? process.env.APPDATA : home;
|
||||
const cache = path.resolve(cacheRoot, cacheExtra);
|
||||
|
||||
let defaults;
|
||||
let globalPrefix;
|
||||
|
||||
${body}
|
||||
`;
|
||||
|
||||
const typesTemplate = body => `
|
||||
// Generated with \`lib/make.js\`
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const Stream = require('stream').Stream;
|
||||
const url = require('url');
|
||||
|
||||
const Umask = () => {};
|
||||
const getLocalAddresses = () => [];
|
||||
const semver = () => {};
|
||||
|
||||
${body}
|
||||
`;
|
||||
|
||||
const defaults = require.resolve('npm/lib/config/defaults');
|
||||
const ast = babylon.parse(fs.readFileSync(defaults, 'utf8'));
|
||||
|
||||
const isDefaults = node =>
|
||||
node.callee.type === 'MemberExpression' &&
|
||||
node.callee.object.name === 'Object' &&
|
||||
node.callee.property.name === 'defineProperty' &&
|
||||
node.arguments.some(x => x.name === 'exports');
|
||||
|
||||
const isTypes = node =>
|
||||
node.type === 'MemberExpression' &&
|
||||
node.object.name === 'exports' &&
|
||||
node.property.name === 'types';
|
||||
|
||||
let defs;
|
||||
let types;
|
||||
|
||||
traverse(ast, {
|
||||
CallExpression(path) {
|
||||
if (isDefaults(path.node)) {
|
||||
defs = path.node;
|
||||
}
|
||||
},
|
||||
AssignmentExpression(path) {
|
||||
if (path.node.left && isTypes(path.node.left)) {
|
||||
types = path.node;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
fs.writeFileSync(path.join(__dirname, 'defaults.js'), defaultsTemplate(generate(defs, {}, ast).code));
|
||||
fs.writeFileSync(path.join(__dirname, 'types.js'), typesTemplate(generate(types, {}, ast).code));
|
127
node_modules/npm-conf/lib/types.js
generated
vendored
127
node_modules/npm-conf/lib/types.js
generated
vendored
|
@ -1,127 +0,0 @@
|
|||
|
||||
// Generated with `lib/make.js`
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const Stream = require('stream').Stream;
|
||||
const url = require('url');
|
||||
|
||||
const Umask = () => {};
|
||||
const getLocalAddresses = () => [];
|
||||
const semver = () => {};
|
||||
|
||||
exports.types = {
|
||||
access: [null, 'restricted', 'public'],
|
||||
'allow-same-version': Boolean,
|
||||
'always-auth': Boolean,
|
||||
also: [null, 'dev', 'development'],
|
||||
'auth-type': ['legacy', 'sso', 'saml', 'oauth'],
|
||||
'bin-links': Boolean,
|
||||
browser: [null, String],
|
||||
ca: [null, String, Array],
|
||||
cafile: path,
|
||||
cache: path,
|
||||
'cache-lock-stale': Number,
|
||||
'cache-lock-retries': Number,
|
||||
'cache-lock-wait': Number,
|
||||
'cache-max': Number,
|
||||
'cache-min': Number,
|
||||
cert: [null, String],
|
||||
color: ['always', Boolean],
|
||||
depth: Number,
|
||||
description: Boolean,
|
||||
dev: Boolean,
|
||||
'dry-run': Boolean,
|
||||
editor: String,
|
||||
'engine-strict': Boolean,
|
||||
force: Boolean,
|
||||
'fetch-retries': Number,
|
||||
'fetch-retry-factor': Number,
|
||||
'fetch-retry-mintimeout': Number,
|
||||
'fetch-retry-maxtimeout': Number,
|
||||
git: String,
|
||||
'git-tag-version': Boolean,
|
||||
global: Boolean,
|
||||
globalconfig: path,
|
||||
'global-style': Boolean,
|
||||
group: [Number, String],
|
||||
'https-proxy': [null, url],
|
||||
'user-agent': String,
|
||||
'ham-it-up': Boolean,
|
||||
'heading': String,
|
||||
'if-present': Boolean,
|
||||
'ignore-prepublish': Boolean,
|
||||
'ignore-scripts': Boolean,
|
||||
'init-module': path,
|
||||
'init-author-name': String,
|
||||
'init-author-email': String,
|
||||
'init-author-url': ['', url],
|
||||
'init-license': String,
|
||||
'init-version': semver,
|
||||
json: Boolean,
|
||||
key: [null, String],
|
||||
'legacy-bundling': Boolean,
|
||||
link: Boolean,
|
||||
// local-address must be listed as an IP for a local network interface
|
||||
// must be IPv4 due to node bug
|
||||
'local-address': getLocalAddresses(),
|
||||
loglevel: ['silent', 'error', 'warn', 'notice', 'http', 'timing', 'info', 'verbose', 'silly'],
|
||||
logstream: Stream,
|
||||
'logs-max': Number,
|
||||
long: Boolean,
|
||||
maxsockets: Number,
|
||||
message: String,
|
||||
'metrics-registry': [null, String],
|
||||
'node-version': [null, semver],
|
||||
offline: Boolean,
|
||||
'onload-script': [null, String],
|
||||
only: [null, 'dev', 'development', 'prod', 'production'],
|
||||
optional: Boolean,
|
||||
'package-lock': Boolean,
|
||||
parseable: Boolean,
|
||||
'prefer-offline': Boolean,
|
||||
'prefer-online': Boolean,
|
||||
prefix: path,
|
||||
production: Boolean,
|
||||
progress: Boolean,
|
||||
'proprietary-attribs': Boolean,
|
||||
proxy: [null, false, url],
|
||||
// allow proxy to be disabled explicitly
|
||||
'rebuild-bundle': Boolean,
|
||||
registry: [null, url],
|
||||
rollback: Boolean,
|
||||
save: Boolean,
|
||||
'save-bundle': Boolean,
|
||||
'save-dev': Boolean,
|
||||
'save-exact': Boolean,
|
||||
'save-optional': Boolean,
|
||||
'save-prefix': String,
|
||||
'save-prod': Boolean,
|
||||
scope: String,
|
||||
'script-shell': [null, String],
|
||||
'scripts-prepend-node-path': [false, true, 'auto', 'warn-only'],
|
||||
searchopts: String,
|
||||
searchexclude: [null, String],
|
||||
searchlimit: Number,
|
||||
searchstaleness: Number,
|
||||
'send-metrics': Boolean,
|
||||
shell: String,
|
||||
shrinkwrap: Boolean,
|
||||
'sign-git-tag': Boolean,
|
||||
'sso-poll-frequency': Number,
|
||||
'sso-type': [null, 'oauth', 'saml'],
|
||||
'strict-ssl': Boolean,
|
||||
tag: String,
|
||||
timing: Boolean,
|
||||
tmp: path,
|
||||
unicode: Boolean,
|
||||
'unsafe-perm': Boolean,
|
||||
usage: Boolean,
|
||||
user: [Number, String],
|
||||
userconfig: path,
|
||||
umask: Umask,
|
||||
version: Boolean,
|
||||
'tag-version-prefix': String,
|
||||
versions: Boolean,
|
||||
viewer: String,
|
||||
_exit: Boolean
|
||||
}
|
147
node_modules/npm-conf/lib/util.js
generated
vendored
147
node_modules/npm-conf/lib/util.js
generated
vendored
|
@ -1,147 +0,0 @@
|
|||
'use strict';
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const types = require('./types');
|
||||
|
||||
// https://github.com/npm/npm/blob/latest/lib/config/core.js#L409-L423
|
||||
const envReplace = str => {
|
||||
if (typeof str !== 'string' || !str) {
|
||||
return str;
|
||||
}
|
||||
|
||||
// Replace any ${ENV} values with the appropriate environment
|
||||
const regex = /(\\*)\$\{([^}]+)\}/g;
|
||||
|
||||
return str.replace(regex, (orig, esc, name) => {
|
||||
esc = esc.length > 0 && esc.length % 2;
|
||||
|
||||
if (esc) {
|
||||
return orig;
|
||||
}
|
||||
|
||||
if (process.env[name] === undefined) {
|
||||
throw new Error(`Failed to replace env in config: ${orig}`);
|
||||
}
|
||||
|
||||
return process.env[name];
|
||||
});
|
||||
};
|
||||
|
||||
// https://github.com/npm/npm/blob/latest/lib/config/core.js#L362-L407
|
||||
const parseField = (field, key) => {
|
||||
if (typeof field !== 'string') {
|
||||
return field;
|
||||
}
|
||||
|
||||
const typeList = [].concat(types[key]);
|
||||
const isPath = typeList.indexOf(path) !== -1;
|
||||
const isBool = typeList.indexOf(Boolean) !== -1;
|
||||
const isString = typeList.indexOf(String) !== -1;
|
||||
const isNumber = typeList.indexOf(Number) !== -1;
|
||||
|
||||
field = `${field}`.trim();
|
||||
|
||||
if (/^".*"$/.test(field)) {
|
||||
try {
|
||||
field = JSON.parse(field);
|
||||
} catch (err) {
|
||||
throw new Error(`Failed parsing JSON config key ${key}: ${field}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (isBool && !isString && field === '') {
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (field) { // eslint-disable-line default-case
|
||||
case 'true': {
|
||||
return true;
|
||||
}
|
||||
|
||||
case 'false': {
|
||||
return false;
|
||||
}
|
||||
|
||||
case 'null': {
|
||||
return null;
|
||||
}
|
||||
|
||||
case 'undefined': {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
field = envReplace(field);
|
||||
|
||||
if (isPath) {
|
||||
const regex = process.platform === 'win32' ? /^~(\/|\\)/ : /^~\//;
|
||||
|
||||
if (regex.test(field) && process.env.HOME) {
|
||||
field = path.resolve(process.env.HOME, field.substr(2));
|
||||
}
|
||||
|
||||
field = path.resolve(field);
|
||||
}
|
||||
|
||||
if (isNumber && !field.isNan()) {
|
||||
field = Number(field);
|
||||
}
|
||||
|
||||
return field;
|
||||
};
|
||||
|
||||
// https://github.com/npm/npm/blob/latest/lib/config/find-prefix.js
|
||||
const findPrefix = name => {
|
||||
name = path.resolve(name);
|
||||
|
||||
let walkedUp = false;
|
||||
|
||||
while (path.basename(name) === 'node_modules') {
|
||||
name = path.dirname(name);
|
||||
walkedUp = true;
|
||||
}
|
||||
|
||||
if (walkedUp) {
|
||||
return name;
|
||||
}
|
||||
|
||||
const find = (name, original) => {
|
||||
const regex = /^[a-zA-Z]:(\\|\/)?$/;
|
||||
|
||||
if (name === '/' || (process.platform === 'win32' && regex.test(name))) {
|
||||
return original;
|
||||
}
|
||||
|
||||
try {
|
||||
const files = fs.readdirSync(name);
|
||||
|
||||
if (files.indexOf('node_modules') !== -1 || files.indexOf('package.json') !== -1) {
|
||||
return name;
|
||||
}
|
||||
|
||||
const dirname = path.dirname(name);
|
||||
|
||||
if (dirname === name) {
|
||||
return original;
|
||||
}
|
||||
|
||||
return find(dirname, original);
|
||||
} catch (err) {
|
||||
if (name === original) {
|
||||
if (err.code === 'ENOENT') {
|
||||
return original;
|
||||
}
|
||||
|
||||
throw err;
|
||||
}
|
||||
|
||||
return original;
|
||||
}
|
||||
};
|
||||
|
||||
return find(name, name);
|
||||
};
|
||||
|
||||
exports.envReplace = envReplace;
|
||||
exports.findPrefix = findPrefix;
|
||||
exports.parseField = parseField;
|
85
node_modules/npm-conf/package.json
generated
vendored
85
node_modules/npm-conf/package.json
generated
vendored
|
@ -1,85 +0,0 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"npm-conf@1.1.3",
|
||||
"/home/runner/work/ghaction-upx/ghaction-upx"
|
||||
]
|
||||
],
|
||||
"_from": "npm-conf@1.1.3",
|
||||
"_id": "npm-conf@1.1.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-Yic4bZHJOt9RCFbRP3GgpqhScOY4HH3V2P8yBj6CeYq118Qr+BLXqT2JvpJ00mryLESpgOxf5XlFv4ZjXxLScw==",
|
||||
"_location": "/npm-conf",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "npm-conf@1.1.3",
|
||||
"name": "npm-conf",
|
||||
"escapedName": "npm-conf",
|
||||
"rawSpec": "1.1.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.1.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/get-proxy"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/npm-conf/-/npm-conf-1.1.3.tgz",
|
||||
"_spec": "1.1.3",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx",
|
||||
"author": {
|
||||
"name": "Kevin Martensson",
|
||||
"email": "kevinmartensson@gmail.com",
|
||||
"url": "github.com/kevva"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/kevva/npm-conf/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"config-chain": "^1.1.11",
|
||||
"pify": "^3.0.0"
|
||||
},
|
||||
"description": "Get the npm config",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"babel-generator": "^6.24.1",
|
||||
"babel-traverse": "^6.24.1",
|
||||
"babylon": "^6.17.1",
|
||||
"npm": "^5.0.4",
|
||||
"xo": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"lib"
|
||||
],
|
||||
"homepage": "https://github.com/kevva/npm-conf#readme",
|
||||
"keywords": [
|
||||
"conf",
|
||||
"config",
|
||||
"global",
|
||||
"npm",
|
||||
"path",
|
||||
"prefix",
|
||||
"rc"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "npm-conf",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/kevva/npm-conf.git"
|
||||
},
|
||||
"scripts": {
|
||||
"prepublish": "node lib/make.js",
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "1.1.3",
|
||||
"xo": {
|
||||
"ignores": [
|
||||
"lib/defaults.js",
|
||||
"lib/types.js"
|
||||
]
|
||||
}
|
||||
}
|
47
node_modules/npm-conf/readme.md
generated
vendored
47
node_modules/npm-conf/readme.md
generated
vendored
|
@ -1,47 +0,0 @@
|
|||
# npm-conf [![Build Status](https://travis-ci.org/kevva/npm-conf.svg?branch=master)](https://travis-ci.org/kevva/npm-conf)
|
||||
|
||||
> Get the npm config
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install npm-conf
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const npmConf = require('npm-conf');
|
||||
|
||||
const conf = npmConf();
|
||||
|
||||
conf.get('prefix')
|
||||
//=> //=> /Users/unicorn/.npm-packages
|
||||
|
||||
conf.get('registry')
|
||||
//=> https://registry.npmjs.org/
|
||||
```
|
||||
|
||||
To get a list of all available `npm` config options:
|
||||
|
||||
```bash
|
||||
$ npm config list --long
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### npmConf()
|
||||
|
||||
Returns the `npm` config.
|
||||
|
||||
### npmConf.defaults
|
||||
|
||||
Returns the default `npm` config.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Kevin Mårtensson](https://github.com/kevva)
|
84
node_modules/pify/index.js
generated
vendored
84
node_modules/pify/index.js
generated
vendored
|
@ -1,83 +1,67 @@
|
|||
'use strict';
|
||||
|
||||
const processFn = (fn, opts) => function () {
|
||||
const P = opts.promiseModule;
|
||||
const args = new Array(arguments.length);
|
||||
|
||||
for (let i = 0; i < arguments.length; i++) {
|
||||
args[i] = arguments[i];
|
||||
}
|
||||
const processFn = (fn, options) => function (...args) {
|
||||
const P = options.promiseModule;
|
||||
|
||||
return new P((resolve, reject) => {
|
||||
if (opts.errorFirst) {
|
||||
args.push(function (err, result) {
|
||||
if (opts.multiArgs) {
|
||||
const results = new Array(arguments.length - 1);
|
||||
|
||||
for (let i = 1; i < arguments.length; i++) {
|
||||
results[i - 1] = arguments[i];
|
||||
}
|
||||
|
||||
if (err) {
|
||||
results.unshift(err);
|
||||
reject(results);
|
||||
if (options.multiArgs) {
|
||||
args.push((...result) => {
|
||||
if (options.errorFirst) {
|
||||
if (result[0]) {
|
||||
reject(result);
|
||||
} else {
|
||||
resolve(results);
|
||||
result.shift();
|
||||
resolve(result);
|
||||
}
|
||||
} else if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
resolve(result);
|
||||
}
|
||||
});
|
||||
} else if (options.errorFirst) {
|
||||
args.push((error, result) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
resolve(result);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
args.push(function (result) {
|
||||
if (opts.multiArgs) {
|
||||
const results = new Array(arguments.length - 1);
|
||||
|
||||
for (let i = 0; i < arguments.length; i++) {
|
||||
results[i] = arguments[i];
|
||||
}
|
||||
|
||||
resolve(results);
|
||||
} else {
|
||||
resolve(result);
|
||||
}
|
||||
});
|
||||
args.push(resolve);
|
||||
}
|
||||
|
||||
fn.apply(this, args);
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = (obj, opts) => {
|
||||
opts = Object.assign({
|
||||
module.exports = (input, options) => {
|
||||
options = Object.assign({
|
||||
exclude: [/.+(Sync|Stream)$/],
|
||||
errorFirst: true,
|
||||
promiseModule: Promise
|
||||
}, opts);
|
||||
}, options);
|
||||
|
||||
const objType = typeof input;
|
||||
if (!(input !== null && (objType === 'object' || objType === 'function'))) {
|
||||
throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${input === null ? 'null' : objType}\``);
|
||||
}
|
||||
|
||||
const filter = key => {
|
||||
const match = pattern => typeof pattern === 'string' ? key === pattern : pattern.test(key);
|
||||
return opts.include ? opts.include.some(match) : !opts.exclude.some(match);
|
||||
return options.include ? options.include.some(match) : !options.exclude.some(match);
|
||||
};
|
||||
|
||||
let ret;
|
||||
if (typeof obj === 'function') {
|
||||
ret = function () {
|
||||
if (opts.excludeMain) {
|
||||
return obj.apply(this, arguments);
|
||||
}
|
||||
|
||||
return processFn(obj, opts).apply(this, arguments);
|
||||
if (objType === 'function') {
|
||||
ret = function (...args) {
|
||||
return options.excludeMain ? input(...args) : processFn(input, options).apply(this, args);
|
||||
};
|
||||
} else {
|
||||
ret = Object.create(Object.getPrototypeOf(obj));
|
||||
ret = Object.create(Object.getPrototypeOf(input));
|
||||
}
|
||||
|
||||
for (const key in obj) { // eslint-disable-line guard-for-in
|
||||
const x = obj[key];
|
||||
ret[key] = typeof x === 'function' && filter(key) ? processFn(x, opts) : x;
|
||||
for (const key in input) { // eslint-disable-line guard-for-in
|
||||
const property = input[key];
|
||||
ret[key] = typeof property === 'function' && filter(key) ? processFn(property, options) : property;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
34
node_modules/pify/package.json
generated
vendored
34
node_modules/pify/package.json
generated
vendored
|
@ -1,34 +1,32 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"pify@3.0.0",
|
||||
"pify@4.0.1",
|
||||
"/home/runner/work/ghaction-upx/ghaction-upx"
|
||||
]
|
||||
],
|
||||
"_from": "pify@3.0.0",
|
||||
"_id": "pify@3.0.0",
|
||||
"_from": "pify@4.0.1",
|
||||
"_id": "pify@4.0.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
|
||||
"_integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
|
||||
"_location": "/pify",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "pify@3.0.0",
|
||||
"raw": "pify@4.0.1",
|
||||
"name": "pify",
|
||||
"escapedName": "pify",
|
||||
"rawSpec": "3.0.0",
|
||||
"rawSpec": "4.0.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "3.0.0"
|
||||
"fetchSpec": "4.0.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/download",
|
||||
"/got",
|
||||
"/make-dir",
|
||||
"/npm-conf"
|
||||
"/make-dir"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
|
||||
"_spec": "3.0.0",
|
||||
"_resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
|
||||
"_spec": "4.0.1",
|
||||
"_where": "/home/runner/work/ghaction-upx/ghaction-upx",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
|
@ -40,13 +38,13 @@
|
|||
},
|
||||
"description": "Promisify a callback-style function",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"ava": "^0.25.0",
|
||||
"pinkie-promise": "^2.0.0",
|
||||
"v8-natives": "^1.0.0",
|
||||
"xo": "*"
|
||||
"v8-natives": "^1.1.0",
|
||||
"xo": "^0.23.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
"node": ">=6"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
|
@ -83,7 +81,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"optimization-test": "node --allow-natives-syntax optimization-test.js",
|
||||
"test": "xo && ava && npm run optimization-test"
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "3.0.0"
|
||||
"version": "4.0.1"
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user