mirror of
https://github.com/musix-org/musix-oss
synced 2025-06-16 15:46:00 +00:00
fix
This commit is contained in:
26
node_modules/decompress-targz/index.js
generated
vendored
Normal file
26
node_modules/decompress-targz/index.js
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
'use strict';
|
||||
const zlib = require('zlib');
|
||||
const decompressTar = require('decompress-tar');
|
||||
const fileType = require('file-type');
|
||||
const isStream = require('is-stream');
|
||||
|
||||
module.exports = () => input => {
|
||||
if (!Buffer.isBuffer(input) && !isStream(input)) {
|
||||
return Promise.reject(new TypeError(`Expected a Buffer or Stream, got ${typeof input}`));
|
||||
}
|
||||
|
||||
if (Buffer.isBuffer(input) && (!fileType(input) || fileType(input).ext !== 'gz')) {
|
||||
return Promise.resolve([]);
|
||||
}
|
||||
|
||||
const unzip = zlib.createGunzip();
|
||||
const result = decompressTar()(unzip);
|
||||
|
||||
if (Buffer.isBuffer(input)) {
|
||||
unzip.end(input);
|
||||
} else {
|
||||
input.pipe(unzip);
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
9
node_modules/decompress-targz/license
generated
vendored
Normal file
9
node_modules/decompress-targz/license
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
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:
|
||||
|
||||
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.
|
71
node_modules/decompress-targz/package.json
generated
vendored
Normal file
71
node_modules/decompress-targz/package.json
generated
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
{
|
||||
"_from": "decompress-targz@^4.0.0",
|
||||
"_id": "decompress-targz@4.1.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==",
|
||||
"_location": "/decompress-targz",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "decompress-targz@^4.0.0",
|
||||
"name": "decompress-targz",
|
||||
"escapedName": "decompress-targz",
|
||||
"rawSpec": "^4.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^4.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/decompress"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/decompress-targz/-/decompress-targz-4.1.1.tgz",
|
||||
"_shasum": "c09bc35c4d11f3de09f2d2da53e9de23e7ce1eee",
|
||||
"_spec": "decompress-targz@^4.0.0",
|
||||
"_where": "C:\\Users\\matia\\Musix\\node_modules\\decompress",
|
||||
"author": {
|
||||
"name": "Kevin Mårtensson",
|
||||
"email": "kevinmartensson@gmail.com",
|
||||
"url": "https://github.com/kevva"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/kevva/decompress-targz/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"decompress-tar": "^4.1.1",
|
||||
"file-type": "^5.2.0",
|
||||
"is-stream": "^1.1.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "decompress tar.gz plugin",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"is-jpg": "^1.0.0",
|
||||
"pify": "^3.0.0",
|
||||
"xo": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/kevva/decompress-targz#readme",
|
||||
"keywords": [
|
||||
"decompress",
|
||||
"decompressplugin",
|
||||
"extract",
|
||||
"tar.gz",
|
||||
"targz"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "decompress-targz",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/kevva/decompress-targz.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "4.1.1"
|
||||
}
|
44
node_modules/decompress-targz/readme.md
generated
vendored
Normal file
44
node_modules/decompress-targz/readme.md
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
# decompress-targz [](https://travis-ci.org/kevva/decompress-targz)
|
||||
|
||||
> tar.gz decompress plugin
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install decompress-targz
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const decompress = require('decompress');
|
||||
const decompressTargz = require('decompress-targz');
|
||||
|
||||
decompress('unicorn.tar.gz', 'dist', {
|
||||
plugins: [
|
||||
decompressTargz()
|
||||
]
|
||||
}).then(() => {
|
||||
console.log('Files decompressed');
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### decompressTargz()(input)
|
||||
|
||||
Returns both a Promise for a Buffer and a [Duplex stream](https://nodejs.org/api/stream.html#stream_class_stream_duplex).
|
||||
|
||||
#### input
|
||||
|
||||
Type: `Buffer` `Stream`
|
||||
|
||||
Buffer or stream to decompress.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Kevin Mårtensson](https://github.com/kevva)
|
Reference in New Issue
Block a user