schnee effeckt und fehler Korektur
This commit is contained in:
170
node_modules/decompress-unzip/index.js
generated
vendored
170
node_modules/decompress-unzip/index.js
generated
vendored
@@ -1,110 +1,86 @@
|
||||
'use strict';
|
||||
const fileType = require('file-type');
|
||||
const getStream = require('get-stream');
|
||||
const pify = require('pify');
|
||||
const yauzl = require('yauzl');
|
||||
|
||||
var fs = require('fs');
|
||||
var isZip = require('is-zip');
|
||||
var StatMode = require('stat-mode');
|
||||
var readAllStream = require('read-all-stream');
|
||||
var stripDirs = require('strip-dirs');
|
||||
var through = require('through2');
|
||||
var Vinyl = require('vinyl');
|
||||
var yauzl = require('yauzl');
|
||||
const getType = (entry, mode) => {
|
||||
const IFMT = 61440;
|
||||
const IFDIR = 16384;
|
||||
const IFLNK = 40960;
|
||||
const madeBy = entry.versionMadeBy >> 8;
|
||||
|
||||
module.exports = function (opts) {
|
||||
opts = opts || {};
|
||||
opts.strip = Number(opts.strip) || 0;
|
||||
if ((mode & IFMT) === IFLNK) {
|
||||
return 'symlink';
|
||||
}
|
||||
|
||||
return through.obj(function (file, enc, cb) {
|
||||
var self = this;
|
||||
if ((mode & IFMT) === IFDIR || (madeBy === 0 && entry.externalFileAttributes === 16)) {
|
||||
return 'directory';
|
||||
}
|
||||
|
||||
if (file.isNull()) {
|
||||
cb(null, file);
|
||||
return;
|
||||
}
|
||||
return 'file';
|
||||
};
|
||||
|
||||
if (file.isStream()) {
|
||||
cb(new Error('Streaming is not supported'));
|
||||
return;
|
||||
}
|
||||
const extractEntry = (entry, zip) => {
|
||||
const file = {
|
||||
mode: (entry.externalFileAttributes >> 16) & 0xFFFF,
|
||||
mtime: entry.getLastModDate(),
|
||||
path: entry.fileName
|
||||
};
|
||||
|
||||
if (!file.extract || !isZip(file.contents)) {
|
||||
cb(null, file);
|
||||
return;
|
||||
}
|
||||
file.type = getType(entry, file.mode);
|
||||
|
||||
yauzl.fromBuffer(file.contents, function (err, zipFile) {
|
||||
var count = 0;
|
||||
if (file.mode === 0 && file.type === 'directory') {
|
||||
file.mode = 493;
|
||||
}
|
||||
|
||||
if (err) {
|
||||
cb(err);
|
||||
return;
|
||||
if (file.mode === 0) {
|
||||
file.mode = 420;
|
||||
}
|
||||
|
||||
return pify(zip.openReadStream.bind(zip))(entry)
|
||||
.then(getStream.buffer)
|
||||
.then(buf => {
|
||||
file.data = buf;
|
||||
|
||||
if (file.type === 'symlink') {
|
||||
file.linkname = buf.toString();
|
||||
}
|
||||
|
||||
zipFile.on('error', cb);
|
||||
zipFile.on('entry', function (entry) {
|
||||
var filePath = stripDirs(entry.fileName, opts.strip);
|
||||
|
||||
if (filePath === '.') {
|
||||
if (++count === zipFile.entryCount) {
|
||||
cb();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var stat = new fs.Stats();
|
||||
var mode = (entry.externalFileAttributes >> 16) & 0xFFFF;
|
||||
|
||||
stat.mode = mode;
|
||||
|
||||
if (entry.getLastModDate()) {
|
||||
stat.mtime = entry.getLastModDate();
|
||||
}
|
||||
|
||||
if (entry.fileName.charAt(entry.fileName.length - 1) === '/') {
|
||||
if (!mode) {
|
||||
new StatMode(stat).isDirectory(true);
|
||||
}
|
||||
|
||||
self.push(new Vinyl({
|
||||
path: filePath,
|
||||
stat: stat
|
||||
}));
|
||||
|
||||
if (++count === zipFile.entryCount) {
|
||||
cb();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
zipFile.openReadStream(entry, function (err, readStream) {
|
||||
if (err) {
|
||||
cb(err);
|
||||
return;
|
||||
}
|
||||
|
||||
readAllStream(readStream, null, function (err, data) {
|
||||
if (err) {
|
||||
cb(err);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mode) {
|
||||
new StatMode(stat).isFile(true);
|
||||
}
|
||||
|
||||
self.push(new Vinyl({
|
||||
contents: data,
|
||||
path: filePath,
|
||||
stat: stat
|
||||
}));
|
||||
|
||||
if (++count === zipFile.entryCount) {
|
||||
cb();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
return file;
|
||||
})
|
||||
.catch(err => {
|
||||
zip.close();
|
||||
throw err;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const extractFile = zip => new Promise((resolve, reject) => {
|
||||
const files = [];
|
||||
|
||||
zip.readEntry();
|
||||
|
||||
zip.on('entry', entry => {
|
||||
extractEntry(entry, zip)
|
||||
.catch(reject)
|
||||
.then(file => {
|
||||
files.push(file);
|
||||
zip.readEntry();
|
||||
});
|
||||
});
|
||||
|
||||
zip.on('error', reject);
|
||||
zip.on('end', () => resolve(files));
|
||||
});
|
||||
|
||||
module.exports = () => buf => {
|
||||
if (!Buffer.isBuffer(buf)) {
|
||||
return Promise.reject(new TypeError(`Expected a Buffer, got ${typeof buf}`));
|
||||
}
|
||||
|
||||
if (!fileType(buf) || fileType(buf).ext !== 'zip') {
|
||||
return Promise.resolve([]);
|
||||
}
|
||||
|
||||
return pify(yauzl.fromBuffer)(buf, {lazyEntries: true}).then(extractFile);
|
||||
};
|
||||
|
||||
17
node_modules/decompress-unzip/node_modules/clone-stats/README.md
generated
vendored
17
node_modules/decompress-unzip/node_modules/clone-stats/README.md
generated
vendored
@@ -1,17 +0,0 @@
|
||||
# clone-stats [](https://flattr.com/submit/auto?user_id=hughskennedy&url=http://github.com/hughsk/clone-stats&title=clone-stats&description=hughsk/clone-stats%20on%20GitHub&language=en_GB&tags=flattr,github,javascript&category=software)[](http://github.com/hughsk/stability-badges) #
|
||||
|
||||
Safely clone node's
|
||||
[`fs.Stats`](http://nodejs.org/api/fs.html#fs_class_fs_stats) instances without
|
||||
losing their class methods, i.e. `stat.isDirectory()` and co.
|
||||
|
||||
## Usage ##
|
||||
|
||||
[](https://nodei.co/npm/clone-stats)
|
||||
|
||||
### `copy = require('clone-stats')(stat)` ###
|
||||
|
||||
Returns a clone of the original `fs.Stats` instance (`stat`).
|
||||
|
||||
## License ##
|
||||
|
||||
MIT. See [LICENSE.md](http://github.com/hughsk/clone-stats/blob/master/LICENSE.md) for details.
|
||||
13
node_modules/decompress-unzip/node_modules/clone-stats/index.js
generated
vendored
13
node_modules/decompress-unzip/node_modules/clone-stats/index.js
generated
vendored
@@ -1,13 +0,0 @@
|
||||
var Stat = require('fs').Stats
|
||||
|
||||
module.exports = cloneStats
|
||||
|
||||
function cloneStats(stats) {
|
||||
var replacement = new Stat
|
||||
|
||||
Object.keys(stats).forEach(function(key) {
|
||||
replacement[key] = stats[key]
|
||||
})
|
||||
|
||||
return replacement
|
||||
}
|
||||
31
node_modules/decompress-unzip/node_modules/clone-stats/package.json
generated
vendored
31
node_modules/decompress-unzip/node_modules/clone-stats/package.json
generated
vendored
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"name": "clone-stats",
|
||||
"description": "Safely clone node's fs.Stats instances without losing their class methods",
|
||||
"version": "0.0.1",
|
||||
"main": "index.js",
|
||||
"browser": "index.js",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"tape": "~2.3.2"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test"
|
||||
},
|
||||
"author": "Hugh Kennedy <hughskennedy@gmail.com> (http://hughsk.io/)",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/hughsk/clone-stats"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/hughsk/clone-stats/issues"
|
||||
},
|
||||
"homepage": "https://github.com/hughsk/clone-stats",
|
||||
"keywords": [
|
||||
"stats",
|
||||
"fs",
|
||||
"clone",
|
||||
"copy",
|
||||
"prototype"
|
||||
]
|
||||
}
|
||||
36
node_modules/decompress-unzip/node_modules/clone-stats/test.js
generated
vendored
36
node_modules/decompress-unzip/node_modules/clone-stats/test.js
generated
vendored
@@ -1,36 +0,0 @@
|
||||
var test = require('tape')
|
||||
var clone = require('./')
|
||||
var fs = require('fs')
|
||||
|
||||
test('file', function(t) {
|
||||
compare(t, fs.statSync(__filename))
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('directory', function(t) {
|
||||
compare(t, fs.statSync(__dirname))
|
||||
t.end()
|
||||
})
|
||||
|
||||
function compare(t, stat) {
|
||||
var copy = clone(stat)
|
||||
|
||||
t.deepEqual(stat, copy, 'clone has equal properties')
|
||||
t.ok(stat instanceof fs.Stats, 'original is an fs.Stat')
|
||||
t.ok(copy instanceof fs.Stats, 'copy is an fs.Stat')
|
||||
|
||||
;['isDirectory'
|
||||
, 'isFile'
|
||||
, 'isBlockDevice'
|
||||
, 'isCharacterDevice'
|
||||
, 'isSymbolicLink'
|
||||
, 'isFIFO'
|
||||
, 'isSocket'
|
||||
].forEach(function(method) {
|
||||
t.equal(
|
||||
stat[method].call(stat)
|
||||
, copy[method].call(copy)
|
||||
, 'equal value for stat.' + method + '()'
|
||||
)
|
||||
})
|
||||
}
|
||||
4
node_modules/decompress-unzip/node_modules/clone/.npmignore
generated
vendored
4
node_modules/decompress-unzip/node_modules/clone/.npmignore
generated
vendored
@@ -1,4 +0,0 @@
|
||||
/node_modules/
|
||||
/test.js
|
||||
/*.html
|
||||
/.travis.yml
|
||||
18
node_modules/decompress-unzip/node_modules/clone/LICENSE
generated
vendored
18
node_modules/decompress-unzip/node_modules/clone/LICENSE
generated
vendored
@@ -1,18 +0,0 @@
|
||||
Copyright © 2011-2015 Paul Vorbach <paul@vorba.ch>
|
||||
|
||||
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, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
126
node_modules/decompress-unzip/node_modules/clone/README.md
generated
vendored
126
node_modules/decompress-unzip/node_modules/clone/README.md
generated
vendored
@@ -1,126 +0,0 @@
|
||||
# clone
|
||||
|
||||
[](http://travis-ci.org/pvorb/node-clone)
|
||||
|
||||
[](http://npm-stat.com/charts.html?package=clone)
|
||||
|
||||
offers foolproof _deep cloning_ of objects, arrays, numbers, strings etc. in JavaScript.
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
npm install clone
|
||||
|
||||
(It also works with browserify, ender or standalone.)
|
||||
|
||||
|
||||
## Example
|
||||
|
||||
~~~ javascript
|
||||
var clone = require('clone');
|
||||
|
||||
var a, b;
|
||||
|
||||
a = { foo: { bar: 'baz' } }; // initial value of a
|
||||
|
||||
b = clone(a); // clone a -> b
|
||||
a.foo.bar = 'foo'; // change a
|
||||
|
||||
console.log(a); // show a
|
||||
console.log(b); // show b
|
||||
~~~
|
||||
|
||||
This will print:
|
||||
|
||||
~~~ javascript
|
||||
{ foo: { bar: 'foo' } }
|
||||
{ foo: { bar: 'baz' } }
|
||||
~~~
|
||||
|
||||
**clone** masters cloning simple objects (even with custom prototype), arrays,
|
||||
Date objects, and RegExp objects. Everything is cloned recursively, so that you
|
||||
can clone dates in arrays in objects, for example.
|
||||
|
||||
|
||||
## API
|
||||
|
||||
`clone(val, circular, depth)`
|
||||
|
||||
* `val` -- the value that you want to clone, any type allowed
|
||||
* `circular` -- boolean
|
||||
|
||||
Call `clone` with `circular` set to `false` if you are certain that `obj`
|
||||
contains no circular references. This will give better performance if needed.
|
||||
There is no error if `undefined` or `null` is passed as `obj`.
|
||||
* `depth` -- depth to which the object is to be cloned (optional,
|
||||
defaults to infinity)
|
||||
|
||||
`clone.clonePrototype(obj)`
|
||||
|
||||
* `obj` -- the object that you want to clone
|
||||
|
||||
Does a prototype clone as
|
||||
[described by Oran Looney](http://oranlooney.com/functional-javascript/).
|
||||
|
||||
|
||||
## Circular References
|
||||
|
||||
~~~ javascript
|
||||
var a, b;
|
||||
|
||||
a = { hello: 'world' };
|
||||
|
||||
a.myself = a;
|
||||
b = clone(a);
|
||||
|
||||
console.log(b);
|
||||
~~~
|
||||
|
||||
This will print:
|
||||
|
||||
~~~ javascript
|
||||
{ hello: "world", myself: [Circular] }
|
||||
~~~
|
||||
|
||||
So, `b.myself` points to `b`, not `a`. Neat!
|
||||
|
||||
|
||||
## Test
|
||||
|
||||
npm test
|
||||
|
||||
|
||||
## Caveat
|
||||
|
||||
Some special objects like a socket or `process.stdout`/`stderr` are known to not
|
||||
be cloneable. If you find other objects that cannot be cloned, please [open an
|
||||
issue](https://github.com/pvorb/node-clone/issues/new).
|
||||
|
||||
|
||||
## Bugs and Issues
|
||||
|
||||
If you encounter any bugs or issues, feel free to [open an issue at
|
||||
github](https://github.com/pvorb/node-clone/issues) or send me an email to
|
||||
<paul@vorba.ch>. I also always like to hear from you, if you’re using my code.
|
||||
|
||||
## License
|
||||
|
||||
Copyright © 2011-2015 [Paul Vorbach](http://paul.vorba.ch/) and
|
||||
[contributors](https://github.com/pvorb/node-clone/graphs/contributors).
|
||||
|
||||
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, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
10
node_modules/decompress-unzip/node_modules/clone/clone.iml
generated
vendored
10
node_modules/decompress-unzip/node_modules/clone/clone.iml
generated
vendored
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="clone node_modules" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
166
node_modules/decompress-unzip/node_modules/clone/clone.js
generated
vendored
166
node_modules/decompress-unzip/node_modules/clone/clone.js
generated
vendored
@@ -1,166 +0,0 @@
|
||||
var clone = (function() {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Clones (copies) an Object using deep copying.
|
||||
*
|
||||
* This function supports circular references by default, but if you are certain
|
||||
* there are no circular references in your object, you can save some CPU time
|
||||
* by calling clone(obj, false).
|
||||
*
|
||||
* Caution: if `circular` is false and `parent` contains circular references,
|
||||
* your program may enter an infinite loop and crash.
|
||||
*
|
||||
* @param `parent` - the object to be cloned
|
||||
* @param `circular` - set to true if the object to be cloned may contain
|
||||
* circular references. (optional - true by default)
|
||||
* @param `depth` - set to a number if the object is only to be cloned to
|
||||
* a particular depth. (optional - defaults to Infinity)
|
||||
* @param `prototype` - sets the prototype to be used when cloning an object.
|
||||
* (optional - defaults to parent prototype).
|
||||
*/
|
||||
function clone(parent, circular, depth, prototype) {
|
||||
var filter;
|
||||
if (typeof circular === 'object') {
|
||||
depth = circular.depth;
|
||||
prototype = circular.prototype;
|
||||
filter = circular.filter;
|
||||
circular = circular.circular
|
||||
}
|
||||
// maintain two arrays for circular references, where corresponding parents
|
||||
// and children have the same index
|
||||
var allParents = [];
|
||||
var allChildren = [];
|
||||
|
||||
var useBuffer = typeof Buffer != 'undefined';
|
||||
|
||||
if (typeof circular == 'undefined')
|
||||
circular = true;
|
||||
|
||||
if (typeof depth == 'undefined')
|
||||
depth = Infinity;
|
||||
|
||||
// recurse this function so we don't reset allParents and allChildren
|
||||
function _clone(parent, depth) {
|
||||
// cloning null always returns null
|
||||
if (parent === null)
|
||||
return null;
|
||||
|
||||
if (depth == 0)
|
||||
return parent;
|
||||
|
||||
var child;
|
||||
var proto;
|
||||
if (typeof parent != 'object') {
|
||||
return parent;
|
||||
}
|
||||
|
||||
if (clone.__isArray(parent)) {
|
||||
child = [];
|
||||
} else if (clone.__isRegExp(parent)) {
|
||||
child = new RegExp(parent.source, __getRegExpFlags(parent));
|
||||
if (parent.lastIndex) child.lastIndex = parent.lastIndex;
|
||||
} else if (clone.__isDate(parent)) {
|
||||
child = new Date(parent.getTime());
|
||||
} else if (useBuffer && Buffer.isBuffer(parent)) {
|
||||
if (Buffer.allocUnsafe) {
|
||||
// Node.js >= 4.5.0
|
||||
child = Buffer.allocUnsafe(parent.length);
|
||||
} else {
|
||||
// Older Node.js versions
|
||||
child = new Buffer(parent.length);
|
||||
}
|
||||
parent.copy(child);
|
||||
return child;
|
||||
} else {
|
||||
if (typeof prototype == 'undefined') {
|
||||
proto = Object.getPrototypeOf(parent);
|
||||
child = Object.create(proto);
|
||||
}
|
||||
else {
|
||||
child = Object.create(prototype);
|
||||
proto = prototype;
|
||||
}
|
||||
}
|
||||
|
||||
if (circular) {
|
||||
var index = allParents.indexOf(parent);
|
||||
|
||||
if (index != -1) {
|
||||
return allChildren[index];
|
||||
}
|
||||
allParents.push(parent);
|
||||
allChildren.push(child);
|
||||
}
|
||||
|
||||
for (var i in parent) {
|
||||
var attrs;
|
||||
if (proto) {
|
||||
attrs = Object.getOwnPropertyDescriptor(proto, i);
|
||||
}
|
||||
|
||||
if (attrs && attrs.set == null) {
|
||||
continue;
|
||||
}
|
||||
child[i] = _clone(parent[i], depth - 1);
|
||||
}
|
||||
|
||||
return child;
|
||||
}
|
||||
|
||||
return _clone(parent, depth);
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple flat clone using prototype, accepts only objects, usefull for property
|
||||
* override on FLAT configuration object (no nested props).
|
||||
*
|
||||
* USE WITH CAUTION! This may not behave as you wish if you do not know how this
|
||||
* works.
|
||||
*/
|
||||
clone.clonePrototype = function clonePrototype(parent) {
|
||||
if (parent === null)
|
||||
return null;
|
||||
|
||||
var c = function () {};
|
||||
c.prototype = parent;
|
||||
return new c();
|
||||
};
|
||||
|
||||
// private utility functions
|
||||
|
||||
function __objToStr(o) {
|
||||
return Object.prototype.toString.call(o);
|
||||
};
|
||||
clone.__objToStr = __objToStr;
|
||||
|
||||
function __isDate(o) {
|
||||
return typeof o === 'object' && __objToStr(o) === '[object Date]';
|
||||
};
|
||||
clone.__isDate = __isDate;
|
||||
|
||||
function __isArray(o) {
|
||||
return typeof o === 'object' && __objToStr(o) === '[object Array]';
|
||||
};
|
||||
clone.__isArray = __isArray;
|
||||
|
||||
function __isRegExp(o) {
|
||||
return typeof o === 'object' && __objToStr(o) === '[object RegExp]';
|
||||
};
|
||||
clone.__isRegExp = __isRegExp;
|
||||
|
||||
function __getRegExpFlags(re) {
|
||||
var flags = '';
|
||||
if (re.global) flags += 'g';
|
||||
if (re.ignoreCase) flags += 'i';
|
||||
if (re.multiline) flags += 'm';
|
||||
return flags;
|
||||
};
|
||||
clone.__getRegExpFlags = __getRegExpFlags;
|
||||
|
||||
return clone;
|
||||
})();
|
||||
|
||||
if (typeof module === 'object' && module.exports) {
|
||||
module.exports = clone;
|
||||
}
|
||||
51
node_modules/decompress-unzip/node_modules/clone/package.json
generated
vendored
51
node_modules/decompress-unzip/node_modules/clone/package.json
generated
vendored
@@ -1,51 +0,0 @@
|
||||
{
|
||||
"name": "clone",
|
||||
"description": "deep cloning of objects and arrays",
|
||||
"tags": [
|
||||
"clone",
|
||||
"object",
|
||||
"array",
|
||||
"function",
|
||||
"date"
|
||||
],
|
||||
"version": "1.0.4",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/pvorb/node-clone.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/pvorb/node-clone/issues"
|
||||
},
|
||||
"main": "clone.js",
|
||||
"author": "Paul Vorbach <paul@vorba.ch> (http://paul.vorba.ch/)",
|
||||
"contributors": [
|
||||
"Blake Miner <miner.blake@gmail.com> (http://www.blakeminer.com/)",
|
||||
"Tian You <axqd001@gmail.com> (http://blog.axqd.net/)",
|
||||
"George Stagas <gstagas@gmail.com> (http://stagas.com/)",
|
||||
"Tobiasz Cudnik <tobiasz.cudnik@gmail.com> (https://github.com/TobiaszCudnik)",
|
||||
"Pavel Lang <langpavel@phpskelet.org> (https://github.com/langpavel)",
|
||||
"Dan MacTough (http://yabfog.com/)",
|
||||
"w1nk (https://github.com/w1nk)",
|
||||
"Hugh Kennedy (http://twitter.com/hughskennedy)",
|
||||
"Dustin Diaz (http://dustindiaz.com)",
|
||||
"Ilya Shaisultanov (https://github.com/diversario)",
|
||||
"Nathan MacInnes <nathan@macinn.es> (http://macinn.es/)",
|
||||
"Benjamin E. Coe <ben@npmjs.com> (https://twitter.com/benjamincoe)",
|
||||
"Nathan Zadoks (https://github.com/nathan7)",
|
||||
"Róbert Oroszi <robert+gh@oroszi.net> (https://github.com/oroce)",
|
||||
"Aurélio A. Heckert (http://softwarelivre.org/aurium)",
|
||||
"Guy Ellis (http://www.guyellisrocks.com/)"
|
||||
],
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"nodeunit": "~0.9.0"
|
||||
},
|
||||
"optionalDependencies": {},
|
||||
"scripts": {
|
||||
"test": "nodeunit test.js"
|
||||
}
|
||||
}
|
||||
452
node_modules/decompress-unzip/node_modules/file-type/index.js
generated
vendored
Normal file
452
node_modules/decompress-unzip/node_modules/file-type/index.js
generated
vendored
Normal file
@@ -0,0 +1,452 @@
|
||||
'use strict';
|
||||
module.exports = function (buf) {
|
||||
if (!(buf && buf.length > 1)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (buf[0] === 0xFF && buf[1] === 0xD8 && buf[2] === 0xFF) {
|
||||
return {
|
||||
ext: 'jpg',
|
||||
mime: 'image/jpeg'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x89 && buf[1] === 0x50 && buf[2] === 0x4E && buf[3] === 0x47) {
|
||||
return {
|
||||
ext: 'png',
|
||||
mime: 'image/png'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x47 && buf[1] === 0x49 && buf[2] === 0x46) {
|
||||
return {
|
||||
ext: 'gif',
|
||||
mime: 'image/gif'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[8] === 0x57 && buf[9] === 0x45 && buf[10] === 0x42 && buf[11] === 0x50) {
|
||||
return {
|
||||
ext: 'webp',
|
||||
mime: 'image/webp'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x46 && buf[1] === 0x4C && buf[2] === 0x49 && buf[3] === 0x46) {
|
||||
return {
|
||||
ext: 'flif',
|
||||
mime: 'image/flif'
|
||||
};
|
||||
}
|
||||
|
||||
// needs to be before `tif` check
|
||||
if (((buf[0] === 0x49 && buf[1] === 0x49 && buf[2] === 0x2A && buf[3] === 0x0) || (buf[0] === 0x4D && buf[1] === 0x4D && buf[2] === 0x0 && buf[3] === 0x2A)) && buf[8] === 0x43 && buf[9] === 0x52) {
|
||||
return {
|
||||
ext: 'cr2',
|
||||
mime: 'image/x-canon-cr2'
|
||||
};
|
||||
}
|
||||
|
||||
if ((buf[0] === 0x49 && buf[1] === 0x49 && buf[2] === 0x2A && buf[3] === 0x0) || (buf[0] === 0x4D && buf[1] === 0x4D && buf[2] === 0x0 && buf[3] === 0x2A)) {
|
||||
return {
|
||||
ext: 'tif',
|
||||
mime: 'image/tiff'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x42 && buf[1] === 0x4D) {
|
||||
return {
|
||||
ext: 'bmp',
|
||||
mime: 'image/bmp'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x49 && buf[1] === 0x49 && buf[2] === 0xBC) {
|
||||
return {
|
||||
ext: 'jxr',
|
||||
mime: 'image/vnd.ms-photo'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x38 && buf[1] === 0x42 && buf[2] === 0x50 && buf[3] === 0x53) {
|
||||
return {
|
||||
ext: 'psd',
|
||||
mime: 'image/vnd.adobe.photoshop'
|
||||
};
|
||||
}
|
||||
|
||||
// needs to be before `zip` check
|
||||
if (buf[0] === 0x50 && buf[1] === 0x4B && buf[2] === 0x3 && buf[3] === 0x4 && buf[30] === 0x6D && buf[31] === 0x69 && buf[32] === 0x6D && buf[33] === 0x65 && buf[34] === 0x74 && buf[35] === 0x79 && buf[36] === 0x70 && buf[37] === 0x65 && buf[38] === 0x61 && buf[39] === 0x70 && buf[40] === 0x70 && buf[41] === 0x6C && buf[42] === 0x69 && buf[43] === 0x63 && buf[44] === 0x61 && buf[45] === 0x74 && buf[46] === 0x69 && buf[47] === 0x6F && buf[48] === 0x6E && buf[49] === 0x2F && buf[50] === 0x65 && buf[51] === 0x70 && buf[52] === 0x75 && buf[53] === 0x62 && buf[54] === 0x2B && buf[55] === 0x7A && buf[56] === 0x69 && buf[57] === 0x70) {
|
||||
return {
|
||||
ext: 'epub',
|
||||
mime: 'application/epub+zip'
|
||||
};
|
||||
}
|
||||
|
||||
// needs to be before `zip` check
|
||||
// assumes signed .xpi from addons.mozilla.org
|
||||
if (buf[0] === 0x50 && buf[1] === 0x4B && buf[2] === 0x3 && buf[3] === 0x4 && buf[30] === 0x4D && buf[31] === 0x45 && buf[32] === 0x54 && buf[33] === 0x41 && buf[34] === 0x2D && buf[35] === 0x49 && buf[36] === 0x4E && buf[37] === 0x46 && buf[38] === 0x2F && buf[39] === 0x6D && buf[40] === 0x6F && buf[41] === 0x7A && buf[42] === 0x69 && buf[43] === 0x6C && buf[44] === 0x6C && buf[45] === 0x61 && buf[46] === 0x2E && buf[47] === 0x72 && buf[48] === 0x73 && buf[49] === 0x61) {
|
||||
return {
|
||||
ext: 'xpi',
|
||||
mime: 'application/x-xpinstall'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x50 && buf[1] === 0x4B && (buf[2] === 0x3 || buf[2] === 0x5 || buf[2] === 0x7) && (buf[3] === 0x4 || buf[3] === 0x6 || buf[3] === 0x8)) {
|
||||
return {
|
||||
ext: 'zip',
|
||||
mime: 'application/zip'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[257] === 0x75 && buf[258] === 0x73 && buf[259] === 0x74 && buf[260] === 0x61 && buf[261] === 0x72) {
|
||||
return {
|
||||
ext: 'tar',
|
||||
mime: 'application/x-tar'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x52 && buf[1] === 0x61 && buf[2] === 0x72 && buf[3] === 0x21 && buf[4] === 0x1A && buf[5] === 0x7 && (buf[6] === 0x0 || buf[6] === 0x1)) {
|
||||
return {
|
||||
ext: 'rar',
|
||||
mime: 'application/x-rar-compressed'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x1F && buf[1] === 0x8B && buf[2] === 0x8) {
|
||||
return {
|
||||
ext: 'gz',
|
||||
mime: 'application/gzip'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x42 && buf[1] === 0x5A && buf[2] === 0x68) {
|
||||
return {
|
||||
ext: 'bz2',
|
||||
mime: 'application/x-bzip2'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x37 && buf[1] === 0x7A && buf[2] === 0xBC && buf[3] === 0xAF && buf[4] === 0x27 && buf[5] === 0x1C) {
|
||||
return {
|
||||
ext: '7z',
|
||||
mime: 'application/x-7z-compressed'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x78 && buf[1] === 0x01) {
|
||||
return {
|
||||
ext: 'dmg',
|
||||
mime: 'application/x-apple-diskimage'
|
||||
};
|
||||
}
|
||||
|
||||
if (
|
||||
(buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && (buf[3] === 0x18 || buf[3] === 0x20) && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70) ||
|
||||
(buf[0] === 0x33 && buf[1] === 0x67 && buf[2] === 0x70 && buf[3] === 0x35) ||
|
||||
(buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x1C && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x6D && buf[9] === 0x70 && buf[10] === 0x34 && buf[11] === 0x32 && buf[16] === 0x6D && buf[17] === 0x70 && buf[18] === 0x34 && buf[19] === 0x31 && buf[20] === 0x6D && buf[21] === 0x70 && buf[22] === 0x34 && buf[23] === 0x32 && buf[24] === 0x69 && buf[25] === 0x73 && buf[26] === 0x6F && buf[27] === 0x6D) ||
|
||||
(buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x1C && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x69 && buf[9] === 0x73 && buf[10] === 0x6F && buf[11] === 0x6D) ||
|
||||
(buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x1c && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x6D && buf[9] === 0x70 && buf[10] === 0x34 && buf[11] === 0x32 && buf[12] === 0x0 && buf[13] === 0x0 && buf[14] === 0x0 && buf[15] === 0x0)
|
||||
) {
|
||||
return {
|
||||
ext: 'mp4',
|
||||
mime: 'video/mp4'
|
||||
};
|
||||
}
|
||||
|
||||
if ((buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x1C && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x4D && buf[9] === 0x34 && buf[10] === 0x56)) {
|
||||
return {
|
||||
ext: 'm4v',
|
||||
mime: 'video/x-m4v'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x4D && buf[1] === 0x54 && buf[2] === 0x68 && buf[3] === 0x64) {
|
||||
return {
|
||||
ext: 'mid',
|
||||
mime: 'audio/midi'
|
||||
};
|
||||
}
|
||||
|
||||
// needs to be before the `webm` check
|
||||
if (buf[31] === 0x6D && buf[32] === 0x61 && buf[33] === 0x74 && buf[34] === 0x72 && buf[35] === 0x6f && buf[36] === 0x73 && buf[37] === 0x6B && buf[38] === 0x61) {
|
||||
return {
|
||||
ext: 'mkv',
|
||||
mime: 'video/x-matroska'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x1A && buf[1] === 0x45 && buf[2] === 0xDF && buf[3] === 0xA3) {
|
||||
return {
|
||||
ext: 'webm',
|
||||
mime: 'video/webm'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x14 && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70) {
|
||||
return {
|
||||
ext: 'mov',
|
||||
mime: 'video/quicktime'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x52 && buf[1] === 0x49 && buf[2] === 0x46 && buf[3] === 0x46 && buf[8] === 0x41 && buf[9] === 0x56 && buf[10] === 0x49) {
|
||||
return {
|
||||
ext: 'avi',
|
||||
mime: 'video/x-msvideo'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x30 && buf[1] === 0x26 && buf[2] === 0xB2 && buf[3] === 0x75 && buf[4] === 0x8E && buf[5] === 0x66 && buf[6] === 0xCF && buf[7] === 0x11 && buf[8] === 0xA6 && buf[9] === 0xD9) {
|
||||
return {
|
||||
ext: 'wmv',
|
||||
mime: 'video/x-ms-wmv'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x1 && buf[3].toString(16)[0] === 'b') {
|
||||
return {
|
||||
ext: 'mpg',
|
||||
mime: 'video/mpeg'
|
||||
};
|
||||
}
|
||||
|
||||
if ((buf[0] === 0x49 && buf[1] === 0x44 && buf[2] === 0x33) || (buf[0] === 0xFF && buf[1] === 0xfb)) {
|
||||
return {
|
||||
ext: 'mp3',
|
||||
mime: 'audio/mpeg'
|
||||
};
|
||||
}
|
||||
|
||||
if ((buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x4D && buf[9] === 0x34 && buf[10] === 0x41) || (buf[0] === 0x4D && buf[1] === 0x34 && buf[2] === 0x41 && buf[3] === 0x20)) {
|
||||
return {
|
||||
ext: 'm4a',
|
||||
mime: 'audio/m4a'
|
||||
};
|
||||
}
|
||||
|
||||
// needs to be before `ogg` check
|
||||
if (buf[28] === 0x4F && buf[29] === 0x70 && buf[30] === 0x75 && buf[31] === 0x73 && buf[32] === 0x48 && buf[33] === 0x65 && buf[34] === 0x61 && buf[35] === 0x64) {
|
||||
return {
|
||||
ext: 'opus',
|
||||
mime: 'audio/opus'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x4F && buf[1] === 0x67 && buf[2] === 0x67 && buf[3] === 0x53) {
|
||||
return {
|
||||
ext: 'ogg',
|
||||
mime: 'audio/ogg'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x66 && buf[1] === 0x4C && buf[2] === 0x61 && buf[3] === 0x43) {
|
||||
return {
|
||||
ext: 'flac',
|
||||
mime: 'audio/x-flac'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x52 && buf[1] === 0x49 && buf[2] === 0x46 && buf[3] === 0x46 && buf[8] === 0x57 && buf[9] === 0x41 && buf[10] === 0x56 && buf[11] === 0x45) {
|
||||
return {
|
||||
ext: 'wav',
|
||||
mime: 'audio/x-wav'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x23 && buf[1] === 0x21 && buf[2] === 0x41 && buf[3] === 0x4D && buf[4] === 0x52 && buf[5] === 0x0A) {
|
||||
return {
|
||||
ext: 'amr',
|
||||
mime: 'audio/amr'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x25 && buf[1] === 0x50 && buf[2] === 0x44 && buf[3] === 0x46) {
|
||||
return {
|
||||
ext: 'pdf',
|
||||
mime: 'application/pdf'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x4D && buf[1] === 0x5A) {
|
||||
return {
|
||||
ext: 'exe',
|
||||
mime: 'application/x-msdownload'
|
||||
};
|
||||
}
|
||||
|
||||
if ((buf[0] === 0x43 || buf[0] === 0x46) && buf[1] === 0x57 && buf[2] === 0x53) {
|
||||
return {
|
||||
ext: 'swf',
|
||||
mime: 'application/x-shockwave-flash'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x7B && buf[1] === 0x5C && buf[2] === 0x72 && buf[3] === 0x74 && buf[4] === 0x66) {
|
||||
return {
|
||||
ext: 'rtf',
|
||||
mime: 'application/rtf'
|
||||
};
|
||||
}
|
||||
|
||||
if (
|
||||
(buf[0] === 0x77 && buf[1] === 0x4F && buf[2] === 0x46 && buf[3] === 0x46) &&
|
||||
(
|
||||
(buf[4] === 0x00 && buf[5] === 0x01 && buf[6] === 0x00 && buf[7] === 0x00) ||
|
||||
(buf[4] === 0x4F && buf[5] === 0x54 && buf[6] === 0x54 && buf[7] === 0x4F)
|
||||
)
|
||||
) {
|
||||
return {
|
||||
ext: 'woff',
|
||||
mime: 'application/font-woff'
|
||||
};
|
||||
}
|
||||
|
||||
if (
|
||||
(buf[0] === 0x77 && buf[1] === 0x4F && buf[2] === 0x46 && buf[3] === 0x32) &&
|
||||
(
|
||||
(buf[4] === 0x00 && buf[5] === 0x01 && buf[6] === 0x00 && buf[7] === 0x00) ||
|
||||
(buf[4] === 0x4F && buf[5] === 0x54 && buf[6] === 0x54 && buf[7] === 0x4F)
|
||||
)
|
||||
) {
|
||||
return {
|
||||
ext: 'woff2',
|
||||
mime: 'application/font-woff'
|
||||
};
|
||||
}
|
||||
|
||||
if (
|
||||
(buf[34] === 0x4C && buf[35] === 0x50) &&
|
||||
(
|
||||
(buf[8] === 0x00 && buf[9] === 0x00 && buf[10] === 0x01) ||
|
||||
(buf[8] === 0x01 && buf[9] === 0x00 && buf[10] === 0x02) ||
|
||||
(buf[8] === 0x02 && buf[9] === 0x00 && buf[10] === 0x02)
|
||||
)
|
||||
) {
|
||||
return {
|
||||
ext: 'eot',
|
||||
mime: 'application/octet-stream'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x00 && buf[1] === 0x01 && buf[2] === 0x00 && buf[3] === 0x00 && buf[4] === 0x00) {
|
||||
return {
|
||||
ext: 'ttf',
|
||||
mime: 'application/font-sfnt'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x4F && buf[1] === 0x54 && buf[2] === 0x54 && buf[3] === 0x4F && buf[4] === 0x00) {
|
||||
return {
|
||||
ext: 'otf',
|
||||
mime: 'application/font-sfnt'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x00 && buf[1] === 0x00 && buf[2] === 0x01 && buf[3] === 0x00) {
|
||||
return {
|
||||
ext: 'ico',
|
||||
mime: 'image/x-icon'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x46 && buf[1] === 0x4C && buf[2] === 0x56 && buf[3] === 0x01) {
|
||||
return {
|
||||
ext: 'flv',
|
||||
mime: 'video/x-flv'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x25 && buf[1] === 0x21) {
|
||||
return {
|
||||
ext: 'ps',
|
||||
mime: 'application/postscript'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0xFD && buf[1] === 0x37 && buf[2] === 0x7A && buf[3] === 0x58 && buf[4] === 0x5A && buf[5] === 0x00) {
|
||||
return {
|
||||
ext: 'xz',
|
||||
mime: 'application/x-xz'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x53 && buf[1] === 0x51 && buf[2] === 0x4C && buf[3] === 0x69) {
|
||||
return {
|
||||
ext: 'sqlite',
|
||||
mime: 'application/x-sqlite3'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x4E && buf[1] === 0x45 && buf[2] === 0x53 && buf[3] === 0x1A) {
|
||||
return {
|
||||
ext: 'nes',
|
||||
mime: 'application/x-nintendo-nes-rom'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x43 && buf[1] === 0x72 && buf[2] === 0x32 && buf[3] === 0x34) {
|
||||
return {
|
||||
ext: 'crx',
|
||||
mime: 'application/x-google-chrome-extension'
|
||||
};
|
||||
}
|
||||
|
||||
if (
|
||||
(buf[0] === 0x4D && buf[1] === 0x53 && buf[2] === 0x43 && buf[3] === 0x46) ||
|
||||
(buf[0] === 0x49 && buf[1] === 0x53 && buf[2] === 0x63 && buf[3] === 0x28)
|
||||
) {
|
||||
return {
|
||||
ext: 'cab',
|
||||
mime: 'application/vnd.ms-cab-compressed'
|
||||
};
|
||||
}
|
||||
|
||||
// needs to be before `ar` check
|
||||
if (buf[0] === 0x21 && buf[1] === 0x3C && buf[2] === 0x61 && buf[3] === 0x72 && buf[4] === 0x63 && buf[5] === 0x68 && buf[6] === 0x3E && buf[7] === 0x0A && buf[8] === 0x64 && buf[9] === 0x65 && buf[10] === 0x62 && buf[11] === 0x69 && buf[12] === 0x61 && buf[13] === 0x6E && buf[14] === 0x2D && buf[15] === 0x62 && buf[16] === 0x69 && buf[17] === 0x6E && buf[18] === 0x61 && buf[19] === 0x72 && buf[20] === 0x79) {
|
||||
return {
|
||||
ext: 'deb',
|
||||
mime: 'application/x-deb'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x21 && buf[1] === 0x3C && buf[2] === 0x61 && buf[3] === 0x72 && buf[4] === 0x63 && buf[5] === 0x68 && buf[6] === 0x3E) {
|
||||
return {
|
||||
ext: 'ar',
|
||||
mime: 'application/x-unix-archive'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0xED && buf[1] === 0xAB && buf[2] === 0xEE && buf[3] === 0xDB) {
|
||||
return {
|
||||
ext: 'rpm',
|
||||
mime: 'application/x-rpm'
|
||||
};
|
||||
}
|
||||
|
||||
if (
|
||||
(buf[0] === 0x1F && buf[1] === 0xA0) ||
|
||||
(buf[0] === 0x1F && buf[1] === 0x9D)
|
||||
) {
|
||||
return {
|
||||
ext: 'Z',
|
||||
mime: 'application/x-compress'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0x4C && buf[1] === 0x5A && buf[2] === 0x49 && buf[3] === 0x50) {
|
||||
return {
|
||||
ext: 'lz',
|
||||
mime: 'application/x-lzip'
|
||||
};
|
||||
}
|
||||
|
||||
if (buf[0] === 0xD0 && buf[1] === 0xCF && buf[2] === 0x11 && buf[3] === 0xE0 && buf[4] === 0xA1 && buf[5] === 0xB1 && buf[6] === 0x1A && buf[7] === 0xE1) {
|
||||
return {
|
||||
ext: 'msi',
|
||||
mime: 'application/x-msi'
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
## The MIT License (MIT) ##
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Hugh Kennedy
|
||||
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
|
||||
103
node_modules/decompress-unzip/node_modules/file-type/package.json
generated
vendored
Normal file
103
node_modules/decompress-unzip/node_modules/file-type/package.json
generated
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
{
|
||||
"name": "file-type",
|
||||
"version": "3.9.0",
|
||||
"description": "Detect the file type of a Buffer/Uint8Array",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/file-type",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"mime",
|
||||
"file",
|
||||
"type",
|
||||
"archive",
|
||||
"image",
|
||||
"img",
|
||||
"pic",
|
||||
"picture",
|
||||
"flash",
|
||||
"photo",
|
||||
"video",
|
||||
"type",
|
||||
"detect",
|
||||
"check",
|
||||
"is",
|
||||
"exif",
|
||||
"exe",
|
||||
"binary",
|
||||
"buffer",
|
||||
"uint8array",
|
||||
"jpg",
|
||||
"png",
|
||||
"gif",
|
||||
"webp",
|
||||
"flif",
|
||||
"cr2",
|
||||
"tif",
|
||||
"bmp",
|
||||
"jxr",
|
||||
"psd",
|
||||
"zip",
|
||||
"tar",
|
||||
"rar",
|
||||
"gz",
|
||||
"bz2",
|
||||
"7z",
|
||||
"dmg",
|
||||
"mp4",
|
||||
"m4v",
|
||||
"mid",
|
||||
"mkv",
|
||||
"webm",
|
||||
"mov",
|
||||
"avi",
|
||||
"mpg",
|
||||
"mp3",
|
||||
"m4a",
|
||||
"ogg",
|
||||
"opus",
|
||||
"flac",
|
||||
"wav",
|
||||
"amr",
|
||||
"pdf",
|
||||
"epub",
|
||||
"exe",
|
||||
"swf",
|
||||
"rtf",
|
||||
"woff",
|
||||
"woff2",
|
||||
"eot",
|
||||
"ttf",
|
||||
"otf",
|
||||
"ico",
|
||||
"flv",
|
||||
"ps",
|
||||
"xz",
|
||||
"sqlite",
|
||||
"xpi",
|
||||
"cab",
|
||||
"deb",
|
||||
"ar",
|
||||
"rpm",
|
||||
"Z",
|
||||
"lz",
|
||||
"msi"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"read-chunk": "^2.0.0",
|
||||
"xo": "*"
|
||||
}
|
||||
}
|
||||
149
node_modules/decompress-unzip/node_modules/file-type/readme.md
generated
vendored
Normal file
149
node_modules/decompress-unzip/node_modules/file-type/readme.md
generated
vendored
Normal file
@@ -0,0 +1,149 @@
|
||||
# file-type [](https://travis-ci.org/sindresorhus/file-type)
|
||||
|
||||
> Detect the file type of a Buffer/Uint8Array
|
||||
|
||||
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.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save file-type
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
##### Node.js
|
||||
|
||||
```js
|
||||
const readChunk = require('read-chunk'); // npm install read-chunk
|
||||
const fileType = require('file-type');
|
||||
const buffer = readChunk.sync('unicorn.png', 0, 262);
|
||||
|
||||
fileType(buffer);
|
||||
//=> {ext: 'png', mime: 'image/png'}
|
||||
```
|
||||
|
||||
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();
|
||||
console.log(fileType(chunk));
|
||||
//=> {ext: 'gif', mime: 'image/gif'}
|
||||
});
|
||||
});
|
||||
```
|
||||
|
||||
##### Browser
|
||||
|
||||
```js
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', 'unicorn.png');
|
||||
xhr.responseType = 'arraybuffer';
|
||||
|
||||
xhr.onload = () => {
|
||||
fileType(new Uint8Array(this.response));
|
||||
//=> {ext: 'png', mime: 'image/png'}
|
||||
};
|
||||
|
||||
xhr.send();
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### fileType(buffer)
|
||||
|
||||
Returns an `Object` (or `null` when no match) with:
|
||||
|
||||
- `ext` - one of the [supported file types](#supported-file-types)
|
||||
- `mime` - the [MIME type](http://en.wikipedia.org/wiki/Internet_media_type)
|
||||
|
||||
#### buffer
|
||||
|
||||
Type: `Buffer` `Uint8Array`
|
||||
|
||||
It only needs the first 262 bytes.
|
||||
|
||||
|
||||
## Supported file types
|
||||
|
||||
- [`jpg`](https://en.wikipedia.org/wiki/JPEG)
|
||||
- [`png`](https://en.wikipedia.org/wiki/Portable_Network_Graphics)
|
||||
- [`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)
|
||||
- [`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)
|
||||
- [`psd`](https://en.wikipedia.org/wiki/Adobe_Photoshop#File_format)
|
||||
- [`zip`](https://en.wikipedia.org/wiki/Zip_(file_format))
|
||||
- [`tar`](https://en.wikipedia.org/wiki/Tar_(computing)#File_format)
|
||||
- [`rar`](https://en.wikipedia.org/wiki/RAR_(file_format))
|
||||
- [`gz`](https://en.wikipedia.org/wiki/Gzip)
|
||||
- [`bz2`](https://en.wikipedia.org/wiki/Bzip2)
|
||||
- [`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)
|
||||
- [`mov`](https://en.wikipedia.org/wiki/QuickTime_File_Format)
|
||||
- [`avi`](https://en.wikipedia.org/wiki/Audio_Video_Interleave)
|
||||
- [`wmv`](https://en.wikipedia.org/wiki/Windows_Media_Video)
|
||||
- [`mpg`](https://en.wikipedia.org/wiki/MPEG-1)
|
||||
- [`mp3`](https://en.wikipedia.org/wiki/MP3)
|
||||
- [`m4a`](https://en.wikipedia.org/wiki/MPEG-4_Part_14#.MP4_versus_.M4A)
|
||||
- [`ogg`](https://en.wikipedia.org/wiki/Ogg)
|
||||
- [`opus`](https://en.wikipedia.org/wiki/Opus_(audio_format))
|
||||
- [`flac`](https://en.wikipedia.org/wiki/FLAC)
|
||||
- [`wav`](https://en.wikipedia.org/wiki/WAV)
|
||||
- [`amr`](https://en.wikipedia.org/wiki/Adaptive_Multi-Rate_audio_codec)
|
||||
- [`pdf`](https://en.wikipedia.org/wiki/Portable_Document_Format)
|
||||
- [`epub`](https://en.wikipedia.org/wiki/EPUB)
|
||||
- [`exe`](https://en.wikipedia.org/wiki/.exe)
|
||||
- [`swf`](https://en.wikipedia.org/wiki/SWF)
|
||||
- [`rtf`](https://en.wikipedia.org/wiki/Rich_Text_Format)
|
||||
- [`woff`](https://en.wikipedia.org/wiki/Web_Open_Font_Format)
|
||||
- [`woff2`](https://en.wikipedia.org/wiki/Web_Open_Font_Format)
|
||||
- [`eot`](https://en.wikipedia.org/wiki/Embedded_OpenType)
|
||||
- [`ttf`](https://en.wikipedia.org/wiki/TrueType)
|
||||
- [`otf`](https://en.wikipedia.org/wiki/OpenType)
|
||||
- [`ico`](https://en.wikipedia.org/wiki/ICO_(file_format))
|
||||
- [`flv`](https://en.wikipedia.org/wiki/Flash_Video)
|
||||
- [`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)
|
||||
- [`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)
|
||||
- [`lz`](https://en.wikipedia.org/wiki/Lzip)
|
||||
- [`msi`](https://en.wikipedia.org/wiki/Windows_Installer)
|
||||
|
||||
*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).*
|
||||
|
||||
*PR welcome for additional commonly used file types.*
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [file-type-cli](https://github.com/sindresorhus/file-type-cli) - CLI for this module
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
54
node_modules/decompress-unzip/node_modules/get-stream/buffer-stream.js
generated
vendored
Normal file
54
node_modules/decompress-unzip/node_modules/get-stream/buffer-stream.js
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
var PassThrough = require('stream').PassThrough;
|
||||
var objectAssign = require('object-assign');
|
||||
|
||||
module.exports = function (opts) {
|
||||
opts = objectAssign({}, opts);
|
||||
|
||||
var array = opts.array;
|
||||
var encoding = opts.encoding;
|
||||
|
||||
var buffer = encoding === 'buffer';
|
||||
var objectMode = false;
|
||||
|
||||
if (array) {
|
||||
objectMode = !(encoding || buffer);
|
||||
} else {
|
||||
encoding = encoding || 'utf8';
|
||||
}
|
||||
|
||||
if (buffer) {
|
||||
encoding = null;
|
||||
}
|
||||
|
||||
var len = 0;
|
||||
var ret = [];
|
||||
|
||||
var stream = new PassThrough({objectMode: objectMode});
|
||||
|
||||
if (encoding) {
|
||||
stream.setEncoding(encoding);
|
||||
}
|
||||
|
||||
stream.on('data', function (chunk) {
|
||||
ret.push(chunk);
|
||||
|
||||
if (objectMode) {
|
||||
len = ret.length;
|
||||
} else {
|
||||
len += chunk.length;
|
||||
}
|
||||
});
|
||||
|
||||
stream.getBufferedValue = function () {
|
||||
if (array) {
|
||||
return ret;
|
||||
}
|
||||
return buffer ? Buffer.concat(ret, len) : ret.join('');
|
||||
};
|
||||
|
||||
stream.getBufferedLength = function () {
|
||||
return len;
|
||||
};
|
||||
|
||||
return stream;
|
||||
};
|
||||
59
node_modules/decompress-unzip/node_modules/get-stream/index.js
generated
vendored
Normal file
59
node_modules/decompress-unzip/node_modules/get-stream/index.js
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
'use strict';
|
||||
var Promise = require('pinkie-promise');
|
||||
var objectAssign = require('object-assign');
|
||||
var bufferStream = require('./buffer-stream');
|
||||
|
||||
function getStream(inputStream, opts) {
|
||||
if (!inputStream) {
|
||||
return Promise.reject(new Error('Expected a stream'));
|
||||
}
|
||||
|
||||
opts = objectAssign({maxBuffer: Infinity}, opts);
|
||||
var maxBuffer = opts.maxBuffer;
|
||||
var stream;
|
||||
var clean;
|
||||
|
||||
var p = new Promise(function (resolve, reject) {
|
||||
stream = bufferStream(opts);
|
||||
inputStream.once('error', error);
|
||||
inputStream.pipe(stream);
|
||||
|
||||
stream.on('data', function () {
|
||||
if (stream.getBufferedLength() > maxBuffer) {
|
||||
reject(new Error('maxBuffer exceeded'));
|
||||
}
|
||||
});
|
||||
stream.once('error', error);
|
||||
stream.on('end', resolve);
|
||||
|
||||
clean = function () {
|
||||
// some streams doesn't implement the stream.Readable interface correctly
|
||||
if (inputStream.unpipe) {
|
||||
inputStream.unpipe(stream);
|
||||
}
|
||||
};
|
||||
|
||||
function error(err) {
|
||||
if (err) { // null check
|
||||
err.bufferedData = stream.getBufferedValue();
|
||||
}
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
|
||||
p.then(clean, clean);
|
||||
|
||||
return p.then(function () {
|
||||
return stream.getBufferedValue();
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = getStream;
|
||||
|
||||
module.exports.buffer = function (stream, opts) {
|
||||
return getStream(stream, objectAssign({}, opts, {encoding: 'buffer'}));
|
||||
};
|
||||
|
||||
module.exports.array = function (stream, opts) {
|
||||
return getStream(stream, objectAssign({}, opts, {array: true}));
|
||||
};
|
||||
21
node_modules/decompress-unzip/node_modules/get-stream/license
generated
vendored
Normal file
21
node_modules/decompress-unzip/node_modules/get-stream/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
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:
|
||||
|
||||
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.
|
||||
49
node_modules/decompress-unzip/node_modules/get-stream/package.json
generated
vendored
Normal file
49
node_modules/decompress-unzip/node_modules/get-stream/package.json
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"name": "get-stream",
|
||||
"version": "2.3.1",
|
||||
"description": "Get a stream as a string, buffer, or array",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/get-stream",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"buffer-stream.js"
|
||||
],
|
||||
"keywords": [
|
||||
"get",
|
||||
"stream",
|
||||
"promise",
|
||||
"concat",
|
||||
"string",
|
||||
"str",
|
||||
"text",
|
||||
"buffer",
|
||||
"read",
|
||||
"data",
|
||||
"readable",
|
||||
"readablestream",
|
||||
"array",
|
||||
"object",
|
||||
"obj"
|
||||
],
|
||||
"dependencies": {
|
||||
"object-assign": "^4.0.1",
|
||||
"pinkie-promise": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"buffer-equals": "^1.0.3",
|
||||
"into-stream": "^2.0.1",
|
||||
"xo": "*"
|
||||
}
|
||||
}
|
||||
115
node_modules/decompress-unzip/node_modules/get-stream/readme.md
generated
vendored
Normal file
115
node_modules/decompress-unzip/node_modules/get-stream/readme.md
generated
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
# get-stream [](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 is resolved 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)
|
||||
68
node_modules/decompress-unzip/node_modules/pify/index.js
generated
vendored
Normal file
68
node_modules/decompress-unzip/node_modules/pify/index.js
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
'use strict';
|
||||
|
||||
var processFn = function (fn, P, opts) {
|
||||
return function () {
|
||||
var that = this;
|
||||
var args = new Array(arguments.length);
|
||||
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
args[i] = arguments[i];
|
||||
}
|
||||
|
||||
return new P(function (resolve, reject) {
|
||||
args.push(function (err, result) {
|
||||
if (err) {
|
||||
reject(err);
|
||||
} else if (opts.multiArgs) {
|
||||
var results = new Array(arguments.length - 1);
|
||||
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
results[i - 1] = arguments[i];
|
||||
}
|
||||
|
||||
resolve(results);
|
||||
} else {
|
||||
resolve(result);
|
||||
}
|
||||
});
|
||||
|
||||
fn.apply(that, args);
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
var pify = module.exports = function (obj, P, opts) {
|
||||
if (typeof P !== 'function') {
|
||||
opts = P;
|
||||
P = Promise;
|
||||
}
|
||||
|
||||
opts = opts || {};
|
||||
opts.exclude = opts.exclude || [/.+Sync$/];
|
||||
|
||||
var filter = function (key) {
|
||||
var match = function (pattern) {
|
||||
return typeof pattern === 'string' ? key === pattern : pattern.test(key);
|
||||
};
|
||||
|
||||
return opts.include ? opts.include.some(match) : !opts.exclude.some(match);
|
||||
};
|
||||
|
||||
var ret = typeof obj === 'function' ? function () {
|
||||
if (opts.excludeMain) {
|
||||
return obj.apply(this, arguments);
|
||||
}
|
||||
|
||||
return processFn(obj, P, opts).apply(this, arguments);
|
||||
} : {};
|
||||
|
||||
return Object.keys(obj).reduce(function (ret, key) {
|
||||
var x = obj[key];
|
||||
|
||||
ret[key] = typeof x === 'function' && filter(key) ? processFn(x, P, opts) : x;
|
||||
|
||||
return ret;
|
||||
}, ret);
|
||||
};
|
||||
|
||||
pify.all = pify;
|
||||
21
node_modules/decompress-unzip/node_modules/pify/license
generated
vendored
Normal file
21
node_modules/decompress-unzip/node_modules/pify/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
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:
|
||||
|
||||
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.
|
||||
48
node_modules/decompress-unzip/node_modules/pify/package.json
generated
vendored
Normal file
48
node_modules/decompress-unzip/node_modules/pify/package.json
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "pify",
|
||||
"version": "2.3.0",
|
||||
"description": "Promisify a callback-style function",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/pify",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && npm run optimization-test",
|
||||
"optimization-test": "node --allow-natives-syntax optimization-test.js"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"promise",
|
||||
"promises",
|
||||
"promisify",
|
||||
"denodify",
|
||||
"denodeify",
|
||||
"callback",
|
||||
"cb",
|
||||
"node",
|
||||
"then",
|
||||
"thenify",
|
||||
"convert",
|
||||
"transform",
|
||||
"wrap",
|
||||
"wrapper",
|
||||
"bind",
|
||||
"to",
|
||||
"async",
|
||||
"es2015"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"pinkie-promise": "^1.0.0",
|
||||
"v8-natives": "0.0.2",
|
||||
"xo": "*"
|
||||
}
|
||||
}
|
||||
119
node_modules/decompress-unzip/node_modules/pify/readme.md
generated
vendored
Normal file
119
node_modules/decompress-unzip/node_modules/pify/readme.md
generated
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
# pify [](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'
|
||||
});
|
||||
|
||||
// or promisify all methods in a module
|
||||
|
||||
pify(fs).readFile('package.json', 'utf8').then(data => {
|
||||
console.log(JSON.parse(data).name);
|
||||
//=> 'pify'
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### pify(input, [promiseModule], [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.
|
||||
|
||||
#### 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.
|
||||
|
||||
#### options
|
||||
|
||||
##### multiArgs
|
||||
|
||||
Type: `boolean`
|
||||
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.
|
||||
|
||||
```js
|
||||
const request = require('request');
|
||||
const pify = require('pify');
|
||||
|
||||
pify(request, {multiArgs: true})('https://sindresorhus.com').then(result => {
|
||||
const [httpResponse, body] = result;
|
||||
});
|
||||
```
|
||||
|
||||
##### include
|
||||
|
||||
Type: `array` of (`string`|`regex`)
|
||||
|
||||
Methods in a module to promisify. Remaining methods will be left untouched.
|
||||
|
||||
##### exclude
|
||||
|
||||
Type: `array` of (`string`|`regex`)
|
||||
Default: `[/.+Sync$/]`
|
||||
|
||||
Methods in a module **not** to promisify. Methods with names ending with `'Sync'` are excluded by default.
|
||||
|
||||
##### excludeMain
|
||||
|
||||
Type: `boolean`
|
||||
Default: `false`
|
||||
|
||||
By default, if given module is a function itself, this function 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(data, null);
|
||||
});
|
||||
};
|
||||
|
||||
// promisify methods but not fn()
|
||||
const promiseFn = pify(fn, {excludeMain: true});
|
||||
|
||||
if (promiseFn()) {
|
||||
promiseFn.method('hi').then(data => {
|
||||
console.log(data);
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
||||
6
node_modules/decompress-unzip/node_modules/replace-ext/.npmignore
generated
vendored
6
node_modules/decompress-unzip/node_modules/replace-ext/.npmignore
generated
vendored
@@ -1,6 +0,0 @@
|
||||
.DS_Store
|
||||
*.log
|
||||
node_modules
|
||||
build
|
||||
*.node
|
||||
components
|
||||
8
node_modules/decompress-unzip/node_modules/replace-ext/.travis.yml
generated
vendored
8
node_modules/decompress-unzip/node_modules/replace-ext/.travis.yml
generated
vendored
@@ -1,8 +0,0 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.7"
|
||||
- "0.8"
|
||||
- "0.9"
|
||||
- "0.10"
|
||||
after_script:
|
||||
- npm run coveralls
|
||||
20
node_modules/decompress-unzip/node_modules/replace-ext/LICENSE
generated
vendored
20
node_modules/decompress-unzip/node_modules/replace-ext/LICENSE
generated
vendored
@@ -1,20 +0,0 @@
|
||||
Copyright (c) 2014 Fractal <contact@wearefractal.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:
|
||||
|
||||
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.
|
||||
44
node_modules/decompress-unzip/node_modules/replace-ext/README.md
generated
vendored
44
node_modules/decompress-unzip/node_modules/replace-ext/README.md
generated
vendored
@@ -1,44 +0,0 @@
|
||||
# replace-ext [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Dependency Status][david-image]][david-url]
|
||||
|
||||
|
||||
## Information
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>Package</td><td>replace-ext</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Description</td>
|
||||
<td>Replaces a file extension with another one</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Node Version</td>
|
||||
<td>>= 0.4</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
var replaceExt = require('replace-ext');
|
||||
|
||||
var path = '/some/dir/file.js';
|
||||
var npath = replaceExt(path, '.coffee');
|
||||
|
||||
console.log(npath); // /some/dir/file.coffee
|
||||
```
|
||||
|
||||
[npm-url]: https://npmjs.org/package/replace-ext
|
||||
[npm-image]: https://badge.fury.io/js/replace-ext.png
|
||||
|
||||
[travis-url]: https://travis-ci.org/wearefractal/replace-ext
|
||||
[travis-image]: https://travis-ci.org/wearefractal/replace-ext.png?branch=master
|
||||
|
||||
[coveralls-url]: https://coveralls.io/r/wearefractal/replace-ext
|
||||
[coveralls-image]: https://coveralls.io/repos/wearefractal/replace-ext/badge.png
|
||||
|
||||
[depstat-url]: https://david-dm.org/wearefractal/replace-ext
|
||||
[depstat-image]: https://david-dm.org/wearefractal/replace-ext.png
|
||||
|
||||
[david-url]: https://david-dm.org/wearefractal/replace-ext
|
||||
[david-image]: https://david-dm.org/wearefractal/replace-ext.png?theme=shields.io
|
||||
9
node_modules/decompress-unzip/node_modules/replace-ext/index.js
generated
vendored
9
node_modules/decompress-unzip/node_modules/replace-ext/index.js
generated
vendored
@@ -1,9 +0,0 @@
|
||||
var path = require('path');
|
||||
|
||||
module.exports = function(npath, ext) {
|
||||
if (typeof npath !== 'string') return npath;
|
||||
if (npath.length === 0) return npath;
|
||||
|
||||
var nFileName = path.basename(npath, path.extname(npath))+ext;
|
||||
return path.join(path.dirname(npath), nFileName);
|
||||
};
|
||||
35
node_modules/decompress-unzip/node_modules/replace-ext/package.json
generated
vendored
35
node_modules/decompress-unzip/node_modules/replace-ext/package.json
generated
vendored
@@ -1,35 +0,0 @@
|
||||
{
|
||||
"name":"replace-ext",
|
||||
"description":"Replaces a file extension with another one",
|
||||
"version":"0.0.1",
|
||||
"homepage":"http://github.com/wearefractal/replace-ext",
|
||||
"repository":"git://github.com/wearefractal/replace-ext.git",
|
||||
"author":"Fractal <contact@wearefractal.com> (http://wearefractal.com/)",
|
||||
"main":"./index.js",
|
||||
|
||||
"dependencies":{
|
||||
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "~1.17.0",
|
||||
"should": "~3.1.0",
|
||||
"mocha-lcov-reporter": "~0.0.1",
|
||||
"coveralls": "~2.6.1",
|
||||
"istanbul": "~0.2.3",
|
||||
"rimraf": "~2.2.5",
|
||||
"jshint": "~2.4.1"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha --reporter spec && jshint",
|
||||
"coveralls": "istanbul cover _mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"licenses":[
|
||||
{
|
||||
"type":"MIT",
|
||||
"url":"http://github.com/wearefractal/replace-ext/raw/master/LICENSE"
|
||||
}
|
||||
]
|
||||
}
|
||||
51
node_modules/decompress-unzip/node_modules/replace-ext/test/main.js
generated
vendored
51
node_modules/decompress-unzip/node_modules/replace-ext/test/main.js
generated
vendored
@@ -1,51 +0,0 @@
|
||||
var replaceExt = require('../');
|
||||
var path = require('path');
|
||||
var should = require('should');
|
||||
require('mocha');
|
||||
|
||||
describe('replace-ext', function() {
|
||||
it('should return a valid replaced extension on nested', function(done) {
|
||||
var fname = path.join(__dirname, './fixtures/test.coffee');
|
||||
var expected = path.join(__dirname, './fixtures/test.js');
|
||||
var nu = replaceExt(fname, '.js');
|
||||
should.exist(nu);
|
||||
nu.should.equal(expected);
|
||||
done();
|
||||
});
|
||||
|
||||
it('should return a valid replaced extension on flat', function(done) {
|
||||
var fname = 'test.coffee';
|
||||
var expected = 'test.js';
|
||||
var nu = replaceExt(fname, '.js');
|
||||
should.exist(nu);
|
||||
nu.should.equal(expected);
|
||||
done();
|
||||
});
|
||||
|
||||
it('should not return a valid replaced extension on empty string', function(done) {
|
||||
var fname = '';
|
||||
var expected = '';
|
||||
var nu = replaceExt(fname, '.js');
|
||||
should.exist(nu);
|
||||
nu.should.equal(expected);
|
||||
done();
|
||||
});
|
||||
|
||||
it('should return a valid removed extension on nested', function(done) {
|
||||
var fname = path.join(__dirname, './fixtures/test.coffee');
|
||||
var expected = path.join(__dirname, './fixtures/test');
|
||||
var nu = replaceExt(fname, '');
|
||||
should.exist(nu);
|
||||
nu.should.equal(expected);
|
||||
done();
|
||||
});
|
||||
|
||||
it('should return a valid added extension on nested', function(done) {
|
||||
var fname = path.join(__dirname, './fixtures/test');
|
||||
var expected = path.join(__dirname, './fixtures/test.js');
|
||||
var nu = replaceExt(fname, '.js');
|
||||
should.exist(nu);
|
||||
nu.should.equal(expected);
|
||||
done();
|
||||
});
|
||||
});
|
||||
163
node_modules/decompress-unzip/node_modules/vinyl/CHANGELOG.md
generated
vendored
163
node_modules/decompress-unzip/node_modules/vinyl/CHANGELOG.md
generated
vendored
@@ -1,163 +0,0 @@
|
||||
## Change Log
|
||||
|
||||
### v1.1.1 (2016/01/18 23:23 +00:00)
|
||||
- [3990e00](https://github.com/gulpjs/vinyl/commit/3990e007b004c809a53670c00566afb157fa56b6) 1.1.1
|
||||
- [2d3e984](https://github.com/gulpjs/vinyl/commit/2d3e98447a42285b593e1b261984b87b171e7313) chore: add NPM script for changelog (@T1st3)
|
||||
- [f70c395](https://github.com/gulpjs/vinyl/commit/f70c395085fc3952cf72c061c851f5b0d4676030) docs: add CHANGELOG.md (@T1st3)
|
||||
- [#74](https://github.com/gulpjs/vinyl/pull/74) Fix isVinyl for falsy values (@erikkemperman)
|
||||
- [3e8b132](https://github.com/gulpjs/vinyl/commit/3e8b132cd87bf5ab536ff7a4c6d660e33f5990b4) Fix isVinyl for falsy values (@erikkemperman)
|
||||
- [#73](https://github.com/gulpjs/vinyl/pull/73) Readme: use SVG images. (@d10)
|
||||
- [193e3d2](https://github.com/gulpjs/vinyl/commit/193e3d25f68c97593e011981e49db2c3e7a47d91) Readme: use SVG images. (@d10)
|
||||
- [#67](https://github.com/gulpjs/vinyl/pull/67) Set Travis to sudo:false and add node 0.12/4.x (@pdehaan)
|
||||
- [c33d85a](https://github.com/gulpjs/vinyl/commit/c33d85ab1d63fbcd272f7fb91d666006dab76d99) Set Travis to sudo:false and add node 0.12/4.x (@pdehaan)
|
||||
|
||||
### v1.1.0 (2015/10/23 06:33 +00:00)
|
||||
- [51052ad](https://github.com/gulpjs/vinyl/commit/51052add24bb1c771bf5912809b47d4d53288c48) 1.1.0
|
||||
- [#64](https://github.com/gulpjs/vinyl/pull/64) File.stem for basename without suffix (@soslan)
|
||||
- [e505375](https://github.com/gulpjs/vinyl/commit/e5053756a49ea8800cd5da12fc0eefce859ccf61) Following JSCS rules in File.stem (@soslan)
|
||||
- [d45f478](https://github.com/gulpjs/vinyl/commit/d45f478c7af3f2e956e57ce6d7550d64e3b7dbfb) Following JSCS rules (@soslan)
|
||||
- [#66](https://github.com/gulpjs/vinyl/pull/66) Replace JSHint with ESLint (@pdehaan)
|
||||
- [c5549f7](https://github.com/gulpjs/vinyl/commit/c5549f7002ae580fa9a7f7df490d6e3911af2285) Bump to eslint-config-gulp@2 (@pdehaan)
|
||||
- [f6a5512](https://github.com/gulpjs/vinyl/commit/f6a55125e7230621ecae1f395da202140baaee1d) Replace JSHint with ESLint (@pdehaan)
|
||||
- [#65](https://github.com/gulpjs/vinyl/pull/65) Add JSCS to repo (@pdehaan)
|
||||
- [f9a0101](https://github.com/gulpjs/vinyl/commit/f9a0101d013356056293d21356d4cb443613b0be) Comments should start with uppercase letters (per JSCS) (@pdehaan)
|
||||
- [6506478](https://github.com/gulpjs/vinyl/commit/650647833e3cea8d005a3ab1810ecd285418fa1e) Add JSCS to repo (@pdehaan)
|
||||
- [ae3778c](https://github.com/gulpjs/vinyl/commit/ae3778c536a898fe47bbb37e5932b300123b28b8) Documentation for File.stem (@soslan)
|
||||
- [e2246af](https://github.com/gulpjs/vinyl/commit/e2246af8aad6df348557f9d1df5001c30ff83774) add stem property to File (@soslan)
|
||||
- [#63](https://github.com/gulpjs/vinyl/pull/63) Fix broken badge URLs in README.md (@tatsuyafw)
|
||||
- [032ae7c](https://github.com/gulpjs/vinyl/commit/032ae7c5c59b72dc58041a14449d8d66af053023) Use reference links (@tatsuyafw)
|
||||
- [652bc3b](https://github.com/gulpjs/vinyl/commit/652bc3bd3cc7a6af5d21d8d759a01cee3ce46acf) Fix some broken links in README.md (@tatsuyafw)
|
||||
|
||||
### v1.0.0 (2015/09/25 22:40 +00:00)
|
||||
- [dbe943d](https://github.com/gulpjs/vinyl/commit/dbe943dad575b04995f38a35bd27962f54dc8217) 1.0.0 (@contra)
|
||||
- [0b64336](https://github.com/gulpjs/vinyl/commit/0b643367289db0cfefc6c628eff2be4ee019405c) correct url (@contra)
|
||||
- [#60](https://github.com/gulpjs/vinyl/pull/60) remove <br> from README.md (@bobintornado)
|
||||
- [d9ae5ea](https://github.com/gulpjs/vinyl/commit/d9ae5eab010fd15094c8a0260a25d1244f17df79) remove <br> from README.md (@bobintornado)
|
||||
|
||||
### v0.5.3 (2015/09/03 00:20 +00:00)
|
||||
- [6f19648](https://github.com/gulpjs/vinyl/commit/6f19648bd67040bfd0dc755ad031e1e5e0b58429) 0.5.3 (@contra)
|
||||
- [0fe8da7](https://github.com/gulpjs/vinyl/commit/0fe8da757a862bb956d88dec03ab6f99ca895f7f) add isVinyl function (@contra)
|
||||
|
||||
### v0.5.1 (2015/08/04 21:26 +00:00)
|
||||
- [81692ec](https://github.com/gulpjs/vinyl/commit/81692ece22eb3b927dba74fedb54a2acb65a36eb) 0.5.1 (@contra)
|
||||
- [#58](https://github.com/gulpjs/vinyl/pull/58) use Buffer.isBuffer instead of instanceof (@whyrusleeping)
|
||||
- [7293a71](https://github.com/gulpjs/vinyl/commit/7293a71b9daf177d9b9f600f3acf00a73b95107c) condense isBuffer module to a one liner (@whyrusleeping)
|
||||
- [e7208e2](https://github.com/gulpjs/vinyl/commit/e7208e2c27029405c7c9cf9c9a3263cdf1e0dfb8) also remove old comment (@whyrusleeping)
|
||||
- [b4ac64b](https://github.com/gulpjs/vinyl/commit/b4ac64b85ce28093f576db4f006264438f546cb8) use Buffer.isBuffer instead of instanceof (@whyrusleeping)
|
||||
- [#54](https://github.com/gulpjs/vinyl/pull/54) Fix file clone options (@danielhusar)
|
||||
- [4b42095](https://github.com/gulpjs/vinyl/commit/4b42095d8e0cb4351a503da67752da15e6b59570) Fix file clone options (@danielhusar)
|
||||
- [04f681e](https://github.com/gulpjs/vinyl/commit/04f681e4af8ffb99ea3a0a3eab1cc79793887560) closes #50 and #51 (@contra)
|
||||
|
||||
### v0.5.0 (2015/06/03 23:44 +00:00)
|
||||
- [8fea984](https://github.com/gulpjs/vinyl/commit/8fea9843e6b2aca820ccfee394927ca073f88a05) 0.5.0 (@contra)
|
||||
- [#52](https://github.com/gulpjs/vinyl/pull/52) Add explicit newlines to readme (@jeremyruppel)
|
||||
- [027142c](https://github.com/gulpjs/vinyl/commit/027142cf62a3f0a68f4659a612ee782b24c00198) Add explicit newlines to readme (@jeremyruppel)
|
||||
- [#46](https://github.com/gulpjs/vinyl/pull/46) Add dirname, basename and extname getters (@jeremyruppel)
|
||||
- [e09817f](https://github.com/gulpjs/vinyl/commit/e09817f15e4ddfc28e1b3452bbca5e2ba1fc2f19) Add dirname, basename and extname accessors (@jeremyruppel)
|
||||
- [#49](https://github.com/gulpjs/vinyl/pull/49) update license attribute (@pgilad)
|
||||
- [e5b2670](https://github.com/gulpjs/vinyl/commit/e5b2670af205ca0fb6f589a396b89ab2845a91ac) update license attribut (@pgilad)
|
||||
- [55f90e3](https://github.com/gulpjs/vinyl/commit/55f90e3763af84c7eb599bd6403dbe14f63d5513) dep updates (@contra)
|
||||
- [#48](https://github.com/gulpjs/vinyl/pull/48) Update docs for `path` and `history` (@jmm)
|
||||
- [231f32a](https://github.com/gulpjs/vinyl/commit/231f32a375aa9147d0a41ffd1ace773c45e66ee5) Document `path`. (@jmm)
|
||||
- [93df183](https://github.com/gulpjs/vinyl/commit/93df18374b62de32c76862baf73e92f33b04882a) Document `options.history`. (@jmm)
|
||||
- [2ed6a01](https://github.com/gulpjs/vinyl/commit/2ed6a012c03a78b46f9d41034969898a15fdfe15) Correct `options.path` default value docs. (@jmm)
|
||||
- [edf1ecb](https://github.com/gulpjs/vinyl/commit/edf1ecb0698f355e137f9361a9a9a2581ca485e5) Document `history`. (@jmm)
|
||||
- [#45](https://github.com/gulpjs/vinyl/pull/45) Update dependencies and devDependencies (@shinnn)
|
||||
- [f1f9dfb](https://github.com/gulpjs/vinyl/commit/f1f9dfbb1346b608226e5847161bf48e0caa2c1e) update test script (@shinnn)
|
||||
- [0737ef4](https://github.com/gulpjs/vinyl/commit/0737ef489f9cfffa2494b06edaab9a032f00eb7e) update dependencies and devDependencies (@shinnn)
|
||||
- [#43](https://github.com/gulpjs/vinyl/pull/43) Document `file.clone()` arguments (@pascalduez)
|
||||
- [3c5e95d](https://github.com/gulpjs/vinyl/commit/3c5e95d5f482ea9f28dd2d78b83166723cd121bb) Document `file.clone()` arguments (@pascalduez)
|
||||
|
||||
### v0.4.6 (2014/12/03 06:15 +00:00)
|
||||
- [8255a5f](https://github.com/gulpjs/vinyl/commit/8255a5f1de7fecb1cd5e7ba7ac1ec997395f6be1) 0.4.6 (@contra)
|
||||
- [37dafeb](https://github.com/gulpjs/vinyl/commit/37dafeb8cb0b33424e77fe67a094517925be2bef) dep update (@contra)
|
||||
|
||||
### v0.4.5 (2014/11/13 23:23 +00:00)
|
||||
- [a7a8c68](https://github.com/gulpjs/vinyl/commit/a7a8c68a1df914b1f486a54a97b68e9186699d33) 0.4.5 (@contra)
|
||||
- [ec094b4](https://github.com/gulpjs/vinyl/commit/ec094b43e36512894142baacef26dfffc5827114) reduce size by switching off lodash (@contra)
|
||||
|
||||
### v0.4.4 (2014/11/13 22:59 +00:00)
|
||||
- [61834c9](https://github.com/gulpjs/vinyl/commit/61834c9429f2e6883a18f377bc5893031ea1c94f) 0.4.4 (@contra)
|
||||
- [fd887b3](https://github.com/gulpjs/vinyl/commit/fd887b3d21ed47c2b4cf40b0c0ed7b2df9048b09) ignore some files for size reasons (@contra)
|
||||
- [#37](https://github.com/gulpjs/vinyl/pull/37) Don't package coverage into NPM (@Dapperbot)
|
||||
- [9b811b8](https://github.com/gulpjs/vinyl/commit/9b811b86529e2b4b0cc20936a6697b3d9df503a2) Don't package coverage into NPM (@lotyrin)
|
||||
|
||||
### v0.4.3 (2014/09/01 18:17 +00:00)
|
||||
- [6eae432](https://github.com/gulpjs/vinyl/commit/6eae432519b007c313a8df83b093adfb97a2944c) 0.4.3 (@contra)
|
||||
- [d220c85](https://github.com/gulpjs/vinyl/commit/d220c857259f0070ab38c7b50d90f184a919e472) fix funky history passing, closes #35 (@contra)
|
||||
|
||||
### v0.4.2 (2014/08/29 15:58 +00:00)
|
||||
- [f33d6d5](https://github.com/gulpjs/vinyl/commit/f33d6d5c1b9d1f83e238521651114beb90a01019) 0.4.2 (@contra)
|
||||
- [cd0d042](https://github.com/gulpjs/vinyl/commit/cd0d04272297363f27f8456818dbf675618939c3) remove native clone (@contra)
|
||||
- [e4d8b99](https://github.com/gulpjs/vinyl/commit/e4d8b99c21a50700afd17173e1f3a2076e6fe860) minor speed enhancements (@contra)
|
||||
- [2353e39](https://github.com/gulpjs/vinyl/commit/2353e3996ac67629da92c2af906bdfdbc6978065) minor speed ups (@contra)
|
||||
|
||||
### v0.4.1 (2014/08/29 14:34 +00:00)
|
||||
- [0014b9b](https://github.com/gulpjs/vinyl/commit/0014b9bf4166fb5cbe94c439201752cda7991a70) 0.4.1 (@contra)
|
||||
- [0142513](https://github.com/gulpjs/vinyl/commit/0142513b0727ad6a018b0944fea2bb4966d8bbfa) fix history cloning bug (@contra)
|
||||
|
||||
### v0.4.0 (2014/08/29 07:07 +00:00)
|
||||
- [80d3f61](https://github.com/gulpjs/vinyl/commit/80d3f61445b347fc1c34f462f0ab800644e90e04) 0.4.0 (@contra)
|
||||
- [#33](https://github.com/gulpjs/vinyl/pull/33) Clone stream (@popomore)
|
||||
- [d37b57b](https://github.com/gulpjs/vinyl/commit/d37b57bba0aa1fba18d9fecec3513ac4e61b27cd) coverage 100% :sparkles: (@popomore)
|
||||
- [b5a62f0](https://github.com/gulpjs/vinyl/commit/b5a62f0ede71bdeae957e8653e6ccbdca998879c) fix testcase and delete duplicate testcase (@popomore)
|
||||
- [fb1b15d](https://github.com/gulpjs/vinyl/commit/fb1b15da472647743eb4e829b99f64d6d9f751fa) Adding more test (@nfroidure)
|
||||
- [acea889](https://github.com/gulpjs/vinyl/commit/acea8894e9d983d8037641b4ff6f08b666056979) Fixing the clone method (@nfroidure)
|
||||
- [#32](https://github.com/gulpjs/vinyl/pull/32) improve clone (@popomore)
|
||||
- [037e830](https://github.com/gulpjs/vinyl/commit/037e8300b75fdddf9c3e003fd205da7ec13b9157) object should multiline (@popomore)
|
||||
- [7724121](https://github.com/gulpjs/vinyl/commit/7724121194a4ac94fb23a0048ff926d00a784ecc) pass jshint (@popomore)
|
||||
- [f76a921](https://github.com/gulpjs/vinyl/commit/f76a9211b8b495d81074884d8ea6454a20bba349) use node-v8-clone for performance, fallback to lodash #29 (@popomore)
|
||||
- [7638f07](https://github.com/gulpjs/vinyl/commit/7638f072bf33a427ec8324a0fb463f73cb9fc8f2) option to not clone buffer #16 (@popomore)
|
||||
- [6bfd73c](https://github.com/gulpjs/vinyl/commit/6bfd73cc459907a06ce9affc373599ffb8130c08) copy all attributes deeply #29 (@popomore)
|
||||
- [b34f813](https://github.com/gulpjs/vinyl/commit/b34f8135d47e0a2ba3be6f769729ba66931b3234) add testcase for clone history (@popomore)
|
||||
- [a913edf](https://github.com/gulpjs/vinyl/commit/a913edf1dd91c5bdcfc9ff3149a94eae131006aa) fix mixed quote and unused variable (@popomore)
|
||||
|
||||
### v0.3.3 (2014/08/28 13:50 +00:00)
|
||||
- [c801d3d](https://github.com/gulpjs/vinyl/commit/c801d3dc354383cf2656338d63908ec2983e3612) 0.3.3 (@contra)
|
||||
- [f13970e](https://github.com/gulpjs/vinyl/commit/f13970e3cc5d1d730f94316daeee5b5c0e6c00f3) fix jshint on tests (@contra)
|
||||
- [6186101](https://github.com/gulpjs/vinyl/commit/61861017bc22a786a026730cf5c55d23c657abea) closes #31 (@contra)
|
||||
- [#24](https://github.com/gulpjs/vinyl/pull/24) path get/set for recording path change (@popomore)
|
||||
- [6eab1c4](https://github.com/gulpjs/vinyl/commit/6eab1c4f1376aec901d8869d3d410953f1c93e9f) done (@contra)
|
||||
|
||||
### v0.3.2 (2014/07/30 23:22 +00:00)
|
||||
- [44ef836](https://github.com/gulpjs/vinyl/commit/44ef8369e1a0a7ba01da4608d01166c5a5d8cbe1) 0.3.2 (@contra)
|
||||
- [ae28ff2](https://github.com/gulpjs/vinyl/commit/ae28ff200c034e9a40babb38886cdc7ef97a0f25) oops, thats what i get for coding from a car (@contra)
|
||||
|
||||
### v0.3.1 (2014/07/30 22:35 +00:00)
|
||||
- [03b7578](https://github.com/gulpjs/vinyl/commit/03b75789e58b43bdaef9ca166e4062b8ccfdefb9) 0.3.1 (@contra)
|
||||
- [64850ff](https://github.com/gulpjs/vinyl/commit/64850ffdf4d31b35ac1160d0d495644cadd52914) fix deep deps, closes #28 (@contra)
|
||||
|
||||
### v0.3.0 (2014/07/19 04:57 +00:00)
|
||||
- [dcb77f3](https://github.com/gulpjs/vinyl/commit/dcb77f3246d1011a430c20f883eb89c520206ca6) 0.3.0 (@contra)
|
||||
- [#27](https://github.com/gulpjs/vinyl/pull/27) Clone custom properties (@vweevers)
|
||||
- [95710de](https://github.com/gulpjs/vinyl/commit/95710de62f4c1234a244a6818b5e39d92ea7b9a8) fix relative path test for windows (@vweevers)
|
||||
- [e493187](https://github.com/gulpjs/vinyl/commit/e493187b3f2fd1485077f09e73e669407ac077d3) clone custom properties (@laurelnaiad)
|
||||
- [e50ceac](https://github.com/gulpjs/vinyl/commit/e50ceacfc3daa825e111976ba4192cb93c80bfe2) throw when set path is null (@popomore)
|
||||
- [7c71bf3](https://github.com/gulpjs/vinyl/commit/7c71bf3d806a98730a0ce5edd56c0b8f1f42e8f0) remove initialize of this.path (@popomore)
|
||||
- [d95023f](https://github.com/gulpjs/vinyl/commit/d95023f6604a990d38e4f5b332c7916ceb012366) delete this._path :tongue: (@popomore)
|
||||
- [f3f9be0](https://github.com/gulpjs/vinyl/commit/f3f9be0f3d76b4125353cd936731f70015d44284) path get/set for recording path change #19 (@popomore)
|
||||
- [#21](https://github.com/gulpjs/vinyl/pull/21) LICENSE: Remove executable mode (@felixrabe)
|
||||
- [#22](https://github.com/gulpjs/vinyl/pull/22) Travis: Dump node 0.9 - travis-ci/travis-ci#2251 (@felixrabe)
|
||||
- [70a2193](https://github.com/gulpjs/vinyl/commit/70a219346c00e0db6be1a0aa55c183e7d5b80ad1) Travis: Dump node 0.9 - travis-ci/travis-ci#2251 (@felixrabe)
|
||||
- [460eed5](https://github.com/gulpjs/vinyl/commit/460eed58de9cb04d44e35b6bebbfbaea9146015f) LICENSE: Remove executable mode (@felixrabe)
|
||||
- [#18](https://github.com/gulpjs/vinyl/pull/18) fix typo (@vvakame)
|
||||
- [1783e7f](https://github.com/gulpjs/vinyl/commit/1783e7f031ecfb118ee9b43971a72be264caa144) fix typo (@vvakame)
|
||||
- [#11](https://github.com/gulpjs/vinyl/pull/11) Correct README about pipe's end option. (@shuhei)
|
||||
- [1824ec9](https://github.com/gulpjs/vinyl/commit/1824ec9cefd276557b7338dfdbd54922599f020a) Correct README about pipe's end option. (@shuhei)
|
||||
- [f49b9c3](https://github.com/gulpjs/vinyl/commit/f49b9c325229754229726ed530c579e4ac23252b) remove dead line (@contra)
|
||||
- [1ca8e46](https://github.com/gulpjs/vinyl/commit/1ca8e463259c2a395d5d41b528b04a89a953f6b7) dep update, new coveralls stuff (@contra)
|
||||
- [f00767b](https://github.com/gulpjs/vinyl/commit/f00767bf8b61ca8a7b25f3ebd3dde297fa2dafd7) bump (@contra)
|
||||
- [#8](https://github.com/gulpjs/vinyl/pull/8) Correct File.clone() treatment of File.stats (@hughsk)
|
||||
- [bc3acf7](https://github.com/gulpjs/vinyl/commit/bc3acf7b1ed712d70e7d8cb4f6e5248124743ec7) Add test for new File.clone() functionality (@hughsk)
|
||||
- [dd668fb](https://github.com/gulpjs/vinyl/commit/dd668fb5aaed02cfb0f63a58f027c937dd7e0467) Use clone-stats module to clone fs.Stats instances. (@hughsk)
|
||||
- [b6244c5](https://github.com/gulpjs/vinyl/commit/b6244c52d3bf9bd87bd6b926f0486f407627f7e0) Correct File.clone() treatment of File.stats (@hughsk)
|
||||
- [796ba8b](https://github.com/gulpjs/vinyl/commit/796ba8b5ddd658fed3393c7d0a0d7bea7befa1b1) 0.2.1 - fixes #2 (@contra)
|
||||
- [bffa6a4](https://github.com/gulpjs/vinyl/commit/bffa6a4e323e18e084b5b1444b4537aa3fb3e109) vinyl-fs movement? (@contra)
|
||||
- [cfaa0a0](https://github.com/gulpjs/vinyl/commit/cfaa0a02b7794e493f600d1d36b288294a278e6c) fix isDirectory tests (@contra)
|
||||
- [05d1f1b](https://github.com/gulpjs/vinyl/commit/05d1f1b741960cce8e8d2702d326ebb0187935ad) add isDirectory (@contra)
|
||||
- [76580e5](https://github.com/gulpjs/vinyl/commit/76580e573870885580ac00dd9175e562d008cb81) bump to 0.1.0 (@contra)
|
||||
- [f7a15c4](https://github.com/gulpjs/vinyl/commit/f7a15c41ac5e82de930e161f6b109ae3336d337b) readme 0.9+ (@contra)
|
||||
- [fc7f192](https://github.com/gulpjs/vinyl/commit/fc7f1925b2a18466f19db062ad28df02f1db823b) drop 0.8 support (@contra)
|
||||
- [c004b6c](https://github.com/gulpjs/vinyl/commit/c004b6c857d03a292e8ecd5020ad0420d82dbf1e) target 0.8+ (@contra)
|
||||
- [edf20bd](https://github.com/gulpjs/vinyl/commit/edf20bd8563fca6e8a568b9d08fb728f6705573c) add small example (@contra)
|
||||
- [d8c63fe](https://github.com/gulpjs/vinyl/commit/d8c63fe0fd16cf13db2d9a6452c979ec12779428) 0.0.1 (@contra)
|
||||
20
node_modules/decompress-unzip/node_modules/vinyl/LICENSE
generated
vendored
20
node_modules/decompress-unzip/node_modules/vinyl/LICENSE
generated
vendored
@@ -1,20 +0,0 @@
|
||||
Copyright (c) 2013 Fractal <contact@wearefractal.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:
|
||||
|
||||
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.
|
||||
265
node_modules/decompress-unzip/node_modules/vinyl/README.md
generated
vendored
265
node_modules/decompress-unzip/node_modules/vinyl/README.md
generated
vendored
@@ -1,265 +0,0 @@
|
||||
# vinyl [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Dependency Status][depstat-image]][depstat-url]
|
||||
|
||||
## Information
|
||||
<table><tr><td>Package</td><td>vinyl</td></tr><tr><td>Description</td><td>A virtual file format</td></tr><tr><td>Node Version</td><td>>= 0.9</td></tr></table>
|
||||
|
||||
## What is this?
|
||||
Read this for more info about how this plays into the grand scheme of things [https://medium.com/@eschoff/3828e8126466](https://medium.com/@eschoff/3828e8126466)
|
||||
|
||||
## File
|
||||
|
||||
```javascript
|
||||
var File = require('vinyl');
|
||||
|
||||
var coffeeFile = new File({
|
||||
cwd: "/",
|
||||
base: "/test/",
|
||||
path: "/test/file.coffee",
|
||||
contents: new Buffer("test = 123")
|
||||
});
|
||||
```
|
||||
|
||||
### isVinyl
|
||||
When checking if an object is a vinyl file, you should not use instanceof. Use the isVinyl function instead.
|
||||
|
||||
```js
|
||||
var File = require('vinyl');
|
||||
|
||||
var dummy = new File({stuff});
|
||||
var notAFile = {};
|
||||
|
||||
File.isVinyl(dummy); // true
|
||||
File.isVinyl(notAFile); // false
|
||||
```
|
||||
|
||||
### isCustomProp
|
||||
Vinyl checks if a property is not managed internally, such as `sourceMap`. This is than used in `constructor(options)` when setting, and `clone()` when copying properties.
|
||||
|
||||
```js
|
||||
var File = require('vinyl');
|
||||
|
||||
File.isCustomProp('sourceMap'); // true
|
||||
File.isCustomProp('path'); // false -> internal getter/setter
|
||||
```
|
||||
|
||||
Read more in [Extending Vinyl](#extending-vinyl).
|
||||
|
||||
### constructor(options)
|
||||
#### options.cwd
|
||||
Type: `String`<br><br>Default: `process.cwd()`
|
||||
|
||||
#### options.base
|
||||
Used for relative pathing. Typically where a glob starts.
|
||||
|
||||
Type: `String`<br><br>Default: `options.cwd`
|
||||
|
||||
#### options.path
|
||||
Full path to the file.
|
||||
|
||||
Type: `String`<br><br>Default: `undefined`
|
||||
|
||||
#### options.history
|
||||
Path history. Has no effect if `options.path` is passed.
|
||||
|
||||
Type: `Array`<br><br>Default: `options.path ? [options.path] : []`
|
||||
|
||||
#### options.stat
|
||||
The result of an fs.stat call. See [fs.Stats](http://nodejs.org/api/fs.html#fs_class_fs_stats) for more information.
|
||||
|
||||
Type: `fs.Stats`<br><br>Default: `null`
|
||||
|
||||
#### options.contents
|
||||
File contents.
|
||||
|
||||
Type: `Buffer, Stream, or null`<br><br>Default: `null`
|
||||
|
||||
#### options.{custom}
|
||||
Any other option properties will just be assigned to the new File object.
|
||||
|
||||
```js
|
||||
var File = require('vinyl');
|
||||
|
||||
var file = new File({foo: 'bar'});
|
||||
file.foo === 'bar'; // true
|
||||
```
|
||||
|
||||
### isBuffer()
|
||||
Returns true if file.contents is a Buffer.
|
||||
|
||||
### isStream()
|
||||
Returns true if file.contents is a Stream.
|
||||
|
||||
### isNull()
|
||||
Returns true if file.contents is null.
|
||||
|
||||
### clone([opt])
|
||||
Returns a new File object with all attributes cloned.<br>By default custom attributes are deep-cloned.
|
||||
|
||||
If opt or opt.deep is false, custom attributes will not be deep-cloned.
|
||||
|
||||
If opt.contents is false, it will copy file.contents Buffer's reference.
|
||||
|
||||
### pipe(stream[, opt])
|
||||
If file.contents is a Buffer, it will write it to the stream.
|
||||
|
||||
If file.contents is a Stream, it will pipe it to the stream.
|
||||
|
||||
If file.contents is null, it will do nothing.
|
||||
|
||||
If opt.end is false, the destination stream will not be ended (same as node core).
|
||||
|
||||
Returns the stream.
|
||||
|
||||
### inspect()
|
||||
Returns a pretty String interpretation of the File. Useful for console.log.
|
||||
|
||||
### contents
|
||||
The [Stream](https://nodejs.org/api/stream.html#stream_stream) or [Buffer](https://nodejs.org/api/buffer.html#buffer_class_buffer) of the file as it was passed in via options, or as the result of modification.
|
||||
|
||||
For example:
|
||||
|
||||
```js
|
||||
if (file.isBuffer()) {
|
||||
console.log(file.contents.toString()); // logs out the string of contents
|
||||
}
|
||||
```
|
||||
|
||||
### path
|
||||
Absolute pathname string or `undefined`. Setting to a different value pushes the old value to `history`.
|
||||
|
||||
### history
|
||||
Array of `path` values the file object has had, from `history[0]` (original) through `history[history.length - 1]` (current). `history` and its elements should normally be treated as read-only and only altered indirectly by setting `path`.
|
||||
|
||||
### relative
|
||||
Returns path.relative for the file base and file path.
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
var file = new File({
|
||||
cwd: "/",
|
||||
base: "/test/",
|
||||
path: "/test/file.coffee"
|
||||
});
|
||||
|
||||
console.log(file.relative); // file.coffee
|
||||
```
|
||||
|
||||
### dirname
|
||||
Gets and sets path.dirname for the file path.
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
var file = new File({
|
||||
cwd: "/",
|
||||
base: "/test/",
|
||||
path: "/test/file.coffee"
|
||||
});
|
||||
|
||||
console.log(file.dirname); // /test
|
||||
|
||||
file.dirname = '/specs';
|
||||
|
||||
console.log(file.dirname); // /specs
|
||||
console.log(file.path); // /specs/file.coffee
|
||||
```
|
||||
|
||||
### basename
|
||||
Gets and sets path.basename for the file path.
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
var file = new File({
|
||||
cwd: "/",
|
||||
base: "/test/",
|
||||
path: "/test/file.coffee"
|
||||
});
|
||||
|
||||
console.log(file.basename); // file.coffee
|
||||
|
||||
file.basename = 'file.js';
|
||||
|
||||
console.log(file.basename); // file.js
|
||||
console.log(file.path); // /test/file.js
|
||||
```
|
||||
|
||||
### stem
|
||||
Gets and sets stem (filename without suffix) for the file path.
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
var file = new File({
|
||||
cwd: "/",
|
||||
base: "/test/",
|
||||
path: "/test/file.coffee"
|
||||
});
|
||||
|
||||
console.log(file.stem); // file
|
||||
|
||||
file.stem = 'foo';
|
||||
|
||||
console.log(file.stem); // foo
|
||||
console.log(file.path); // /test/foo.coffee
|
||||
```
|
||||
|
||||
### extname
|
||||
Gets and sets path.extname for the file path.
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
var file = new File({
|
||||
cwd: "/",
|
||||
base: "/test/",
|
||||
path: "/test/file.coffee"
|
||||
});
|
||||
|
||||
console.log(file.extname); // .coffee
|
||||
|
||||
file.extname = '.js';
|
||||
|
||||
console.log(file.extname); // .js
|
||||
console.log(file.path); // /test/file.js
|
||||
```
|
||||
|
||||
## Extending Vinyl
|
||||
When extending Vinyl into your own class with extra features, you need to think about a few things.
|
||||
|
||||
When you have your own properties that are managed internally, you need to extend the static `isCustomProp` method to return `false` when one of these properties is queried.
|
||||
|
||||
```js
|
||||
const File = require('vinyl');
|
||||
|
||||
const builtInProps = ['foo', '_foo'];
|
||||
|
||||
class SuperFile extends File {
|
||||
constructor(options) {
|
||||
super(options);
|
||||
this._foo = 'example internal read-only value';
|
||||
}
|
||||
|
||||
get foo() {
|
||||
return this._foo;
|
||||
}
|
||||
|
||||
static isCustomProp(name) {
|
||||
return super.isCustomProp(name) && builtInProps.indexOf(name) === -1;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This makes properties `foo` and `_foo` ignored when cloning, and when passed in options to `constructor(options)` so they don't get assigned to the new object.
|
||||
|
||||
Same goes for `clone()`. If you have your own internal stuff that needs special handling during cloning, you should extend it to do so.
|
||||
|
||||
[npm-url]: https://npmjs.org/package/vinyl
|
||||
[npm-image]: https://badge.fury.io/js/vinyl.svg
|
||||
[travis-url]: https://travis-ci.org/gulpjs/vinyl
|
||||
[travis-image]: https://travis-ci.org/gulpjs/vinyl.svg?branch=master
|
||||
[coveralls-url]: https://coveralls.io/github/gulpjs/vinyl
|
||||
[coveralls-image]: https://coveralls.io/repos/github/gulpjs/vinyl/badge.svg
|
||||
[depstat-url]: https://david-dm.org/gulpjs/vinyl
|
||||
[depstat-image]: https://david-dm.org/gulpjs/vinyl.svg
|
||||
270
node_modules/decompress-unzip/node_modules/vinyl/index.js
generated
vendored
270
node_modules/decompress-unzip/node_modules/vinyl/index.js
generated
vendored
@@ -1,270 +0,0 @@
|
||||
var path = require('path');
|
||||
var clone = require('clone');
|
||||
var cloneStats = require('clone-stats');
|
||||
var cloneBuffer = require('./lib/cloneBuffer');
|
||||
var isBuffer = require('./lib/isBuffer');
|
||||
var isStream = require('./lib/isStream');
|
||||
var isNull = require('./lib/isNull');
|
||||
var inspectStream = require('./lib/inspectStream');
|
||||
var Stream = require('stream');
|
||||
var replaceExt = require('replace-ext');
|
||||
|
||||
var builtInFields = [
|
||||
'_contents', 'contents', 'stat', 'history', 'path', 'base', 'cwd',
|
||||
];
|
||||
|
||||
function File(file) {
|
||||
var self = this;
|
||||
|
||||
if (!file) {
|
||||
file = {};
|
||||
}
|
||||
|
||||
// Record path change
|
||||
var history = file.path ? [file.path] : file.history;
|
||||
this.history = history || [];
|
||||
|
||||
this.cwd = file.cwd || process.cwd();
|
||||
this.base = file.base || this.cwd;
|
||||
|
||||
// Stat = files stats object
|
||||
this.stat = file.stat || null;
|
||||
|
||||
// Contents = stream, buffer, or null if not read
|
||||
this.contents = file.contents || null;
|
||||
|
||||
this._isVinyl = true;
|
||||
|
||||
// Set custom properties
|
||||
Object.keys(file).forEach(function(key) {
|
||||
if (self.constructor.isCustomProp(key)) {
|
||||
self[key] = file[key];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
File.prototype.isBuffer = function() {
|
||||
return isBuffer(this.contents);
|
||||
};
|
||||
|
||||
File.prototype.isStream = function() {
|
||||
return isStream(this.contents);
|
||||
};
|
||||
|
||||
File.prototype.isNull = function() {
|
||||
return isNull(this.contents);
|
||||
};
|
||||
|
||||
// TODO: Should this be moved to vinyl-fs?
|
||||
File.prototype.isDirectory = function() {
|
||||
return this.isNull() && this.stat && this.stat.isDirectory();
|
||||
};
|
||||
|
||||
File.prototype.clone = function(opt) {
|
||||
var self = this;
|
||||
|
||||
if (typeof opt === 'boolean') {
|
||||
opt = {
|
||||
deep: opt,
|
||||
contents: true,
|
||||
};
|
||||
} else if (!opt) {
|
||||
opt = {
|
||||
deep: true,
|
||||
contents: true,
|
||||
};
|
||||
} else {
|
||||
opt.deep = opt.deep === true;
|
||||
opt.contents = opt.contents !== false;
|
||||
}
|
||||
|
||||
// Clone our file contents
|
||||
var contents;
|
||||
if (this.isStream()) {
|
||||
contents = this.contents.pipe(new Stream.PassThrough());
|
||||
this.contents = this.contents.pipe(new Stream.PassThrough());
|
||||
} else if (this.isBuffer()) {
|
||||
contents = opt.contents ? cloneBuffer(this.contents) : this.contents;
|
||||
}
|
||||
|
||||
var file = new this.constructor({
|
||||
cwd: this.cwd,
|
||||
base: this.base,
|
||||
stat: (this.stat ? cloneStats(this.stat) : null),
|
||||
history: this.history.slice(),
|
||||
contents: contents,
|
||||
});
|
||||
|
||||
// Clone our custom properties
|
||||
Object.keys(this).forEach(function(key) {
|
||||
if (self.constructor.isCustomProp(key)) {
|
||||
file[key] = opt.deep ? clone(self[key], true) : self[key];
|
||||
}
|
||||
});
|
||||
return file;
|
||||
};
|
||||
|
||||
File.prototype.pipe = function(stream, opt) {
|
||||
if (!opt) {
|
||||
opt = {};
|
||||
}
|
||||
if (typeof opt.end === 'undefined') {
|
||||
opt.end = true;
|
||||
}
|
||||
|
||||
if (this.isStream()) {
|
||||
return this.contents.pipe(stream, opt);
|
||||
}
|
||||
if (this.isBuffer()) {
|
||||
if (opt.end) {
|
||||
stream.end(this.contents);
|
||||
} else {
|
||||
stream.write(this.contents);
|
||||
}
|
||||
return stream;
|
||||
}
|
||||
|
||||
// Check if isNull
|
||||
if (opt.end) {
|
||||
stream.end();
|
||||
}
|
||||
return stream;
|
||||
};
|
||||
|
||||
File.prototype.inspect = function() {
|
||||
var inspect = [];
|
||||
|
||||
// Use relative path if possible
|
||||
var filePath = (this.base && this.path) ? this.relative : this.path;
|
||||
|
||||
if (filePath) {
|
||||
inspect.push('"' + filePath + '"');
|
||||
}
|
||||
|
||||
if (this.isBuffer()) {
|
||||
inspect.push(this.contents.inspect());
|
||||
}
|
||||
|
||||
if (this.isStream()) {
|
||||
inspect.push(inspectStream(this.contents));
|
||||
}
|
||||
|
||||
return '<File ' + inspect.join(' ') + '>';
|
||||
};
|
||||
|
||||
File.isCustomProp = function(key) {
|
||||
return builtInFields.indexOf(key) === -1;
|
||||
};
|
||||
|
||||
File.isVinyl = function(file) {
|
||||
return (file && file._isVinyl === true) || false;
|
||||
};
|
||||
|
||||
// Virtual attributes
|
||||
// Or stuff with extra logic
|
||||
Object.defineProperty(File.prototype, 'contents', {
|
||||
get: function() {
|
||||
return this._contents;
|
||||
},
|
||||
set: function(val) {
|
||||
if (!isBuffer(val) && !isStream(val) && !isNull(val)) {
|
||||
throw new Error('File.contents can only be a Buffer, a Stream, or null.');
|
||||
}
|
||||
this._contents = val;
|
||||
},
|
||||
});
|
||||
|
||||
// TODO: Should this be moved to vinyl-fs?
|
||||
Object.defineProperty(File.prototype, 'relative', {
|
||||
get: function() {
|
||||
if (!this.base) {
|
||||
throw new Error('No base specified! Can not get relative.');
|
||||
}
|
||||
if (!this.path) {
|
||||
throw new Error('No path specified! Can not get relative.');
|
||||
}
|
||||
return path.relative(this.base, this.path);
|
||||
},
|
||||
set: function() {
|
||||
throw new Error('File.relative is generated from the base and path attributes. Do not modify it.');
|
||||
},
|
||||
});
|
||||
|
||||
Object.defineProperty(File.prototype, 'dirname', {
|
||||
get: function() {
|
||||
if (!this.path) {
|
||||
throw new Error('No path specified! Can not get dirname.');
|
||||
}
|
||||
return path.dirname(this.path);
|
||||
},
|
||||
set: function(dirname) {
|
||||
if (!this.path) {
|
||||
throw new Error('No path specified! Can not set dirname.');
|
||||
}
|
||||
this.path = path.join(dirname, path.basename(this.path));
|
||||
},
|
||||
});
|
||||
|
||||
Object.defineProperty(File.prototype, 'basename', {
|
||||
get: function() {
|
||||
if (!this.path) {
|
||||
throw new Error('No path specified! Can not get basename.');
|
||||
}
|
||||
return path.basename(this.path);
|
||||
},
|
||||
set: function(basename) {
|
||||
if (!this.path) {
|
||||
throw new Error('No path specified! Can not set basename.');
|
||||
}
|
||||
this.path = path.join(path.dirname(this.path), basename);
|
||||
},
|
||||
});
|
||||
|
||||
// Property for getting/setting stem of the filename.
|
||||
Object.defineProperty(File.prototype, 'stem', {
|
||||
get: function() {
|
||||
if (!this.path) {
|
||||
throw new Error('No path specified! Can not get stem.');
|
||||
}
|
||||
return path.basename(this.path, this.extname);
|
||||
},
|
||||
set: function(stem) {
|
||||
if (!this.path) {
|
||||
throw new Error('No path specified! Can not set stem.');
|
||||
}
|
||||
this.path = path.join(path.dirname(this.path), stem + this.extname);
|
||||
},
|
||||
});
|
||||
|
||||
Object.defineProperty(File.prototype, 'extname', {
|
||||
get: function() {
|
||||
if (!this.path) {
|
||||
throw new Error('No path specified! Can not get extname.');
|
||||
}
|
||||
return path.extname(this.path);
|
||||
},
|
||||
set: function(extname) {
|
||||
if (!this.path) {
|
||||
throw new Error('No path specified! Can not set extname.');
|
||||
}
|
||||
this.path = replaceExt(this.path, extname);
|
||||
},
|
||||
});
|
||||
|
||||
Object.defineProperty(File.prototype, 'path', {
|
||||
get: function() {
|
||||
return this.history[this.history.length - 1];
|
||||
},
|
||||
set: function(path) {
|
||||
if (typeof path !== 'string') {
|
||||
throw new Error('path should be string');
|
||||
}
|
||||
|
||||
// Record history only when path changed
|
||||
if (path && path !== this.path) {
|
||||
this.history.push(path);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
module.exports = File;
|
||||
7
node_modules/decompress-unzip/node_modules/vinyl/lib/cloneBuffer.js
generated
vendored
7
node_modules/decompress-unzip/node_modules/vinyl/lib/cloneBuffer.js
generated
vendored
@@ -1,7 +0,0 @@
|
||||
var Buffer = require('buffer').Buffer;
|
||||
|
||||
module.exports = function(buf) {
|
||||
var out = new Buffer(buf.length);
|
||||
buf.copy(out);
|
||||
return out;
|
||||
};
|
||||
15
node_modules/decompress-unzip/node_modules/vinyl/lib/inspectStream.js
generated
vendored
15
node_modules/decompress-unzip/node_modules/vinyl/lib/inspectStream.js
generated
vendored
@@ -1,15 +0,0 @@
|
||||
var isStream = require('./isStream');
|
||||
|
||||
module.exports = function(stream) {
|
||||
if (!isStream(stream)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var streamType = stream.constructor.name;
|
||||
// Avoid StreamStream
|
||||
if (streamType === 'Stream') {
|
||||
streamType = '';
|
||||
}
|
||||
|
||||
return '<' + streamType + 'Stream>';
|
||||
};
|
||||
1
node_modules/decompress-unzip/node_modules/vinyl/lib/isBuffer.js
generated
vendored
1
node_modules/decompress-unzip/node_modules/vinyl/lib/isBuffer.js
generated
vendored
@@ -1 +0,0 @@
|
||||
module.exports = require('buffer').Buffer.isBuffer;
|
||||
3
node_modules/decompress-unzip/node_modules/vinyl/lib/isNull.js
generated
vendored
3
node_modules/decompress-unzip/node_modules/vinyl/lib/isNull.js
generated
vendored
@@ -1,3 +0,0 @@
|
||||
module.exports = function(v) {
|
||||
return v === null;
|
||||
};
|
||||
5
node_modules/decompress-unzip/node_modules/vinyl/lib/isStream.js
generated
vendored
5
node_modules/decompress-unzip/node_modules/vinyl/lib/isStream.js
generated
vendored
@@ -1,5 +0,0 @@
|
||||
var Stream = require('stream').Stream;
|
||||
|
||||
module.exports = function(o) {
|
||||
return !!o && o instanceof Stream;
|
||||
};
|
||||
44
node_modules/decompress-unzip/node_modules/vinyl/package.json
generated
vendored
44
node_modules/decompress-unzip/node_modules/vinyl/package.json
generated
vendored
@@ -1,44 +0,0 @@
|
||||
{
|
||||
"name": "vinyl",
|
||||
"description": "A virtual file format",
|
||||
"version": "1.2.0",
|
||||
"homepage": "http://github.com/gulpjs/vinyl",
|
||||
"repository": "git://github.com/gulpjs/vinyl.git",
|
||||
"author": "Fractal <contact@wearefractal.com> (http://wearefractal.com/)",
|
||||
"main": "./index.js",
|
||||
"files": [
|
||||
"index.js",
|
||||
"lib"
|
||||
],
|
||||
"dependencies": {
|
||||
"clone": "^1.0.0",
|
||||
"clone-stats": "^0.0.1",
|
||||
"replace-ext": "0.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"buffer-equal": "0.0.1",
|
||||
"eslint": "^1.7.3",
|
||||
"eslint-config-gulp": "^2.0.0",
|
||||
"event-stream": "^3.1.0",
|
||||
"github-changes": "^1.0.1",
|
||||
"istanbul": "^0.3.0",
|
||||
"istanbul-coveralls": "^1.0.1",
|
||||
"jscs": "^2.3.5",
|
||||
"jscs-preset-gulp": "^1.0.0",
|
||||
"lodash.templatesettings": "^3.1.0",
|
||||
"mocha": "^2.0.0",
|
||||
"rimraf": "^2.2.5",
|
||||
"should": "^7.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint . && jscs *.js lib/ test/",
|
||||
"pretest": "npm run lint",
|
||||
"test": "mocha",
|
||||
"coveralls": "istanbul cover _mocha && istanbul-coveralls",
|
||||
"changelog": "github-changes -o gulpjs -r vinyl -b master -f ./CHANGELOG.md --order-semver --use-commit-body"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.9"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
24
node_modules/decompress-unzip/package.json
generated
vendored
24
node_modules/decompress-unzip/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "decompress-unzip",
|
||||
"version": "3.4.0",
|
||||
"version": "4.0.1",
|
||||
"description": "decompress zip plugin",
|
||||
"license": "MIT",
|
||||
"repository": "kevva/decompress-unzip",
|
||||
@@ -10,7 +10,7 @@
|
||||
"url": "https://github.com/kevva"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
"node": ">=4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
@@ -22,24 +22,20 @@
|
||||
"decompress",
|
||||
"decompressplugin",
|
||||
"extract",
|
||||
"gulpplugin",
|
||||
"zip"
|
||||
],
|
||||
"dependencies": {
|
||||
"is-zip": "^1.0.0",
|
||||
"read-all-stream": "^3.0.0",
|
||||
"stat-mode": "^0.2.0",
|
||||
"strip-dirs": "^1.0.0",
|
||||
"through2": "^2.0.0",
|
||||
"vinyl": "^1.0.0",
|
||||
"yauzl": "^2.2.1"
|
||||
"file-type": "^3.8.0",
|
||||
"get-stream": "^2.2.0",
|
||||
"pify": "^2.3.0",
|
||||
"yauzl": "^2.4.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^0.2.0",
|
||||
"buffer-equal": "^0.0.1",
|
||||
"got": "^4.2.0",
|
||||
"ava": "*",
|
||||
"is-jpg": "^1.0.0",
|
||||
"vinyl-file": "^1.1.0",
|
||||
"xo": "*"
|
||||
},
|
||||
"xo": {
|
||||
"esnext": true
|
||||
}
|
||||
}
|
||||
|
||||
36
node_modules/decompress-unzip/readme.md
generated
vendored
36
node_modules/decompress-unzip/readme.md
generated
vendored
@@ -13,42 +13,28 @@ $ npm install --save decompress-unzip
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const Decompress = require('decompress');
|
||||
const decompress = require('decompress');
|
||||
const decompressUnzip = require('decompress-unzip');
|
||||
|
||||
new Decompress()
|
||||
.src('foo.zip')
|
||||
.dest('dest')
|
||||
.use(decompressUnzip({strip: 1}))
|
||||
.run();
|
||||
```
|
||||
|
||||
You can also use this plugin with [gulp](http://gulpjs.com):
|
||||
|
||||
```js
|
||||
const decompressUnzip = require('decompress-unzip');
|
||||
const gulp = require('gulp');
|
||||
const vinylAssign = require('vinyl-assign');
|
||||
|
||||
gulp.task('default', () => {
|
||||
return gulp.src('foo.zip')
|
||||
.pipe(vinylAssign({extract: true}))
|
||||
.pipe(decompressUnzip({strip: 1}))
|
||||
.pipe(gulp.dest('dest'));
|
||||
decompress('unicorn.zip', 'dist', {
|
||||
plugins: [
|
||||
decompressUnzip()
|
||||
]
|
||||
}).then(() => {
|
||||
console.log('Files decompressed');
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### decompressUnzip(options)
|
||||
### decompressUnzip()(buf)
|
||||
|
||||
#### options.strip
|
||||
#### buf
|
||||
|
||||
Type: `number`
|
||||
Default: `0`
|
||||
Type: `Buffer`
|
||||
|
||||
Remove leading directory components from extracted files.
|
||||
Buffer to decompress.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
Reference in New Issue
Block a user