Galerie und tage
This commit is contained in:
247
node_modules/decompress/index.js
generated
vendored
247
node_modules/decompress/index.js
generated
vendored
@@ -1,151 +1,130 @@
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const fs = require('graceful-fs');
|
||||
const decompressTar = require('decompress-tar');
|
||||
const decompressTarbz2 = require('decompress-tarbz2');
|
||||
const decompressTargz = require('decompress-targz');
|
||||
const decompressUnzip = require('decompress-unzip');
|
||||
const makeDir = require('make-dir');
|
||||
const pify = require('pify');
|
||||
const stripDirs = require('strip-dirs');
|
||||
var bufferToVinyl = require('buffer-to-vinyl');
|
||||
var concatStream = require('concat-stream');
|
||||
var streamCombiner = require('stream-combiner2');
|
||||
var vinylFs = require('vinyl-fs');
|
||||
var vinylAssign = require('vinyl-assign');
|
||||
|
||||
const fsP = pify(fs);
|
||||
/**
|
||||
* Initialize Decompress
|
||||
*
|
||||
* @param {Object} opts
|
||||
* @api public
|
||||
*/
|
||||
|
||||
const runPlugins = (input, opts) => {
|
||||
if (opts.plugins.length === 0) {
|
||||
return Promise.resolve([]);
|
||||
function Decompress(opts) {
|
||||
if (!(this instanceof Decompress)) {
|
||||
return new Decompress(opts);
|
||||
}
|
||||
|
||||
return Promise.all(opts.plugins.map(x => x(input, opts))).then(files => files.reduce((a, b) => a.concat(b)));
|
||||
this.opts = opts || {};
|
||||
this.streams = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get or set the source files
|
||||
*
|
||||
* @param {Array|Buffer|String} file
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Decompress.prototype.src = function (file) {
|
||||
if (!arguments.length) {
|
||||
return this._src;
|
||||
}
|
||||
|
||||
this._src = file;
|
||||
return this;
|
||||
};
|
||||
|
||||
const safeMakeDir = (dir, realOutputPath) => {
|
||||
return fsP.realpath(dir)
|
||||
.catch(_ => {
|
||||
const parent = path.dirname(dir);
|
||||
return safeMakeDir(parent, realOutputPath);
|
||||
})
|
||||
.then(realParentPath => {
|
||||
if (realParentPath.indexOf(realOutputPath) !== 0) {
|
||||
throw (new Error('Refusing to create a directory outside the output path.'));
|
||||
}
|
||||
/**
|
||||
* Get or set the destination folder
|
||||
*
|
||||
* @param {String} dir
|
||||
* @api public
|
||||
*/
|
||||
|
||||
return makeDir(dir).then(fsP.realpath);
|
||||
});
|
||||
Decompress.prototype.dest = function (dir) {
|
||||
if (!arguments.length) {
|
||||
return this._dest;
|
||||
}
|
||||
|
||||
this._dest = dir;
|
||||
return this;
|
||||
};
|
||||
|
||||
const preventWritingThroughSymlink = (destination, realOutputPath) => {
|
||||
return fsP.readlink(destination)
|
||||
.catch(_ => {
|
||||
// Either no file exists, or it's not a symlink. In either case, this is
|
||||
// not an escape we need to worry about in this phase.
|
||||
return null;
|
||||
})
|
||||
.then(symlinkPointsTo => {
|
||||
if (symlinkPointsTo) {
|
||||
throw new Error('Refusing to write into a symlink');
|
||||
}
|
||||
/**
|
||||
* Add a plugin to the middleware stack
|
||||
*
|
||||
* @param {Function} plugin
|
||||
* @api public
|
||||
*/
|
||||
|
||||
// No symlink exists at `destination`, so we can continue
|
||||
return realOutputPath;
|
||||
});
|
||||
Decompress.prototype.use = function (plugin) {
|
||||
this.streams.push(plugin);
|
||||
return this;
|
||||
};
|
||||
|
||||
const extractFile = (input, output, opts) => runPlugins(input, opts).then(files => {
|
||||
if (opts.strip > 0) {
|
||||
files = files
|
||||
.map(x => {
|
||||
x.path = stripDirs(x.path, opts.strip);
|
||||
return x;
|
||||
})
|
||||
.filter(x => x.path !== '.');
|
||||
}
|
||||
/**
|
||||
* Decompress archive
|
||||
*
|
||||
* @param {Function} cb
|
||||
* @api public
|
||||
*/
|
||||
|
||||
if (typeof opts.filter === 'function') {
|
||||
files = files.filter(opts.filter);
|
||||
}
|
||||
Decompress.prototype.run = function (cb) {
|
||||
cb = cb || function () {};
|
||||
|
||||
if (typeof opts.map === 'function') {
|
||||
files = files.map(opts.map);
|
||||
}
|
||||
var stream = this.createStream();
|
||||
|
||||
if (!output) {
|
||||
return files;
|
||||
}
|
||||
|
||||
return Promise.all(files.map(x => {
|
||||
const dest = path.join(output, x.path);
|
||||
const mode = x.mode & ~process.umask();
|
||||
const now = new Date();
|
||||
|
||||
if (x.type === 'directory') {
|
||||
return makeDir(output)
|
||||
.then(outputPath => fsP.realpath(outputPath))
|
||||
.then(realOutputPath => safeMakeDir(dest, realOutputPath))
|
||||
.then(() => fsP.utimes(dest, now, x.mtime))
|
||||
.then(() => x);
|
||||
}
|
||||
|
||||
return makeDir(output)
|
||||
.then(outputPath => fsP.realpath(outputPath))
|
||||
.then(realOutputPath => {
|
||||
// Attempt to ensure parent directory exists (failing if it's outside the output dir)
|
||||
return safeMakeDir(path.dirname(dest), realOutputPath)
|
||||
.then(() => realOutputPath);
|
||||
})
|
||||
.then(realOutputPath => {
|
||||
if (x.type === 'file') {
|
||||
return preventWritingThroughSymlink(dest, realOutputPath);
|
||||
}
|
||||
|
||||
return realOutputPath;
|
||||
})
|
||||
.then(realOutputPath => {
|
||||
return fsP.realpath(path.dirname(dest))
|
||||
.then(realDestinationDir => {
|
||||
if (realDestinationDir.indexOf(realOutputPath) !== 0) {
|
||||
throw (new Error('Refusing to write outside output directory: ' + realDestinationDir));
|
||||
}
|
||||
});
|
||||
})
|
||||
.then(() => {
|
||||
if (x.type === 'link') {
|
||||
return fsP.link(x.linkname, dest);
|
||||
}
|
||||
|
||||
if (x.type === 'symlink' && process.platform === 'win32') {
|
||||
return fsP.link(x.linkname, dest);
|
||||
}
|
||||
|
||||
if (x.type === 'symlink') {
|
||||
return fsP.symlink(x.linkname, dest);
|
||||
}
|
||||
|
||||
return fsP.writeFile(dest, x.data, {mode});
|
||||
})
|
||||
.then(() => x.type === 'file' && fsP.utimes(dest, now, x.mtime))
|
||||
.then(() => x);
|
||||
}));
|
||||
});
|
||||
|
||||
module.exports = (input, output, opts) => {
|
||||
if (typeof input !== 'string' && !Buffer.isBuffer(input)) {
|
||||
return Promise.reject(new TypeError('Input file required'));
|
||||
}
|
||||
|
||||
if (typeof output === 'object') {
|
||||
opts = output;
|
||||
output = null;
|
||||
}
|
||||
|
||||
opts = Object.assign({plugins: [
|
||||
decompressTar(),
|
||||
decompressTarbz2(),
|
||||
decompressTargz(),
|
||||
decompressUnzip()
|
||||
]}, opts);
|
||||
|
||||
const read = typeof input === 'string' ? fsP.readFile(input) : Promise.resolve(input);
|
||||
|
||||
return read.then(buf => extractFile(buf, output, opts));
|
||||
stream.on('error', cb);
|
||||
stream.pipe(concatStream(cb.bind(null, null)));
|
||||
};
|
||||
|
||||
/**
|
||||
* Create stream
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Decompress.prototype.createStream = function () {
|
||||
this.streams.unshift(vinylAssign({extract: true}));
|
||||
this.streams.unshift(this.getFiles());
|
||||
|
||||
if (this.streams.length === 2) {
|
||||
this.use(Decompress.tar(this.opts));
|
||||
this.use(Decompress.tarbz2(this.opts));
|
||||
this.use(Decompress.targz(this.opts));
|
||||
this.use(Decompress.zip(this.opts));
|
||||
}
|
||||
|
||||
if (this.dest()) {
|
||||
this.streams.push(vinylFs.dest(this.dest()));
|
||||
}
|
||||
|
||||
return streamCombiner.obj(this.streams);
|
||||
};
|
||||
|
||||
/**
|
||||
* Get files
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Decompress.prototype.getFiles = function () {
|
||||
if (Buffer.isBuffer(this.src())) {
|
||||
return bufferToVinyl.stream(this.src());
|
||||
}
|
||||
|
||||
return vinylFs.src(this.src());
|
||||
};
|
||||
|
||||
/**
|
||||
* Module exports
|
||||
*/
|
||||
|
||||
module.exports = Decompress;
|
||||
module.exports.tar = require('decompress-tar');
|
||||
module.exports.tarbz2 = require('decompress-tarbz2');
|
||||
module.exports.targz = require('decompress-targz');
|
||||
module.exports.zip = require('decompress-unzip');
|
||||
|
||||
22
node_modules/decompress/license
generated
vendored
22
node_modules/decompress/license
generated
vendored
@@ -1,9 +1,21 @@
|
||||
MIT License
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Kevin Mårtensson <kevinmartensson@gmail.com> (github.com/kevva)
|
||||
Copyright (c) Kevin Mårtensson <kevinmartensson@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
2
node_modules/decompress/node_modules/pify/license → node_modules/decompress/node_modules/arr-diff/LICENSE
generated
vendored
Normal file → Executable file
2
node_modules/decompress/node_modules/pify/license → node_modules/decompress/node_modules/arr-diff/LICENSE
generated
vendored
Normal file → Executable file
@@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
Copyright (c) 2014-2015, Jon Schlinkert.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
74
node_modules/decompress/node_modules/arr-diff/README.md
generated
vendored
Normal file
74
node_modules/decompress/node_modules/arr-diff/README.md
generated
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
# arr-diff [](https://www.npmjs.com/package/arr-diff) [](https://travis-ci.org/jonschlinkert/base)
|
||||
|
||||
> Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/)
|
||||
|
||||
```sh
|
||||
$ npm i arr-diff --save
|
||||
```
|
||||
Install with [bower](http://bower.io/)
|
||||
|
||||
```sh
|
||||
$ bower install arr-diff --save
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### [diff](index.js#L33)
|
||||
|
||||
Return the difference between the first array and additional arrays.
|
||||
|
||||
**Params**
|
||||
|
||||
* `a` **{Array}**
|
||||
* `b` **{Array}**
|
||||
* `returns` **{Array}**
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
var diff = require('arr-diff');
|
||||
|
||||
var a = ['a', 'b', 'c', 'd'];
|
||||
var b = ['b', 'c'];
|
||||
|
||||
console.log(diff(a, b))
|
||||
//=> ['a', 'd']
|
||||
```
|
||||
|
||||
## Related projects
|
||||
|
||||
* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten)
|
||||
* [array-filter](https://www.npmjs.com/package/array-filter): Array#filter for older browsers. | [homepage](https://github.com/juliangruber/array-filter)
|
||||
* [array-intersection](https://www.npmjs.com/package/array-intersection): Return an array with the unique values present in _all_ given arrays using strict equality… [more](https://www.npmjs.com/package/array-intersection) | [homepage](https://github.com/jonschlinkert/array-intersection)
|
||||
|
||||
## Running tests
|
||||
|
||||
Install dev dependencies:
|
||||
|
||||
```sh
|
||||
$ npm i -d && npm test
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/arr-diff/issues/new).
|
||||
|
||||
## Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
+ [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
|
||||
|
||||
## License
|
||||
|
||||
Copyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert)
|
||||
Released under the MIT license.
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb](https://github.com/verbose/verb) on Sat Dec 05 2015 23:24:53 GMT-0500 (EST)._
|
||||
58
node_modules/decompress/node_modules/arr-diff/index.js
generated
vendored
Normal file
58
node_modules/decompress/node_modules/arr-diff/index.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
/*!
|
||||
* arr-diff <https://github.com/jonschlinkert/arr-diff>
|
||||
*
|
||||
* Copyright (c) 2014 Jon Schlinkert, contributors.
|
||||
* Licensed under the MIT License
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var flatten = require('arr-flatten');
|
||||
var slice = [].slice;
|
||||
|
||||
/**
|
||||
* Return the difference between the first array and
|
||||
* additional arrays.
|
||||
*
|
||||
* ```js
|
||||
* var diff = require('{%= name %}');
|
||||
*
|
||||
* var a = ['a', 'b', 'c', 'd'];
|
||||
* var b = ['b', 'c'];
|
||||
*
|
||||
* console.log(diff(a, b))
|
||||
* //=> ['a', 'd']
|
||||
* ```
|
||||
*
|
||||
* @param {Array} `a`
|
||||
* @param {Array} `b`
|
||||
* @return {Array}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function diff(arr, arrays) {
|
||||
var argsLen = arguments.length;
|
||||
var len = arr.length, i = -1;
|
||||
var res = [], arrays;
|
||||
|
||||
if (argsLen === 1) {
|
||||
return arr;
|
||||
}
|
||||
|
||||
if (argsLen > 2) {
|
||||
arrays = flatten(slice.call(arguments, 1));
|
||||
}
|
||||
|
||||
while (++i < len) {
|
||||
if (!~arrays.indexOf(arr[i])) {
|
||||
res.push(arr[i]);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expose `diff`
|
||||
*/
|
||||
|
||||
module.exports = diff;
|
||||
49
node_modules/decompress/node_modules/arr-diff/package.json
generated
vendored
Normal file
49
node_modules/decompress/node_modules/arr-diff/package.json
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"name": "arr-diff",
|
||||
"description": "Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.",
|
||||
"version": "2.0.0",
|
||||
"homepage": "https://github.com/jonschlinkert/arr-diff",
|
||||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
||||
"repository": "jonschlinkert/arr-diff",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/arr-diff/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"main": "index.js",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"dependencies": {
|
||||
"arr-flatten": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"array-differ": "^1.0.0",
|
||||
"array-slice": "^0.2.3",
|
||||
"benchmarked": "^0.1.4",
|
||||
"chalk": "^1.1.1",
|
||||
"mocha": "*",
|
||||
"should": "*"
|
||||
},
|
||||
"keywords": [
|
||||
"arr",
|
||||
"array",
|
||||
"diff",
|
||||
"differ",
|
||||
"difference"
|
||||
],
|
||||
"verb": {
|
||||
"related": {
|
||||
"list": [
|
||||
"arr-flatten",
|
||||
"array-filter",
|
||||
"array-intersection"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
21
node_modules/decompress/node_modules/array-unique/LICENSE
generated
vendored
Executable file
21
node_modules/decompress/node_modules/array-unique/LICENSE
generated
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2015, Jon Schlinkert.
|
||||
|
||||
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.
|
||||
51
node_modules/decompress/node_modules/array-unique/README.md
generated
vendored
Executable file
51
node_modules/decompress/node_modules/array-unique/README.md
generated
vendored
Executable file
@@ -0,0 +1,51 @@
|
||||
# array-unique [](http://badge.fury.io/js/array-unique) [](https://travis-ci.org/jonschlinkert/array-unique)
|
||||
|
||||
> Return an array free of duplicate values. Fastest ES5 implementation.
|
||||
|
||||
## Install with [npm](npmjs.org)
|
||||
|
||||
```bash
|
||||
npm i array-unique --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var unique = require('array-unique');
|
||||
|
||||
unique(['a', 'b', 'c', 'c']);
|
||||
//=> ['a', 'b', 'c']
|
||||
```
|
||||
|
||||
## Related
|
||||
* [arr-diff](https://github.com/jonschlinkert/arr-diff): Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.
|
||||
* [arr-union](https://github.com/jonschlinkert/arr-union): Returns an array of unique values using strict equality for comparisons.
|
||||
* [arr-flatten](https://github.com/jonschlinkert/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten.
|
||||
* [arr-reduce](https://github.com/jonschlinkert/arr-reduce): Fast array reduce that also loops over sparse elements.
|
||||
* [arr-map](https://github.com/jonschlinkert/arr-map): Faster, node.js focused alternative to JavaScript's native array map.
|
||||
* [arr-pluck](https://github.com/jonschlinkert/arr-pluck): Retrieves the value of a specified property from all elements in the collection.
|
||||
|
||||
## Run tests
|
||||
Install dev dependencies.
|
||||
|
||||
```bash
|
||||
npm i -d && npm test
|
||||
```
|
||||
|
||||
## Contributing
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/array-unique/issues)
|
||||
|
||||
## Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
+ [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
|
||||
|
||||
## License
|
||||
Copyright (c) 2015 Jon Schlinkert
|
||||
Released under the MIT license
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 24, 2015._
|
||||
28
node_modules/decompress/node_modules/array-unique/index.js
generated
vendored
Executable file
28
node_modules/decompress/node_modules/array-unique/index.js
generated
vendored
Executable file
@@ -0,0 +1,28 @@
|
||||
/*!
|
||||
* array-unique <https://github.com/jonschlinkert/array-unique>
|
||||
*
|
||||
* Copyright (c) 2014-2015, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = function unique(arr) {
|
||||
if (!Array.isArray(arr)) {
|
||||
throw new TypeError('array-unique expects an array.');
|
||||
}
|
||||
|
||||
var len = arr.length;
|
||||
var i = -1;
|
||||
|
||||
while (i++ < len) {
|
||||
var j = i + 1;
|
||||
|
||||
for (; j < arr.length; ++j) {
|
||||
if (arr[i] === arr[j]) {
|
||||
arr.splice(j--, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
};
|
||||
37
node_modules/decompress/node_modules/array-unique/package.json
generated
vendored
Executable file
37
node_modules/decompress/node_modules/array-unique/package.json
generated
vendored
Executable file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "array-unique",
|
||||
"description": "Return an array free of duplicate values. Fastest ES5 implementation.",
|
||||
"version": "0.2.1",
|
||||
"homepage": "https://github.com/jonschlinkert/array-unique",
|
||||
"author": {
|
||||
"name": "Jon Schlinkert",
|
||||
"url": "https://github.com/jonschlinkert"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/jonschlinkert/array-unique.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/array-unique/issues"
|
||||
},
|
||||
"license": {
|
||||
"type": "MIT",
|
||||
"url": "https://github.com/jonschlinkert/array-unique/blob/master/LICENSE"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"main": "index.js",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"devDependencies": {
|
||||
"array-uniq": "^1.0.2",
|
||||
"benchmarked": "^0.1.3",
|
||||
"mocha": "*",
|
||||
"should": "*"
|
||||
}
|
||||
}
|
||||
21
node_modules/decompress/node_modules/braces/LICENSE
generated
vendored
Normal file
21
node_modules/decompress/node_modules/braces/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2016, Jon Schlinkert.
|
||||
|
||||
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.
|
||||
248
node_modules/decompress/node_modules/braces/README.md
generated
vendored
Normal file
248
node_modules/decompress/node_modules/braces/README.md
generated
vendored
Normal file
@@ -0,0 +1,248 @@
|
||||
# braces [](https://www.npmjs.com/package/braces) [](https://npmjs.org/package/braces) [](https://travis-ci.org/jonschlinkert/braces)
|
||||
|
||||
Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces specification.
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/):
|
||||
|
||||
```sh
|
||||
$ npm install braces --save
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
* Complete support for the braces part of the [Bash 4.3 Brace Expansion](www.gnu.org/software/bash/). Braces passes [all of the relevant unit tests](#bash-4-3-support) from the spec.
|
||||
* Expands comma-separated values: `a/{b,c}/d` => `['a/b/d', 'a/c/d']`
|
||||
* Expands alphabetical or numerical ranges: `{1..3}` => `['1', '2', '3']`
|
||||
* [Very fast](#benchmarks)
|
||||
* [Special characters](./patterns.md) can be used to generate interesting patterns.
|
||||
|
||||
## Example usage
|
||||
|
||||
```js
|
||||
var braces = require('braces');
|
||||
|
||||
braces('a/{x,y}/c{d}e')
|
||||
//=> ['a/x/cde', 'a/y/cde']
|
||||
|
||||
braces('a/b/c/{x,y}')
|
||||
//=> ['a/b/c/x', 'a/b/c/y']
|
||||
|
||||
braces('a/{x,{1..5},y}/c{d}e')
|
||||
//=> ['a/x/cde', 'a/1/cde', 'a/y/cde', 'a/2/cde', 'a/3/cde', 'a/4/cde', 'a/5/cde']
|
||||
```
|
||||
|
||||
### Use case: fixtures
|
||||
|
||||
> Use braces to generate test fixtures!
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
var braces = require('./');
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
|
||||
braces('blah/{a..z}.js').forEach(function(fp) {
|
||||
if (!fs.existsSync(path.dirname(fp))) {
|
||||
fs.mkdirSync(path.dirname(fp));
|
||||
}
|
||||
fs.writeFileSync(fp, '');
|
||||
});
|
||||
```
|
||||
|
||||
See the [tests](./test/test.js) for more examples and use cases (also see the [bash spec tests](./test/bash-mm-adjusted.js));
|
||||
|
||||
### Range expansion
|
||||
|
||||
Uses [expand-range](https://github.com/jonschlinkert/expand-range) for range expansion.
|
||||
|
||||
```js
|
||||
braces('a{1..3}b')
|
||||
//=> ['a1b', 'a2b', 'a3b']
|
||||
|
||||
braces('a{5..8}b')
|
||||
//=> ['a5b', 'a6b', 'a7b', 'a8b']
|
||||
|
||||
braces('a{00..05}b')
|
||||
//=> ['a00b', 'a01b', 'a02b', 'a03b', 'a04b', 'a05b']
|
||||
|
||||
braces('a{01..03}b')
|
||||
//=> ['a01b', 'a02b', 'a03b']
|
||||
|
||||
braces('a{000..005}b')
|
||||
//=> ['a000b', 'a001b', 'a002b', 'a003b', 'a004b', 'a005b']
|
||||
|
||||
braces('a{a..e}b')
|
||||
//=> ['aab', 'abb', 'acb', 'adb', 'aeb']
|
||||
|
||||
braces('a{A..E}b')
|
||||
//=> ['aAb', 'aBb', 'aCb', 'aDb', 'aEb']
|
||||
```
|
||||
|
||||
Pass a function as the last argument to customize range expansions:
|
||||
|
||||
```js
|
||||
var range = braces('x{a..e}y', function (str, i) {
|
||||
return String.fromCharCode(str) + i;
|
||||
});
|
||||
|
||||
console.log(range);
|
||||
//=> ['xa0y', 'xb1y', 'xc2y', 'xd3y', 'xe4y']
|
||||
```
|
||||
|
||||
See [expand-range](https://github.com/jonschlinkert/expand-range) for benchmarks, tests and the full list of range expansion features.
|
||||
|
||||
## Options
|
||||
|
||||
### options.makeRe
|
||||
|
||||
Type: `Boolean`
|
||||
|
||||
Deafault: `false`
|
||||
|
||||
Return a regex-optimal string. If you're using braces to generate regex, this will result in dramatically faster performance.
|
||||
|
||||
**Examples**
|
||||
|
||||
With the default settings (`{makeRe: false}`):
|
||||
|
||||
```js
|
||||
braces('{1..5}');
|
||||
//=> ['1', '2', '3', '4', '5']
|
||||
```
|
||||
|
||||
With `{makeRe: true}`:
|
||||
|
||||
```js
|
||||
braces('{1..5}', {makeRe: true});
|
||||
//=> ['[1-5]']
|
||||
|
||||
braces('{3..9..3}', {makeRe: true});
|
||||
//=> ['(3|6|9)']
|
||||
```
|
||||
|
||||
### options.bash
|
||||
|
||||
Type: `Boolean`
|
||||
|
||||
Default: `false`
|
||||
|
||||
Enables complete support for the Bash specification. The downside is a 20-25% speed decrease.
|
||||
|
||||
**Example**
|
||||
|
||||
Using the default setting (`{bash: false}`):
|
||||
|
||||
```js
|
||||
braces('a{b}c');
|
||||
//=> ['abc']
|
||||
```
|
||||
|
||||
In bash (and minimatch), braces with one item are not expanded. To get the same result with braces, set `{bash: true}`:
|
||||
|
||||
```js
|
||||
braces('a{b}c', {bash: true});
|
||||
//=> ['a{b}c']
|
||||
```
|
||||
|
||||
### options.nodupes
|
||||
|
||||
Type: `Boolean`
|
||||
|
||||
Deafault: `true`
|
||||
|
||||
Duplicates are removed by default. To keep duplicates, pass `{nodupes: false}` on the options
|
||||
|
||||
## Bash 4.3 Support
|
||||
|
||||
> Better support for Bash 4.3 than minimatch
|
||||
|
||||
This project has comprehensive unit tests, including tests coverted from [Bash 4.3](www.gnu.org/software/bash/). Currently only 8 of 102 unit tests fail, and
|
||||
|
||||
## Run benchmarks
|
||||
|
||||
Install dev dependencies:
|
||||
|
||||
```bash
|
||||
npm i -d && npm benchmark
|
||||
```
|
||||
|
||||
### Latest results
|
||||
|
||||
```bash
|
||||
#1: escape.js
|
||||
brace-expansion.js x 114,934 ops/sec ±1.24% (93 runs sampled)
|
||||
braces.js x 342,254 ops/sec ±0.84% (90 runs sampled)
|
||||
|
||||
#2: exponent.js
|
||||
brace-expansion.js x 12,359 ops/sec ±0.86% (96 runs sampled)
|
||||
braces.js x 20,389 ops/sec ±0.71% (97 runs sampled)
|
||||
|
||||
#3: multiple.js
|
||||
brace-expansion.js x 114,469 ops/sec ±1.44% (94 runs sampled)
|
||||
braces.js x 401,621 ops/sec ±0.87% (91 runs sampled)
|
||||
|
||||
#4: nested.js
|
||||
brace-expansion.js x 102,769 ops/sec ±1.55% (92 runs sampled)
|
||||
braces.js x 314,088 ops/sec ±0.71% (98 runs sampled)
|
||||
|
||||
#5: normal.js
|
||||
brace-expansion.js x 157,577 ops/sec ±1.65% (91 runs sampled)
|
||||
braces.js x 1,115,950 ops/sec ±0.74% (94 runs sampled)
|
||||
|
||||
#6: range.js
|
||||
brace-expansion.js x 138,822 ops/sec ±1.71% (91 runs sampled)
|
||||
braces.js x 1,108,353 ops/sec ±0.85% (94 runs sampled)
|
||||
```
|
||||
|
||||
## Related projects
|
||||
|
||||
You might also be interested in these projects:
|
||||
|
||||
* [expand-range](https://www.npmjs.com/package/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See… [more](https://www.npmjs.com/package/expand-range) | [homepage](https://github.com/jonschlinkert/expand-range)
|
||||
* [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or multiplier to… [more](https://www.npmjs.com/package/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range)
|
||||
* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch)
|
||||
|
||||
## Contributing
|
||||
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/braces/issues/new).
|
||||
|
||||
## Building docs
|
||||
|
||||
Generate readme and API documentation with [verb](https://github.com/verbose/verb):
|
||||
|
||||
```sh
|
||||
$ npm install verb && npm run docs
|
||||
```
|
||||
|
||||
Or, if [verb](https://github.com/verbose/verb) is installed globally:
|
||||
|
||||
```sh
|
||||
$ verb
|
||||
```
|
||||
|
||||
## Running tests
|
||||
|
||||
Install dev dependencies:
|
||||
|
||||
```sh
|
||||
$ npm install -d && npm test
|
||||
```
|
||||
|
||||
## Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
* [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
|
||||
|
||||
## License
|
||||
|
||||
Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
|
||||
Released under the [MIT license](https://github.com/jonschlinkert/braces/blob/master/LICENSE).
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on May 21, 2016._
|
||||
399
node_modules/decompress/node_modules/braces/index.js
generated
vendored
Normal file
399
node_modules/decompress/node_modules/braces/index.js
generated
vendored
Normal file
@@ -0,0 +1,399 @@
|
||||
/*!
|
||||
* braces <https://github.com/jonschlinkert/braces>
|
||||
*
|
||||
* Copyright (c) 2014-2015, Jon Schlinkert.
|
||||
* Licensed under the MIT license.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Module dependencies
|
||||
*/
|
||||
|
||||
var expand = require('expand-range');
|
||||
var repeat = require('repeat-element');
|
||||
var tokens = require('preserve');
|
||||
|
||||
/**
|
||||
* Expose `braces`
|
||||
*/
|
||||
|
||||
module.exports = function(str, options) {
|
||||
if (typeof str !== 'string') {
|
||||
throw new Error('braces expects a string');
|
||||
}
|
||||
return braces(str, options);
|
||||
};
|
||||
|
||||
/**
|
||||
* Expand `{foo,bar}` or `{1..5}` braces in the
|
||||
* given `string`.
|
||||
*
|
||||
* @param {String} `str`
|
||||
* @param {Array} `arr`
|
||||
* @param {Object} `options`
|
||||
* @return {Array}
|
||||
*/
|
||||
|
||||
function braces(str, arr, options) {
|
||||
if (str === '') {
|
||||
return [];
|
||||
}
|
||||
|
||||
if (!Array.isArray(arr)) {
|
||||
options = arr;
|
||||
arr = [];
|
||||
}
|
||||
|
||||
var opts = options || {};
|
||||
arr = arr || [];
|
||||
|
||||
if (typeof opts.nodupes === 'undefined') {
|
||||
opts.nodupes = true;
|
||||
}
|
||||
|
||||
var fn = opts.fn;
|
||||
var es6;
|
||||
|
||||
if (typeof opts === 'function') {
|
||||
fn = opts;
|
||||
opts = {};
|
||||
}
|
||||
|
||||
if (!(patternRe instanceof RegExp)) {
|
||||
patternRe = patternRegex();
|
||||
}
|
||||
|
||||
var matches = str.match(patternRe) || [];
|
||||
var m = matches[0];
|
||||
|
||||
switch(m) {
|
||||
case '\\,':
|
||||
return escapeCommas(str, arr, opts);
|
||||
case '\\.':
|
||||
return escapeDots(str, arr, opts);
|
||||
case '\/.':
|
||||
return escapePaths(str, arr, opts);
|
||||
case ' ':
|
||||
return splitWhitespace(str);
|
||||
case '{,}':
|
||||
return exponential(str, opts, braces);
|
||||
case '{}':
|
||||
return emptyBraces(str, arr, opts);
|
||||
case '\\{':
|
||||
case '\\}':
|
||||
return escapeBraces(str, arr, opts);
|
||||
case '${':
|
||||
if (!/\{[^{]+\{/.test(str)) {
|
||||
return arr.concat(str);
|
||||
} else {
|
||||
es6 = true;
|
||||
str = tokens.before(str, es6Regex());
|
||||
}
|
||||
}
|
||||
|
||||
if (!(braceRe instanceof RegExp)) {
|
||||
braceRe = braceRegex();
|
||||
}
|
||||
|
||||
var match = braceRe.exec(str);
|
||||
if (match == null) {
|
||||
return [str];
|
||||
}
|
||||
|
||||
var outter = match[1];
|
||||
var inner = match[2];
|
||||
if (inner === '') { return [str]; }
|
||||
|
||||
var segs, segsLength;
|
||||
|
||||
if (inner.indexOf('..') !== -1) {
|
||||
segs = expand(inner, opts, fn) || inner.split(',');
|
||||
segsLength = segs.length;
|
||||
|
||||
} else if (inner[0] === '"' || inner[0] === '\'') {
|
||||
return arr.concat(str.split(/['"]/).join(''));
|
||||
|
||||
} else {
|
||||
segs = inner.split(',');
|
||||
if (opts.makeRe) {
|
||||
return braces(str.replace(outter, wrap(segs, '|')), opts);
|
||||
}
|
||||
|
||||
segsLength = segs.length;
|
||||
if (segsLength === 1 && opts.bash) {
|
||||
segs[0] = wrap(segs[0], '\\');
|
||||
}
|
||||
}
|
||||
|
||||
var len = segs.length;
|
||||
var i = 0, val;
|
||||
|
||||
while (len--) {
|
||||
var path = segs[i++];
|
||||
|
||||
if (/(\.[^.\/])/.test(path)) {
|
||||
if (segsLength > 1) {
|
||||
return segs;
|
||||
} else {
|
||||
return [str];
|
||||
}
|
||||
}
|
||||
|
||||
val = splice(str, outter, path);
|
||||
|
||||
if (/\{[^{}]+?\}/.test(val)) {
|
||||
arr = braces(val, arr, opts);
|
||||
} else if (val !== '') {
|
||||
if (opts.nodupes && arr.indexOf(val) !== -1) { continue; }
|
||||
arr.push(es6 ? tokens.after(val) : val);
|
||||
}
|
||||
}
|
||||
|
||||
if (opts.strict) { return filter(arr, filterEmpty); }
|
||||
return arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expand exponential ranges
|
||||
*
|
||||
* `a{,}{,}` => ['a', 'a', 'a', 'a']
|
||||
*/
|
||||
|
||||
function exponential(str, options, fn) {
|
||||
if (typeof options === 'function') {
|
||||
fn = options;
|
||||
options = null;
|
||||
}
|
||||
|
||||
var opts = options || {};
|
||||
var esc = '__ESC_EXP__';
|
||||
var exp = 0;
|
||||
var res;
|
||||
|
||||
var parts = str.split('{,}');
|
||||
if (opts.nodupes) {
|
||||
return fn(parts.join(''), opts);
|
||||
}
|
||||
|
||||
exp = parts.length - 1;
|
||||
res = fn(parts.join(esc), opts);
|
||||
var len = res.length;
|
||||
var arr = [];
|
||||
var i = 0;
|
||||
|
||||
while (len--) {
|
||||
var ele = res[i++];
|
||||
var idx = ele.indexOf(esc);
|
||||
|
||||
if (idx === -1) {
|
||||
arr.push(ele);
|
||||
|
||||
} else {
|
||||
ele = ele.split('__ESC_EXP__').join('');
|
||||
if (!!ele && opts.nodupes !== false) {
|
||||
arr.push(ele);
|
||||
|
||||
} else {
|
||||
var num = Math.pow(2, exp);
|
||||
arr.push.apply(arr, repeat(ele, num));
|
||||
}
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap a value with parens, brackets or braces,
|
||||
* based on the given character/separator.
|
||||
*
|
||||
* @param {String|Array} `val`
|
||||
* @param {String} `ch`
|
||||
* @return {String}
|
||||
*/
|
||||
|
||||
function wrap(val, ch) {
|
||||
if (ch === '|') {
|
||||
return '(' + val.join(ch) + ')';
|
||||
}
|
||||
if (ch === ',') {
|
||||
return '{' + val.join(ch) + '}';
|
||||
}
|
||||
if (ch === '-') {
|
||||
return '[' + val.join(ch) + ']';
|
||||
}
|
||||
if (ch === '\\') {
|
||||
return '\\{' + val + '\\}';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle empty braces: `{}`
|
||||
*/
|
||||
|
||||
function emptyBraces(str, arr, opts) {
|
||||
return braces(str.split('{}').join('\\{\\}'), arr, opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter out empty-ish values
|
||||
*/
|
||||
|
||||
function filterEmpty(ele) {
|
||||
return !!ele && ele !== '\\';
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle patterns with whitespace
|
||||
*/
|
||||
|
||||
function splitWhitespace(str) {
|
||||
var segs = str.split(' ');
|
||||
var len = segs.length;
|
||||
var res = [];
|
||||
var i = 0;
|
||||
|
||||
while (len--) {
|
||||
res.push.apply(res, braces(segs[i++]));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle escaped braces: `\\{foo,bar}`
|
||||
*/
|
||||
|
||||
function escapeBraces(str, arr, opts) {
|
||||
if (!/\{[^{]+\{/.test(str)) {
|
||||
return arr.concat(str.split('\\').join(''));
|
||||
} else {
|
||||
str = str.split('\\{').join('__LT_BRACE__');
|
||||
str = str.split('\\}').join('__RT_BRACE__');
|
||||
return map(braces(str, arr, opts), function(ele) {
|
||||
ele = ele.split('__LT_BRACE__').join('{');
|
||||
return ele.split('__RT_BRACE__').join('}');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle escaped dots: `{1\\.2}`
|
||||
*/
|
||||
|
||||
function escapeDots(str, arr, opts) {
|
||||
if (!/[^\\]\..+\\\./.test(str)) {
|
||||
return arr.concat(str.split('\\').join(''));
|
||||
} else {
|
||||
str = str.split('\\.').join('__ESC_DOT__');
|
||||
return map(braces(str, arr, opts), function(ele) {
|
||||
return ele.split('__ESC_DOT__').join('.');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle escaped dots: `{1\\.2}`
|
||||
*/
|
||||
|
||||
function escapePaths(str, arr, opts) {
|
||||
str = str.split('\/.').join('__ESC_PATH__');
|
||||
return map(braces(str, arr, opts), function(ele) {
|
||||
return ele.split('__ESC_PATH__').join('\/.');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle escaped commas: `{a\\,b}`
|
||||
*/
|
||||
|
||||
function escapeCommas(str, arr, opts) {
|
||||
if (!/\w,/.test(str)) {
|
||||
return arr.concat(str.split('\\').join(''));
|
||||
} else {
|
||||
str = str.split('\\,').join('__ESC_COMMA__');
|
||||
return map(braces(str, arr, opts), function(ele) {
|
||||
return ele.split('__ESC_COMMA__').join(',');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Regex for common patterns
|
||||
*/
|
||||
|
||||
function patternRegex() {
|
||||
return /\${|( (?=[{,}])|(?=[{,}]) )|{}|{,}|\\,(?=.*[{}])|\/\.(?=.*[{}])|\\\.(?={)|\\{|\\}/;
|
||||
}
|
||||
|
||||
/**
|
||||
* Braces regex.
|
||||
*/
|
||||
|
||||
function braceRegex() {
|
||||
return /.*(\\?\{([^}]+)\})/;
|
||||
}
|
||||
|
||||
/**
|
||||
* es6 delimiter regex.
|
||||
*/
|
||||
|
||||
function es6Regex() {
|
||||
return /\$\{([^}]+)\}/;
|
||||
}
|
||||
|
||||
var braceRe;
|
||||
var patternRe;
|
||||
|
||||
/**
|
||||
* Faster alternative to `String.replace()` when the
|
||||
* index of the token to be replaces can't be supplied
|
||||
*/
|
||||
|
||||
function splice(str, token, replacement) {
|
||||
var i = str.indexOf(token);
|
||||
return str.substr(0, i) + replacement
|
||||
+ str.substr(i + token.length);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fast array map
|
||||
*/
|
||||
|
||||
function map(arr, fn) {
|
||||
if (arr == null) {
|
||||
return [];
|
||||
}
|
||||
|
||||
var len = arr.length;
|
||||
var res = new Array(len);
|
||||
var i = -1;
|
||||
|
||||
while (++i < len) {
|
||||
res[i] = fn(arr[i], i, arr);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fast array filter
|
||||
*/
|
||||
|
||||
function filter(arr, cb) {
|
||||
if (arr == null) return [];
|
||||
if (typeof cb !== 'function') {
|
||||
throw new TypeError('braces: filter expects a callback function.');
|
||||
}
|
||||
|
||||
var len = arr.length;
|
||||
var res = arr.slice();
|
||||
var i = 0;
|
||||
|
||||
while (len--) {
|
||||
if (!cb(arr[len], i++)) {
|
||||
res.splice(len, 1);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
83
node_modules/decompress/node_modules/braces/package.json
generated
vendored
Normal file
83
node_modules/decompress/node_modules/braces/package.json
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"name": "braces",
|
||||
"description": "Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces specification.",
|
||||
"version": "1.8.5",
|
||||
"homepage": "https://github.com/jonschlinkert/braces",
|
||||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
||||
"repository": "jonschlinkert/braces",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/braces/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"main": "index.js",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"dependencies": {
|
||||
"expand-range": "^1.8.1",
|
||||
"preserve": "^0.2.0",
|
||||
"repeat-element": "^1.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"benchmarked": "^0.1.5",
|
||||
"brace-expansion": "^1.1.3",
|
||||
"chalk": "^1.1.3",
|
||||
"gulp-format-md": "^0.1.8",
|
||||
"minimatch": "^3.0.0",
|
||||
"minimist": "^1.2.0",
|
||||
"mocha": "^2.4.5",
|
||||
"should": "^8.3.1"
|
||||
},
|
||||
"keywords": [
|
||||
"alpha",
|
||||
"alphabetical",
|
||||
"bash",
|
||||
"brace",
|
||||
"expand",
|
||||
"expansion",
|
||||
"filepath",
|
||||
"fill",
|
||||
"fs",
|
||||
"glob",
|
||||
"globbing",
|
||||
"letter",
|
||||
"match",
|
||||
"matches",
|
||||
"matching",
|
||||
"number",
|
||||
"numerical",
|
||||
"path",
|
||||
"range",
|
||||
"ranges",
|
||||
"sh"
|
||||
],
|
||||
"verb": {
|
||||
"plugins": [
|
||||
"gulp-format-md"
|
||||
],
|
||||
"reflinks": [
|
||||
"verb"
|
||||
],
|
||||
"toc": false,
|
||||
"layout": "default",
|
||||
"lint": {
|
||||
"reflinks": true
|
||||
},
|
||||
"tasks": [
|
||||
"readme"
|
||||
],
|
||||
"related": {
|
||||
"list": [
|
||||
"micromatch",
|
||||
"expand-range",
|
||||
"fill-range"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
21
node_modules/decompress/node_modules/clone-stats/LICENSE.md
generated
vendored
Normal file
21
node_modules/decompress/node_modules/clone-stats/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
## The MIT License (MIT) ##
|
||||
|
||||
Copyright (c) 2014 Hugh Kennedy
|
||||
|
||||
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.
|
||||
17
node_modules/decompress/node_modules/clone-stats/README.md
generated
vendored
Normal file
17
node_modules/decompress/node_modules/clone-stats/README.md
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
# 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/node_modules/clone-stats/index.js
generated
vendored
Normal file
13
node_modules/decompress/node_modules/clone-stats/index.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
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/node_modules/clone-stats/package.json
generated
vendored
Normal file
31
node_modules/decompress/node_modules/clone-stats/package.json
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"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/node_modules/clone-stats/test.js
generated
vendored
Normal file
36
node_modules/decompress/node_modules/clone-stats/test.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
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/node_modules/clone/.npmignore
generated
vendored
Normal file
4
node_modules/decompress/node_modules/clone/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/node_modules/
|
||||
/test.js
|
||||
/*.html
|
||||
/.travis.yml
|
||||
18
node_modules/decompress/node_modules/clone/LICENSE
generated
vendored
Normal file
18
node_modules/decompress/node_modules/clone/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
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/node_modules/clone/README.md
generated
vendored
Normal file
126
node_modules/decompress/node_modules/clone/README.md
generated
vendored
Normal file
@@ -0,0 +1,126 @@
|
||||
# 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/node_modules/clone/clone.iml
generated
vendored
Normal file
10
node_modules/decompress/node_modules/clone/clone.iml
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?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/node_modules/clone/clone.js
generated
vendored
Normal file
166
node_modules/decompress/node_modules/clone/clone.js
generated
vendored
Normal file
@@ -0,0 +1,166 @@
|
||||
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/node_modules/clone/package.json
generated
vendored
Normal file
51
node_modules/decompress/node_modules/clone/package.json
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
21
node_modules/decompress/node_modules/expand-brackets/LICENSE
generated
vendored
Normal file
21
node_modules/decompress/node_modules/expand-brackets/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-2016, Jon Schlinkert.
|
||||
|
||||
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.
|
||||
107
node_modules/decompress/node_modules/expand-brackets/README.md
generated
vendored
Normal file
107
node_modules/decompress/node_modules/expand-brackets/README.md
generated
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
# expand-brackets [](https://www.npmjs.com/package/expand-brackets) [](https://npmjs.org/package/expand-brackets) [](https://travis-ci.org/jonschlinkert/expand-brackets)
|
||||
|
||||
> Expand POSIX bracket expressions (character classes) in glob patterns.
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/):
|
||||
|
||||
```sh
|
||||
$ npm install expand-brackets --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var brackets = require('expand-brackets');
|
||||
|
||||
brackets('[![:lower:]]');
|
||||
//=> '[^a-z]'
|
||||
```
|
||||
|
||||
## .isMatch
|
||||
|
||||
Return true if the given string matches the bracket expression:
|
||||
|
||||
```js
|
||||
brackets.isMatch('A', '[![:lower:]]');
|
||||
//=> true
|
||||
|
||||
brackets.isMatch('a', '[![:lower:]]');
|
||||
//=> false
|
||||
```
|
||||
|
||||
## .makeRe
|
||||
|
||||
Make a regular expression from a bracket expression:
|
||||
|
||||
```js
|
||||
brackets.makeRe('[![:lower:]]');
|
||||
//=> /[^a-z]/
|
||||
```
|
||||
|
||||
The following named POSIX bracket expressions are supported:
|
||||
|
||||
* `[:alnum:]`: Alphanumeric characters (`a-zA-Z0-9]`)
|
||||
* `[:alpha:]`: Alphabetic characters (`a-zA-Z]`)
|
||||
* `[:blank:]`: Space and tab (`[ t]`)
|
||||
* `[:digit:]`: Digits (`[0-9]`)
|
||||
* `[:lower:]`: Lowercase letters (`[a-z]`)
|
||||
* `[:punct:]`: Punctuation and symbols. (`[!"#$%&'()*+, -./:;<=>?@ [\]^_``{|}~]`)
|
||||
* `[:upper:]`: Uppercase letters (`[A-Z]`)
|
||||
* `[:word:]`: Word characters (letters, numbers and underscores) (`[A-Za-z0-9_]`)
|
||||
* `[:xdigit:]`: Hexadecimal digits (`[A-Fa-f0-9]`)
|
||||
|
||||
Collating sequences are not supported.
|
||||
|
||||
## Related projects
|
||||
|
||||
You might also be interested in these projects:
|
||||
|
||||
* [extglob](https://www.npmjs.com/package/extglob): Convert extended globs to regex-compatible strings. Add (almost) the expressive power of regular expressions to… [more](https://www.npmjs.com/package/extglob) | [homepage](https://github.com/jonschlinkert/extglob)
|
||||
* [is-extglob](https://www.npmjs.com/package/is-extglob): Returns true if a string has an extglob. | [homepage](https://github.com/jonschlinkert/is-extglob)
|
||||
* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern.… [more](https://www.npmjs.com/package/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob)
|
||||
* [is-posix-bracket](https://www.npmjs.com/package/is-posix-bracket): Returns true if the given string is a POSIX bracket expression (POSIX character class). | [homepage](https://github.com/jonschlinkert/is-posix-bracket)
|
||||
* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. Just… [more](https://www.npmjs.com/package/micromatch) | [homepage](https://github.com/jonschlinkert/micromatch)
|
||||
|
||||
## Contributing
|
||||
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/expand-brackets/issues/new).
|
||||
|
||||
## Building docs
|
||||
|
||||
Generate readme and API documentation with [verb](https://github.com/verbose/verb):
|
||||
|
||||
```sh
|
||||
$ npm install verb && npm run docs
|
||||
```
|
||||
|
||||
Or, if [verb](https://github.com/verbose/verb) is installed globally:
|
||||
|
||||
```sh
|
||||
$ verb
|
||||
```
|
||||
|
||||
## Running tests
|
||||
|
||||
Install dev dependencies:
|
||||
|
||||
```sh
|
||||
$ npm install -d && npm test
|
||||
```
|
||||
|
||||
## Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
* [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
|
||||
|
||||
## License
|
||||
|
||||
verb © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
|
||||
Released under the [MIT license](https://github.com/jonschlinkert/expand-brackets/blob/master/LICENSE).
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb](https://github.com/verbose/verb), v, on April 01, 2016._
|
||||
163
node_modules/decompress/node_modules/expand-brackets/index.js
generated
vendored
Normal file
163
node_modules/decompress/node_modules/expand-brackets/index.js
generated
vendored
Normal file
@@ -0,0 +1,163 @@
|
||||
/*!
|
||||
* expand-brackets <https://github.com/jonschlinkert/expand-brackets>
|
||||
*
|
||||
* Copyright (c) 2015 Jon Schlinkert.
|
||||
* Licensed under the MIT license.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var isPosixBracket = require('is-posix-bracket');
|
||||
|
||||
/**
|
||||
* POSIX character classes
|
||||
*/
|
||||
|
||||
var POSIX = {
|
||||
alnum: 'a-zA-Z0-9',
|
||||
alpha: 'a-zA-Z',
|
||||
blank: ' \\t',
|
||||
cntrl: '\\x00-\\x1F\\x7F',
|
||||
digit: '0-9',
|
||||
graph: '\\x21-\\x7E',
|
||||
lower: 'a-z',
|
||||
print: '\\x20-\\x7E',
|
||||
punct: '-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
|
||||
space: ' \\t\\r\\n\\v\\f',
|
||||
upper: 'A-Z',
|
||||
word: 'A-Za-z0-9_',
|
||||
xdigit: 'A-Fa-f0-9',
|
||||
};
|
||||
|
||||
/**
|
||||
* Expose `brackets`
|
||||
*/
|
||||
|
||||
module.exports = brackets;
|
||||
|
||||
function brackets(str) {
|
||||
if (!isPosixBracket(str)) {
|
||||
return str;
|
||||
}
|
||||
|
||||
var negated = false;
|
||||
if (str.indexOf('[^') !== -1) {
|
||||
negated = true;
|
||||
str = str.split('[^').join('[');
|
||||
}
|
||||
if (str.indexOf('[!') !== -1) {
|
||||
negated = true;
|
||||
str = str.split('[!').join('[');
|
||||
}
|
||||
|
||||
var a = str.split('[');
|
||||
var b = str.split(']');
|
||||
var imbalanced = a.length !== b.length;
|
||||
|
||||
var parts = str.split(/(?::\]\[:|\[?\[:|:\]\]?)/);
|
||||
var len = parts.length, i = 0;
|
||||
var end = '', beg = '';
|
||||
var res = [];
|
||||
|
||||
// start at the end (innermost) first
|
||||
while (len--) {
|
||||
var inner = parts[i++];
|
||||
if (inner === '^[!' || inner === '[!') {
|
||||
inner = '';
|
||||
negated = true;
|
||||
}
|
||||
|
||||
var prefix = negated ? '^' : '';
|
||||
var ch = POSIX[inner];
|
||||
|
||||
if (ch) {
|
||||
res.push('[' + prefix + ch + ']');
|
||||
} else if (inner) {
|
||||
if (/^\[?\w-\w\]?$/.test(inner)) {
|
||||
if (i === parts.length) {
|
||||
res.push('[' + prefix + inner);
|
||||
} else if (i === 1) {
|
||||
res.push(prefix + inner + ']');
|
||||
} else {
|
||||
res.push(prefix + inner);
|
||||
}
|
||||
} else {
|
||||
if (i === 1) {
|
||||
beg += inner;
|
||||
} else if (i === parts.length) {
|
||||
end += inner;
|
||||
} else {
|
||||
res.push('[' + prefix + inner + ']');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var result = res.join('|');
|
||||
var rlen = res.length || 1;
|
||||
if (rlen > 1) {
|
||||
result = '(?:' + result + ')';
|
||||
rlen = 1;
|
||||
}
|
||||
if (beg) {
|
||||
rlen++;
|
||||
if (beg.charAt(0) === '[') {
|
||||
if (imbalanced) {
|
||||
beg = '\\[' + beg.slice(1);
|
||||
} else {
|
||||
beg += ']';
|
||||
}
|
||||
}
|
||||
result = beg + result;
|
||||
}
|
||||
if (end) {
|
||||
rlen++;
|
||||
if (end.slice(-1) === ']') {
|
||||
if (imbalanced) {
|
||||
end = end.slice(0, end.length - 1) + '\\]';
|
||||
} else {
|
||||
end = '[' + end;
|
||||
}
|
||||
}
|
||||
result += end;
|
||||
}
|
||||
|
||||
if (rlen > 1) {
|
||||
result = result.split('][').join(']|[');
|
||||
if (result.indexOf('|') !== -1 && !/\(\?/.test(result)) {
|
||||
result = '(?:' + result + ')';
|
||||
}
|
||||
}
|
||||
|
||||
result = result.replace(/\[+=|=\]+/g, '\\b');
|
||||
return result;
|
||||
}
|
||||
|
||||
brackets.makeRe = function(pattern) {
|
||||
try {
|
||||
return new RegExp(brackets(pattern));
|
||||
} catch (err) {}
|
||||
};
|
||||
|
||||
brackets.isMatch = function(str, pattern) {
|
||||
try {
|
||||
return brackets.makeRe(pattern).test(str);
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
brackets.match = function(arr, pattern) {
|
||||
var len = arr.length, i = 0;
|
||||
var res = arr.slice();
|
||||
|
||||
var re = brackets.makeRe(pattern);
|
||||
while (i < len) {
|
||||
var ele = arr[i++];
|
||||
if (!re.test(ele)) {
|
||||
continue;
|
||||
}
|
||||
res.splice(i, 1);
|
||||
}
|
||||
return res;
|
||||
};
|
||||
62
node_modules/decompress/node_modules/expand-brackets/package.json
generated
vendored
Normal file
62
node_modules/decompress/node_modules/expand-brackets/package.json
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"name": "expand-brackets",
|
||||
"description": "Expand POSIX bracket expressions (character classes) in glob patterns.",
|
||||
"version": "0.1.5",
|
||||
"homepage": "https://github.com/jonschlinkert/expand-brackets",
|
||||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
||||
"repository": "jonschlinkert/expand-brackets",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/expand-brackets/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"main": "index.js",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"dependencies": {
|
||||
"is-posix-bracket": "^0.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"gulp-format-md": "^0.1.7",
|
||||
"mocha": "^2.2.5",
|
||||
"should": "^7.0.2"
|
||||
},
|
||||
"keywords": [
|
||||
"bracket",
|
||||
"character class",
|
||||
"expression",
|
||||
"posix"
|
||||
],
|
||||
"verb": {
|
||||
"run": true,
|
||||
"toc": false,
|
||||
"layout": "default",
|
||||
"tasks": [
|
||||
"readme"
|
||||
],
|
||||
"plugins": [
|
||||
"gulp-format-md"
|
||||
],
|
||||
"related": {
|
||||
"list": [
|
||||
"extglob",
|
||||
"is-extglob",
|
||||
"is-glob",
|
||||
"is-posix-bracket",
|
||||
"micromatch"
|
||||
]
|
||||
},
|
||||
"reflinks": [
|
||||
"verb"
|
||||
],
|
||||
"lint": {
|
||||
"reflinks": true
|
||||
}
|
||||
}
|
||||
}
|
||||
21
node_modules/decompress/node_modules/extend-shallow/LICENSE
generated
vendored
Normal file
21
node_modules/decompress/node_modules/extend-shallow/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2015, Jon Schlinkert.
|
||||
|
||||
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.
|
||||
61
node_modules/decompress/node_modules/extend-shallow/README.md
generated
vendored
Normal file
61
node_modules/decompress/node_modules/extend-shallow/README.md
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
# extend-shallow [](http://badge.fury.io/js/extend-shallow) [](https://travis-ci.org/jonschlinkert/extend-shallow)
|
||||
|
||||
> Extend an object with the properties of additional objects. node.js/javascript util.
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/)
|
||||
|
||||
```sh
|
||||
$ npm i extend-shallow --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var extend = require('extend-shallow');
|
||||
|
||||
extend({a: 'b'}, {c: 'd'})
|
||||
//=> {a: 'b', c: 'd'}
|
||||
```
|
||||
|
||||
Pass an empty object to shallow clone:
|
||||
|
||||
```js
|
||||
var obj = {};
|
||||
extend(obj, {a: 'b'}, {c: 'd'})
|
||||
//=> {a: 'b', c: 'd'}
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util.
|
||||
* [for-own](https://github.com/jonschlinkert/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own)
|
||||
* [for-in](https://github.com/jonschlinkert/for-in): Iterate over the own and inherited enumerable properties of an objecte, and return an object… [more](https://github.com/jonschlinkert/for-in)
|
||||
* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor.
|
||||
* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null.
|
||||
* [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value.
|
||||
|
||||
## Running tests
|
||||
|
||||
Install dev dependencies:
|
||||
|
||||
```sh
|
||||
$ npm i -d && npm test
|
||||
```
|
||||
|
||||
## Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
+ [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
|
||||
|
||||
## License
|
||||
|
||||
Copyright © 2015 Jon Schlinkert
|
||||
Released under the MIT license.
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 29, 2015._
|
||||
33
node_modules/decompress/node_modules/extend-shallow/index.js
generated
vendored
Normal file
33
node_modules/decompress/node_modules/extend-shallow/index.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
'use strict';
|
||||
|
||||
var isObject = require('is-extendable');
|
||||
|
||||
module.exports = function extend(o/*, objects*/) {
|
||||
if (!isObject(o)) { o = {}; }
|
||||
|
||||
var len = arguments.length;
|
||||
for (var i = 1; i < len; i++) {
|
||||
var obj = arguments[i];
|
||||
|
||||
if (isObject(obj)) {
|
||||
assign(o, obj);
|
||||
}
|
||||
}
|
||||
return o;
|
||||
};
|
||||
|
||||
function assign(a, b) {
|
||||
for (var key in b) {
|
||||
if (hasOwn(b, key)) {
|
||||
a[key] = b[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the given `key` is an own property of `obj`.
|
||||
*/
|
||||
|
||||
function hasOwn(obj, key) {
|
||||
return Object.prototype.hasOwnProperty.call(obj, key);
|
||||
}
|
||||
56
node_modules/decompress/node_modules/extend-shallow/package.json
generated
vendored
Normal file
56
node_modules/decompress/node_modules/extend-shallow/package.json
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"name": "extend-shallow",
|
||||
"description": "Extend an object with the properties of additional objects. node.js/javascript util.",
|
||||
"version": "2.0.1",
|
||||
"homepage": "https://github.com/jonschlinkert/extend-shallow",
|
||||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
||||
"repository": "jonschlinkert/extend-shallow",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/extend-shallow/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"main": "index.js",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"dependencies": {
|
||||
"is-extendable": "^0.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"array-slice": "^0.2.3",
|
||||
"benchmarked": "^0.1.4",
|
||||
"chalk": "^1.0.0",
|
||||
"for-own": "^0.1.3",
|
||||
"glob": "^5.0.12",
|
||||
"is-plain-object": "^2.0.1",
|
||||
"kind-of": "^2.0.0",
|
||||
"minimist": "^1.1.1",
|
||||
"mocha": "^2.2.5",
|
||||
"should": "^7.0.1"
|
||||
},
|
||||
"keywords": [
|
||||
"assign",
|
||||
"extend",
|
||||
"javascript",
|
||||
"js",
|
||||
"keys",
|
||||
"merge",
|
||||
"obj",
|
||||
"object",
|
||||
"prop",
|
||||
"properties",
|
||||
"property",
|
||||
"props",
|
||||
"shallow",
|
||||
"util",
|
||||
"utility",
|
||||
"utils",
|
||||
"value"
|
||||
]
|
||||
}
|
||||
21
node_modules/decompress/node_modules/extglob/LICENSE
generated
vendored
Normal file
21
node_modules/decompress/node_modules/extglob/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015, Jon Schlinkert.
|
||||
|
||||
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.
|
||||
88
node_modules/decompress/node_modules/extglob/README.md
generated
vendored
Normal file
88
node_modules/decompress/node_modules/extglob/README.md
generated
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
# extglob [](http://badge.fury.io/js/extglob) [](https://travis-ci.org/jonschlinkert/extglob)
|
||||
|
||||
> Convert extended globs to regex-compatible strings. Add (almost) the expressive power of regular expressions to glob patterns.
|
||||
|
||||
Install with [npm](https://www.npmjs.com/)
|
||||
|
||||
```sh
|
||||
$ npm i extglob --save
|
||||
```
|
||||
|
||||
Used by [micromatch](https://github.com/jonschlinkert/micromatch).
|
||||
|
||||
**Features**
|
||||
|
||||
* Convert an extglob string to a regex-compatible string. **Only converts extglobs**, to handle full globs use [micromatch](https://github.com/jonschlinkert/micromatch).
|
||||
* Pass `{regex: true}` to return a regex
|
||||
* Handles nested patterns
|
||||
* More complete (and correct) support than [minimatch](https://github.com/isaacs/minimatch)
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var extglob = require('extglob');
|
||||
|
||||
extglob('?(z)');
|
||||
//=> '(?:z)?'
|
||||
extglob('*(z)');
|
||||
//=> '(?:z)*'
|
||||
extglob('+(z)');
|
||||
//=> '(?:z)+'
|
||||
extglob('@(z)');
|
||||
//=> '(?:z)'
|
||||
extglob('!(z)');
|
||||
//=> '(?!^(?:(?!z)[^/]*?)).*$'
|
||||
```
|
||||
|
||||
**Optionally return regex**
|
||||
|
||||
```js
|
||||
extglob('!(z)', {regex: true});
|
||||
//=> /(?!^(?:(?!z)[^/]*?)).*$/
|
||||
```
|
||||
|
||||
## Extglob patterns
|
||||
|
||||
To learn more about how extglobs work, see the docs for [Bash pattern matching](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html):
|
||||
|
||||
* `?(pattern)`: Match zero or one occurrence of the given pattern.
|
||||
* `*(pattern)`: Match zero or more occurrences of the given pattern.
|
||||
* `+(pattern)`: Match one or more occurrences of the given pattern.
|
||||
* `@(pattern)`: Match one of the given pattern.
|
||||
* `!(pattern)`: Match anything except one of the given pattern.
|
||||
|
||||
## Related
|
||||
|
||||
* [braces](https://github.com/jonschlinkert/braces): Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces… [more](https://github.com/jonschlinkert/braces)
|
||||
* [expand-brackets](https://github.com/jonschlinkert/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns.
|
||||
* [expand-range](https://github.com/jonschlinkert/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See… [more](https://github.com/jonschlinkert/expand-range)
|
||||
* [fill-range](https://github.com/jonschlinkert/fill-range): Fill in a range of numbers or letters, optionally passing an increment or multiplier to… [more](https://github.com/jonschlinkert/fill-range)
|
||||
* [micromatch](https://github.com/jonschlinkert/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. Just… [more](https://github.com/jonschlinkert/micromatch)
|
||||
|
||||
## Run tests
|
||||
|
||||
Install dev dependencies:
|
||||
|
||||
```sh
|
||||
$ npm i -d && npm test
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/extglob/issues/new)
|
||||
|
||||
## Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
+ [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
|
||||
|
||||
## License
|
||||
|
||||
Copyright © 2015 Jon Schlinkert
|
||||
Released under the MIT license.
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on August 01, 2015._
|
||||
178
node_modules/decompress/node_modules/extglob/index.js
generated
vendored
Normal file
178
node_modules/decompress/node_modules/extglob/index.js
generated
vendored
Normal file
@@ -0,0 +1,178 @@
|
||||
/*!
|
||||
* extglob <https://github.com/jonschlinkert/extglob>
|
||||
*
|
||||
* Copyright (c) 2015, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Module dependencies
|
||||
*/
|
||||
|
||||
var isExtglob = require('is-extglob');
|
||||
var re, cache = {};
|
||||
|
||||
/**
|
||||
* Expose `extglob`
|
||||
*/
|
||||
|
||||
module.exports = extglob;
|
||||
|
||||
/**
|
||||
* Convert the given extglob `string` to a regex-compatible
|
||||
* string.
|
||||
*
|
||||
* ```js
|
||||
* var extglob = require('extglob');
|
||||
* extglob('!(a?(b))');
|
||||
* //=> '(?!a(?:b)?)[^/]*?'
|
||||
* ```
|
||||
*
|
||||
* @param {String} `str` The string to convert.
|
||||
* @param {Object} `options`
|
||||
* @option {Boolean} [options] `esc` If `false` special characters will not be escaped. Defaults to `true`.
|
||||
* @option {Boolean} [options] `regex` If `true` a regular expression is returned instead of a string.
|
||||
* @return {String}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
|
||||
function extglob(str, opts) {
|
||||
opts = opts || {};
|
||||
var o = {}, i = 0;
|
||||
|
||||
// fix common character reversals
|
||||
// '*!(.js)' => '*.!(js)'
|
||||
str = str.replace(/!\(([^\w*()])/g, '$1!(');
|
||||
|
||||
// support file extension negation
|
||||
str = str.replace(/([*\/])\.!\([*]\)/g, function (m, ch) {
|
||||
if (ch === '/') {
|
||||
return escape('\\/[^.]+');
|
||||
}
|
||||
return escape('[^.]+');
|
||||
});
|
||||
|
||||
// create a unique key for caching by
|
||||
// combining the string and options
|
||||
var key = str
|
||||
+ String(!!opts.regex)
|
||||
+ String(!!opts.contains)
|
||||
+ String(!!opts.escape);
|
||||
|
||||
if (cache.hasOwnProperty(key)) {
|
||||
return cache[key];
|
||||
}
|
||||
|
||||
if (!(re instanceof RegExp)) {
|
||||
re = regex();
|
||||
}
|
||||
|
||||
opts.negate = false;
|
||||
var m;
|
||||
|
||||
while (m = re.exec(str)) {
|
||||
var prefix = m[1];
|
||||
var inner = m[3];
|
||||
if (prefix === '!') {
|
||||
opts.negate = true;
|
||||
}
|
||||
|
||||
var id = '__EXTGLOB_' + (i++) + '__';
|
||||
// use the prefix of the _last_ (outtermost) pattern
|
||||
o[id] = wrap(inner, prefix, opts.escape);
|
||||
str = str.split(m[0]).join(id);
|
||||
}
|
||||
|
||||
var keys = Object.keys(o);
|
||||
var len = keys.length;
|
||||
|
||||
// we have to loop again to allow us to convert
|
||||
// patterns in reverse order (starting with the
|
||||
// innermost/last pattern first)
|
||||
while (len--) {
|
||||
var prop = keys[len];
|
||||
str = str.split(prop).join(o[prop]);
|
||||
}
|
||||
|
||||
var result = opts.regex
|
||||
? toRegex(str, opts.contains, opts.negate)
|
||||
: str;
|
||||
|
||||
result = result.split('.').join('\\.');
|
||||
|
||||
// cache the result and return it
|
||||
return (cache[key] = result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert `string` to a regex string.
|
||||
*
|
||||
* @param {String} `str`
|
||||
* @param {String} `prefix` Character that determines how to wrap the string.
|
||||
* @param {Boolean} `esc` If `false` special characters will not be escaped. Defaults to `true`.
|
||||
* @return {String}
|
||||
*/
|
||||
|
||||
function wrap(inner, prefix, esc) {
|
||||
if (esc) inner = escape(inner);
|
||||
|
||||
switch (prefix) {
|
||||
case '!':
|
||||
return '(?!' + inner + ')[^/]' + (esc ? '%%%~' : '*?');
|
||||
case '@':
|
||||
return '(?:' + inner + ')';
|
||||
case '+':
|
||||
return '(?:' + inner + ')+';
|
||||
case '*':
|
||||
return '(?:' + inner + ')' + (esc ? '%%' : '*')
|
||||
case '?':
|
||||
return '(?:' + inner + '|)';
|
||||
default:
|
||||
return inner;
|
||||
}
|
||||
}
|
||||
|
||||
function escape(str) {
|
||||
str = str.split('*').join('[^/]%%%~');
|
||||
str = str.split('.').join('\\.');
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
* extglob regex.
|
||||
*/
|
||||
|
||||
function regex() {
|
||||
return /(\\?[@?!+*$]\\?)(\(([^()]*?)\))/;
|
||||
}
|
||||
|
||||
/**
|
||||
* Negation regex
|
||||
*/
|
||||
|
||||
function negate(str) {
|
||||
return '(?!^' + str + ').*$';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the regex to do the matching. If
|
||||
* the leading character in the `pattern` is `!`
|
||||
* a negation regex is returned.
|
||||
*
|
||||
* @param {String} `pattern`
|
||||
* @param {Boolean} `contains` Allow loose matching.
|
||||
* @param {Boolean} `isNegated` True if the pattern is a negation pattern.
|
||||
*/
|
||||
|
||||
function toRegex(pattern, contains, isNegated) {
|
||||
var prefix = contains ? '^' : '';
|
||||
var after = contains ? '$' : '';
|
||||
pattern = ('(?:' + pattern + ')' + after);
|
||||
if (isNegated) {
|
||||
pattern = prefix + negate(pattern);
|
||||
}
|
||||
return new RegExp(prefix + pattern);
|
||||
}
|
||||
21
node_modules/decompress/node_modules/extglob/node_modules/is-extglob/LICENSE
generated
vendored
Normal file
21
node_modules/decompress/node_modules/extglob/node_modules/is-extglob/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2015, Jon Schlinkert.
|
||||
|
||||
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.
|
||||
75
node_modules/decompress/node_modules/extglob/node_modules/is-extglob/README.md
generated
vendored
Normal file
75
node_modules/decompress/node_modules/extglob/node_modules/is-extglob/README.md
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
# is-extglob [](http://badge.fury.io/js/is-extglob) [](https://travis-ci.org/jonschlinkert/is-extglob)
|
||||
|
||||
> Returns true if a string has an extglob.
|
||||
|
||||
## Install with [npm](npmjs.org)
|
||||
|
||||
```bash
|
||||
npm i is-extglob --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var isExtglob = require('is-extglob');
|
||||
```
|
||||
|
||||
**True**
|
||||
|
||||
```js
|
||||
isExtglob('?(abc)');
|
||||
isExtglob('@(abc)');
|
||||
isExtglob('!(abc)');
|
||||
isExtglob('*(abc)');
|
||||
isExtglob('+(abc)');
|
||||
```
|
||||
|
||||
**False**
|
||||
|
||||
Everything else...
|
||||
|
||||
```js
|
||||
isExtglob('foo.js');
|
||||
isExtglob('!foo.js');
|
||||
isExtglob('*.js');
|
||||
isExtglob('**/abc.js');
|
||||
isExtglob('abc/*.js');
|
||||
isExtglob('abc/(aaa|bbb).js');
|
||||
isExtglob('abc/[a-z].js');
|
||||
isExtglob('abc/{a,b}.js');
|
||||
isExtglob('abc/?.js');
|
||||
isExtglob('abc.js');
|
||||
isExtglob('abc/def/ghi.js');
|
||||
```
|
||||
|
||||
## Related
|
||||
* [extglob](https://github.com/jonschlinkert/extglob): Extended globs. extglobs add the expressive power of regular expressions to glob patterns.
|
||||
* [micromatch](https://github.com/jonschlinkert/micromatch): Glob matching for javascript/node.js. A faster alternative to minimatch (10-45x faster on avg), with all the features you're used to using in your Grunt and gulp tasks.
|
||||
* [parse-glob](https://github.com/jonschlinkert/parse-glob): Parse a glob pattern into an object of tokens.
|
||||
|
||||
## Run tests
|
||||
Install dev dependencies.
|
||||
|
||||
```bash
|
||||
npm i -d && npm test
|
||||
```
|
||||
|
||||
|
||||
## Contributing
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-extglob/issues)
|
||||
|
||||
|
||||
## Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
+ [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
|
||||
|
||||
## License
|
||||
Copyright (c) 2015 Jon Schlinkert
|
||||
Released under the MIT license
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 06, 2015._
|
||||
11
node_modules/decompress/node_modules/extglob/node_modules/is-extglob/index.js
generated
vendored
Normal file
11
node_modules/decompress/node_modules/extglob/node_modules/is-extglob/index.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
/*!
|
||||
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
||||
*
|
||||
* Copyright (c) 2014-2015, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
|
||||
module.exports = function isExtglob(str) {
|
||||
return typeof str === 'string'
|
||||
&& /[@?!+*]\(/.test(str);
|
||||
};
|
||||
48
node_modules/decompress/node_modules/extglob/node_modules/is-extglob/package.json
generated
vendored
Normal file
48
node_modules/decompress/node_modules/extglob/node_modules/is-extglob/package.json
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "is-extglob",
|
||||
"description": "Returns true if a string has an extglob.",
|
||||
"version": "1.0.0",
|
||||
"homepage": "https://github.com/jonschlinkert/is-extglob",
|
||||
"author": {
|
||||
"name": "Jon Schlinkert",
|
||||
"url": "https://github.com/jonschlinkert"
|
||||
},
|
||||
"repository": "jonschlinkert/is-extglob",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/is-extglob/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"main": "index.js",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha",
|
||||
"prepublish": "browserify -o browser.js -e index.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "*",
|
||||
"should": "*"
|
||||
},
|
||||
"keywords": [
|
||||
"bash",
|
||||
"braces",
|
||||
"check",
|
||||
"exec",
|
||||
"extglob",
|
||||
"expression",
|
||||
"glob",
|
||||
"globbing",
|
||||
"globstar",
|
||||
"match",
|
||||
"matches",
|
||||
"pattern",
|
||||
"regex",
|
||||
"regular",
|
||||
"string",
|
||||
"test"
|
||||
]
|
||||
}
|
||||
60
node_modules/decompress/node_modules/extglob/package.json
generated
vendored
Normal file
60
node_modules/decompress/node_modules/extglob/package.json
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"name": "extglob",
|
||||
"description": "Convert extended globs to regex-compatible strings. Add (almost) the expressive power of regular expressions to glob patterns.",
|
||||
"version": "0.3.2",
|
||||
"homepage": "https://github.com/jonschlinkert/extglob",
|
||||
"author": {
|
||||
"name": "Jon Schlinkert",
|
||||
"url": "https://github.com/jonschlinkert"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/jonschlinkert/extglob.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/extglob/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"main": "index.js",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"dependencies": {
|
||||
"is-extglob": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ansi-green": "^0.1.1",
|
||||
"micromatch": "^2.1.6",
|
||||
"minimatch": "^2.0.1",
|
||||
"minimist": "^1.1.0",
|
||||
"mocha": "*",
|
||||
"should": "*",
|
||||
"success-symbol": "^0.1.0"
|
||||
},
|
||||
"keywords": [
|
||||
"bash",
|
||||
"extended",
|
||||
"extglob",
|
||||
"glob",
|
||||
"ksh",
|
||||
"match",
|
||||
"wildcard"
|
||||
],
|
||||
"verb": {
|
||||
"related": {
|
||||
"list": [
|
||||
"micromatch",
|
||||
"expand-brackets",
|
||||
"braces",
|
||||
"fill-range",
|
||||
"expand-range"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
15
node_modules/decompress/node_modules/glob-parent/LICENSE
generated
vendored
Normal file
15
node_modules/decompress/node_modules/glob-parent/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
The ISC License
|
||||
|
||||
Copyright (c) 2015 Elan Shanker
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
109
node_modules/decompress/node_modules/glob-parent/README.md
generated
vendored
Normal file
109
node_modules/decompress/node_modules/glob-parent/README.md
generated
vendored
Normal file
@@ -0,0 +1,109 @@
|
||||
glob-parent [](https://travis-ci.org/es128/glob-parent) [](https://coveralls.io/r/es128/glob-parent?branch=master)
|
||||
======
|
||||
Javascript module to extract the non-magic parent path from a glob string.
|
||||
|
||||
[](https://nodei.co/npm/glob-parent/)
|
||||
[](https://nodei.co/npm-dl/glob-parent/)
|
||||
|
||||
Usage
|
||||
-----
|
||||
```sh
|
||||
npm install glob-parent --save
|
||||
```
|
||||
|
||||
**Examples**
|
||||
|
||||
```js
|
||||
var globParent = require('glob-parent');
|
||||
|
||||
globParent('path/to/*.js'); // 'path/to'
|
||||
globParent('/root/path/to/*.js'); // '/root/path/to'
|
||||
globParent('/*.js'); // '/'
|
||||
globParent('*.js'); // '.'
|
||||
globParent('**/*.js'); // '.'
|
||||
globParent('path/{to,from}'); // 'path'
|
||||
globParent('path/!(to|from)'); // 'path'
|
||||
globParent('path/?(to|from)'); // 'path'
|
||||
globParent('path/+(to|from)'); // 'path'
|
||||
globParent('path/*(to|from)'); // 'path'
|
||||
globParent('path/@(to|from)'); // 'path'
|
||||
globParent('path/**/*'); // 'path'
|
||||
|
||||
// if provided a non-glob path, returns the nearest dir
|
||||
globParent('path/foo/bar.js'); // 'path/foo'
|
||||
globParent('path/foo/'); // 'path/foo'
|
||||
globParent('path/foo'); // 'path' (see issue #3 for details)
|
||||
```
|
||||
|
||||
## Escaping
|
||||
|
||||
The following characters have special significance in glob patterns and must be escaped if you want them to be treated as regular path characters:
|
||||
|
||||
- `?` (question mark)
|
||||
- `*` (star)
|
||||
- `|` (pipe)
|
||||
- `(` (opening parenthesis)
|
||||
- `)` (closing parenthesis)
|
||||
- `{` (opening curly brace)
|
||||
- `}` (closing curly brace)
|
||||
- `[` (opening bracket)
|
||||
- `]` (closing bracket)
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
globParent('foo/[bar]/') // 'foo'
|
||||
globParent('foo/\\[bar]/') // 'foo/[bar]'
|
||||
```
|
||||
|
||||
## Limitations
|
||||
|
||||
#### Braces & Brackets
|
||||
This library attempts a quick and imperfect method of determining which path
|
||||
parts have glob magic without fully parsing/lexing the pattern. There are some
|
||||
advanced use cases that can trip it up, such as nested braces where the outer
|
||||
pair is escaped and the inner one contains a path separator. If you find
|
||||
yourself in the unlikely circumstance of being affected by this or need to
|
||||
ensure higher-fidelity glob handling in your library, it is recommended that you
|
||||
pre-process your input with [expand-braces] and/or [expand-brackets].
|
||||
|
||||
#### Windows
|
||||
Backslashes are not valid path separators for globs. If a path with backslashes
|
||||
is provided anyway, for simple cases, glob-parent will replace the path
|
||||
separator for you and return the non-glob parent path (now with
|
||||
forward-slashes, which are still valid as Windows path separators).
|
||||
|
||||
This cannot be used in conjunction with escape characters.
|
||||
|
||||
```js
|
||||
// BAD
|
||||
globParent('C:\\Program Files \\(x86\\)\\*.ext') // 'C:/Program Files /(x86/)'
|
||||
|
||||
// GOOD
|
||||
globParent('C:/Program Files\\(x86\\)/*.ext') // 'C:/Program Files (x86)'
|
||||
```
|
||||
|
||||
If you are using escape characters for a pattern without path parts (i.e.
|
||||
relative to `cwd`), prefix with `./` to avoid confusing glob-parent.
|
||||
|
||||
```js
|
||||
// BAD
|
||||
globParent('foo \\[bar]') // 'foo '
|
||||
globParent('foo \\[bar]*') // 'foo '
|
||||
|
||||
// GOOD
|
||||
globParent('./foo \\[bar]') // 'foo [bar]'
|
||||
globParent('./foo \\[bar]*') // '.'
|
||||
```
|
||||
|
||||
|
||||
Change Log
|
||||
----------
|
||||
[See release notes page on GitHub](https://github.com/es128/glob-parent/releases)
|
||||
|
||||
License
|
||||
-------
|
||||
[ISC](https://raw.github.com/es128/glob-parent/master/LICENSE)
|
||||
|
||||
[expand-braces]: https://github.com/jonschlinkert/expand-braces
|
||||
[expand-brackets]: https://github.com/jonschlinkert/expand-brackets
|
||||
24
node_modules/decompress/node_modules/glob-parent/index.js
generated
vendored
Normal file
24
node_modules/decompress/node_modules/glob-parent/index.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
'use strict';
|
||||
|
||||
var path = require('path');
|
||||
var isglob = require('is-glob');
|
||||
var pathDirname = require('path-dirname');
|
||||
var isWin32 = require('os').platform() === 'win32';
|
||||
|
||||
module.exports = function globParent(str) {
|
||||
// flip windows path separators
|
||||
if (isWin32 && str.indexOf('/') < 0) str = str.split('\\').join('/');
|
||||
|
||||
// special case for strings ending in enclosure containing path separator
|
||||
if (/[\{\[].*[\/]*.*[\}\]]$/.test(str)) str += '/';
|
||||
|
||||
// preserves full path in case of trailing path separator
|
||||
str += 'a';
|
||||
|
||||
// remove path parts that are globby
|
||||
do {str = pathDirname.posix(str)}
|
||||
while (isglob(str) || /(^|[^\\])([\{\[]|\([^\)]+$)/.test(str));
|
||||
|
||||
// remove escape chars and return result
|
||||
return str.replace(/\\([\*\?\|\[\]\(\)\{\}])/g, '$1');
|
||||
};
|
||||
42
node_modules/decompress/node_modules/glob-parent/package.json
generated
vendored
Normal file
42
node_modules/decompress/node_modules/glob-parent/package.json
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "glob-parent",
|
||||
"version": "3.1.0",
|
||||
"description": "Strips glob magic from a string to provide the parent directory path",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "istanbul test node_modules/mocha/bin/_mocha",
|
||||
"ci-test": "istanbul cover _mocha && cat ./coverage/lcov.info | coveralls"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/es128/glob-parent"
|
||||
},
|
||||
"keywords": [
|
||||
"glob",
|
||||
"parent",
|
||||
"strip",
|
||||
"path",
|
||||
"dirname",
|
||||
"directory",
|
||||
"base",
|
||||
"wildcard"
|
||||
],
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"author": "Elan Shanker (https://github.com/es128)",
|
||||
"license": "ISC",
|
||||
"bugs": {
|
||||
"url": "https://github.com/es128/glob-parent/issues"
|
||||
},
|
||||
"homepage": "https://github.com/es128/glob-parent",
|
||||
"dependencies": {
|
||||
"is-glob": "^3.1.0",
|
||||
"path-dirname": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"coveralls": "^2.11.2",
|
||||
"istanbul": "^0.3.5",
|
||||
"mocha": "^2.1.0"
|
||||
}
|
||||
}
|
||||
21
node_modules/decompress/node_modules/glob-stream/LICENSE
generated
vendored
Executable file
21
node_modules/decompress/node_modules/glob-stream/LICENSE
generated
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Blaine Bublitz, Eric Schoffstall and other 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, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
95
node_modules/decompress/node_modules/glob-stream/README.md
generated
vendored
Normal file
95
node_modules/decompress/node_modules/glob-stream/README.md
generated
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
<p align="center">
|
||||
<a href="http://gulpjs.com">
|
||||
<img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
# glob-stream
|
||||
|
||||
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url]
|
||||
|
||||
A wrapper around [node-glob][node-glob-url] to make it streamy.
|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
var gs = require('glob-stream');
|
||||
|
||||
var stream = gs.create('./files/**/*.coffee', { /* options */ });
|
||||
|
||||
stream.on('data', function(file){
|
||||
// file has path, base, and cwd attrs
|
||||
});
|
||||
```
|
||||
|
||||
You can pass any combination of globs. One caveat is that you can not only pass a glob negation, you must give it at least one positive glob so it knows where to start. All given must match for the file to be returned.
|
||||
|
||||
## API
|
||||
|
||||
### create(globs, options)
|
||||
|
||||
Returns a stream for multiple globs or filters.
|
||||
|
||||
### createStream(positiveGlob, negativeGlobs, options)
|
||||
|
||||
Returns a stream for a single glob or filter.
|
||||
|
||||
### Options
|
||||
|
||||
- cwd
|
||||
- Default is `process.cwd()`
|
||||
- base
|
||||
- Default is everything before a glob starts (see [glob-parent][glob-parent-url])
|
||||
- cwdbase
|
||||
- Default is `false`
|
||||
- When true it is the same as saying opt.base = opt.cwd
|
||||
- allowEmpty
|
||||
- Default is `false`
|
||||
- If true, won't emit an error when a glob pointing at a single file fails to match
|
||||
- Any through2 related options are documented in [through2][through2-url]
|
||||
|
||||
This argument is passed directly to [node-glob][node-glob-url] so check there for more options
|
||||
|
||||
### Glob
|
||||
|
||||
```js
|
||||
var stream = gs.create(['./**/*.js', '!./node_modules/**/*']);
|
||||
```
|
||||
|
||||
Globs are executed in order, so negations should follow positive globs. For example:
|
||||
|
||||
```js
|
||||
gulp.src(['!b*.js', '*.js'])
|
||||
```
|
||||
|
||||
would not exclude any files, but this would
|
||||
|
||||
```js
|
||||
gulp.src(['*.js', '!b*.js'])
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
- [globby][globby-url] - Non-streaming `glob` wrapper with support for multiple patterns.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
[globby-url]: https://github.com/sindresorhus/globby
|
||||
[through2-url]: https://github.com/rvagg/through2
|
||||
[node-glob-url]: https://github.com/isaacs/node-glob
|
||||
[glob-parent-url]: https://github.com/es128/glob-parent
|
||||
|
||||
[downloads-image]: http://img.shields.io/npm/dm/glob-stream.svg
|
||||
[npm-url]: https://www.npmjs.com/package/glob-stream
|
||||
[npm-image]: https://badge.fury.io/js/glob-stream.svg
|
||||
|
||||
[travis-url]: https://travis-ci.org/gulpjs/glob-stream
|
||||
[travis-image]: https://travis-ci.org/gulpjs/glob-stream.svg?branch=master
|
||||
|
||||
[coveralls-url]: https://coveralls.io/r/gulpjs/glob-stream
|
||||
[coveralls-image]: https://coveralls.io/repos/gulpjs/glob-stream/badge.svg
|
||||
|
||||
[gitter-url]: https://gitter.im/gulpjs/gulp
|
||||
[gitter-image]: https://badges.gitter.im/gulpjs/gulp.png
|
||||
209
node_modules/decompress/node_modules/glob-stream/index.js
generated
vendored
Normal file
209
node_modules/decompress/node_modules/glob-stream/index.js
generated
vendored
Normal file
@@ -0,0 +1,209 @@
|
||||
'use strict';
|
||||
|
||||
var through2 = require('through2');
|
||||
var Combine = require('ordered-read-streams');
|
||||
var unique = require('unique-stream');
|
||||
|
||||
var glob = require('glob');
|
||||
var micromatch = require('micromatch');
|
||||
var resolveGlob = require('to-absolute-glob');
|
||||
var globParent = require('glob-parent');
|
||||
var path = require('path');
|
||||
var extend = require('extend');
|
||||
var sepRe = (process.platform === 'win32' ? /[\/\\]/ : /\/+/);
|
||||
|
||||
var gs = {
|
||||
// Creates a stream for a single glob or filter
|
||||
createStream: function(ourGlob, negatives, opt) {
|
||||
|
||||
var ourOpt = extend({}, opt);
|
||||
delete ourOpt.root;
|
||||
|
||||
// Extract base path from glob
|
||||
var basePath = ourOpt.base || getBasePath(ourGlob, opt);
|
||||
|
||||
// Remove path relativity to make globs make sense
|
||||
ourGlob = resolveGlob(ourGlob, opt);
|
||||
|
||||
// Create globbing stuff
|
||||
var globber = new glob.Glob(ourGlob, ourOpt);
|
||||
|
||||
// Create stream and map events from globber to it
|
||||
var stream = through2.obj(opt,
|
||||
negatives.length ? filterNegatives : undefined);
|
||||
|
||||
var found = false;
|
||||
|
||||
globber.on('error', stream.emit.bind(stream, 'error'));
|
||||
globber.once('end', function() {
|
||||
if (opt.allowEmpty !== true && !found && globIsSingular(globber)) {
|
||||
stream.emit('error',
|
||||
new Error('File not found with singular glob: ' + ourGlob));
|
||||
}
|
||||
|
||||
stream.end();
|
||||
});
|
||||
globber.on('match', function(filename) {
|
||||
found = true;
|
||||
|
||||
stream.write({
|
||||
cwd: opt.cwd,
|
||||
base: basePath,
|
||||
path: path.normalize(filename),
|
||||
});
|
||||
});
|
||||
|
||||
return stream;
|
||||
|
||||
function filterNegatives(filename, enc, cb) {
|
||||
var matcha = isMatch.bind(null, filename);
|
||||
if (negatives.every(matcha)) {
|
||||
cb(null, filename); // Pass
|
||||
} else {
|
||||
cb(); // Ignore
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Creates a stream for multiple globs or filters
|
||||
create: function(globs, opt) {
|
||||
if (!opt) {
|
||||
opt = {};
|
||||
}
|
||||
if (typeof opt.cwd !== 'string') {
|
||||
opt.cwd = process.cwd();
|
||||
}
|
||||
if (typeof opt.dot !== 'boolean') {
|
||||
opt.dot = false;
|
||||
}
|
||||
if (typeof opt.silent !== 'boolean') {
|
||||
opt.silent = true;
|
||||
}
|
||||
if (typeof opt.nonull !== 'boolean') {
|
||||
opt.nonull = false;
|
||||
}
|
||||
if (typeof opt.cwdbase !== 'boolean') {
|
||||
opt.cwdbase = false;
|
||||
}
|
||||
if (opt.cwdbase) {
|
||||
opt.base = opt.cwd;
|
||||
}
|
||||
|
||||
// Only one glob no need to aggregate
|
||||
if (!Array.isArray(globs)) {
|
||||
globs = [globs];
|
||||
}
|
||||
|
||||
var positives = [];
|
||||
var negatives = [];
|
||||
|
||||
var ourOpt = extend({}, opt);
|
||||
delete ourOpt.root;
|
||||
|
||||
globs.forEach(function(glob, index) {
|
||||
if (typeof glob !== 'string' && !(glob instanceof RegExp)) {
|
||||
throw new Error('Invalid glob at index ' + index);
|
||||
}
|
||||
|
||||
var globArray = isNegative(glob) ? negatives : positives;
|
||||
|
||||
// Create Minimatch instances for negative glob patterns
|
||||
if (globArray === negatives && typeof glob === 'string') {
|
||||
var ourGlob = resolveGlob(glob, opt);
|
||||
glob = micromatch.matcher(ourGlob, ourOpt);
|
||||
}
|
||||
|
||||
globArray.push({
|
||||
index: index,
|
||||
glob: glob,
|
||||
});
|
||||
});
|
||||
|
||||
if (positives.length === 0) {
|
||||
throw new Error('Missing positive glob');
|
||||
}
|
||||
|
||||
// Only one positive glob no need to aggregate
|
||||
if (positives.length === 1) {
|
||||
return streamFromPositive(positives[0]);
|
||||
}
|
||||
|
||||
// Create all individual streams
|
||||
var streams = positives.map(streamFromPositive);
|
||||
|
||||
// Then just pipe them to a single unique stream and return it
|
||||
var aggregate = new Combine(streams);
|
||||
var uniqueStream = unique('path');
|
||||
var returnStream = aggregate.pipe(uniqueStream);
|
||||
|
||||
aggregate.on('error', function(err) {
|
||||
returnStream.emit('error', err);
|
||||
});
|
||||
|
||||
return returnStream;
|
||||
|
||||
function streamFromPositive(positive) {
|
||||
var negativeGlobs = negatives.filter(indexGreaterThan(positive.index))
|
||||
.map(toGlob);
|
||||
return gs.createStream(positive.glob, negativeGlobs, opt);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
function isMatch(file, matcher) {
|
||||
if (typeof matcher === 'function') {
|
||||
return matcher(file.path);
|
||||
}
|
||||
if (matcher instanceof RegExp) {
|
||||
return matcher.test(file.path);
|
||||
}
|
||||
}
|
||||
|
||||
function isNegative(pattern) {
|
||||
if (typeof pattern === 'string') {
|
||||
return pattern[0] === '!';
|
||||
}
|
||||
if (pattern instanceof RegExp) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function indexGreaterThan(index) {
|
||||
return function(obj) {
|
||||
return obj.index > index;
|
||||
};
|
||||
}
|
||||
|
||||
function toGlob(obj) {
|
||||
return obj.glob;
|
||||
}
|
||||
|
||||
function globIsSingular(glob) {
|
||||
var globSet = glob.minimatch.set;
|
||||
|
||||
if (globSet.length !== 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return globSet[0].every(function isString(value) {
|
||||
return typeof value === 'string';
|
||||
});
|
||||
}
|
||||
|
||||
function getBasePath(ourGlob, opt) {
|
||||
var basePath;
|
||||
var parent = globParent(ourGlob);
|
||||
|
||||
if (parent === '/' && opt && opt.root) {
|
||||
basePath = path.normalize(opt.root);
|
||||
} else {
|
||||
basePath = resolveGlob(parent, opt);
|
||||
}
|
||||
|
||||
if (!sepRe.test(basePath.charAt(basePath.length - 1))) {
|
||||
basePath += path.sep;
|
||||
}
|
||||
return basePath;
|
||||
}
|
||||
|
||||
module.exports = gs;
|
||||
5
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/.npmignore
generated
vendored
Normal file
5
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
build/
|
||||
test/
|
||||
examples/
|
||||
fs.js
|
||||
zlib.js
|
||||
18
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/LICENSE
generated
vendored
Normal file
18
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
||||
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.
|
||||
15
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/README.md
generated
vendored
Normal file
15
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/README.md
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
# readable-stream
|
||||
|
||||
***Node-core streams for userland***
|
||||
|
||||
[](https://nodei.co/npm/readable-stream/)
|
||||
[](https://nodei.co/npm/readable-stream/)
|
||||
|
||||
This package is a mirror of the Streams2 and Streams3 implementations in Node-core.
|
||||
|
||||
If you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core.
|
||||
|
||||
**readable-stream** comes in two major versions, v1.0.x and v1.1.x. The former tracks the Streams2 implementation in Node 0.10, including bug-fixes and minor improvements as they are added. The latter tracks Streams3 as it develops in Node 0.11; we will likely see a v1.2.x branch for Node 0.12.
|
||||
|
||||
**readable-stream** uses proper patch-level versioning so if you pin to `"~1.0.0"` you’ll get the latest Node 0.10 Streams2 implementation, including any fixes and minor non-breaking improvements. The patch-level versions of 1.0.x and 1.1.x should mirror the patch-level versions of Node-core releases. You should prefer the **1.0.x** releases for now and when you’re ready to start using Streams3, pin to `"~1.1.0"`
|
||||
|
||||
1
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/duplex.js
generated
vendored
Normal file
1
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/duplex.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = require("./lib/_stream_duplex.js")
|
||||
89
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/lib/_stream_duplex.js
generated
vendored
Normal file
89
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/lib/_stream_duplex.js
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
// Copyright Joyent, Inc. and other Node 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, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// a duplex stream is just a stream that is both readable and writable.
|
||||
// Since JS doesn't have multiple prototypal inheritance, this class
|
||||
// prototypally inherits from Readable, and then parasitically from
|
||||
// Writable.
|
||||
|
||||
module.exports = Duplex;
|
||||
|
||||
/*<replacement>*/
|
||||
var objectKeys = Object.keys || function (obj) {
|
||||
var keys = [];
|
||||
for (var key in obj) keys.push(key);
|
||||
return keys;
|
||||
}
|
||||
/*</replacement>*/
|
||||
|
||||
|
||||
/*<replacement>*/
|
||||
var util = require('core-util-is');
|
||||
util.inherits = require('inherits');
|
||||
/*</replacement>*/
|
||||
|
||||
var Readable = require('./_stream_readable');
|
||||
var Writable = require('./_stream_writable');
|
||||
|
||||
util.inherits(Duplex, Readable);
|
||||
|
||||
forEach(objectKeys(Writable.prototype), function(method) {
|
||||
if (!Duplex.prototype[method])
|
||||
Duplex.prototype[method] = Writable.prototype[method];
|
||||
});
|
||||
|
||||
function Duplex(options) {
|
||||
if (!(this instanceof Duplex))
|
||||
return new Duplex(options);
|
||||
|
||||
Readable.call(this, options);
|
||||
Writable.call(this, options);
|
||||
|
||||
if (options && options.readable === false)
|
||||
this.readable = false;
|
||||
|
||||
if (options && options.writable === false)
|
||||
this.writable = false;
|
||||
|
||||
this.allowHalfOpen = true;
|
||||
if (options && options.allowHalfOpen === false)
|
||||
this.allowHalfOpen = false;
|
||||
|
||||
this.once('end', onend);
|
||||
}
|
||||
|
||||
// the no-half-open enforcer
|
||||
function onend() {
|
||||
// if we allow half-open state, or if the writable side ended,
|
||||
// then we're ok.
|
||||
if (this.allowHalfOpen || this._writableState.ended)
|
||||
return;
|
||||
|
||||
// no more data can be written.
|
||||
// But allow more writes to happen in this tick.
|
||||
process.nextTick(this.end.bind(this));
|
||||
}
|
||||
|
||||
function forEach (xs, f) {
|
||||
for (var i = 0, l = xs.length; i < l; i++) {
|
||||
f(xs[i], i);
|
||||
}
|
||||
}
|
||||
46
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/lib/_stream_passthrough.js
generated
vendored
Normal file
46
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/lib/_stream_passthrough.js
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
// Copyright Joyent, Inc. and other Node 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, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// a passthrough stream.
|
||||
// basically just the most minimal sort of Transform stream.
|
||||
// Every written chunk gets output as-is.
|
||||
|
||||
module.exports = PassThrough;
|
||||
|
||||
var Transform = require('./_stream_transform');
|
||||
|
||||
/*<replacement>*/
|
||||
var util = require('core-util-is');
|
||||
util.inherits = require('inherits');
|
||||
/*</replacement>*/
|
||||
|
||||
util.inherits(PassThrough, Transform);
|
||||
|
||||
function PassThrough(options) {
|
||||
if (!(this instanceof PassThrough))
|
||||
return new PassThrough(options);
|
||||
|
||||
Transform.call(this, options);
|
||||
}
|
||||
|
||||
PassThrough.prototype._transform = function(chunk, encoding, cb) {
|
||||
cb(null, chunk);
|
||||
};
|
||||
982
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/lib/_stream_readable.js
generated
vendored
Normal file
982
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/lib/_stream_readable.js
generated
vendored
Normal file
@@ -0,0 +1,982 @@
|
||||
// Copyright Joyent, Inc. and other Node 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, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
module.exports = Readable;
|
||||
|
||||
/*<replacement>*/
|
||||
var isArray = require('isarray');
|
||||
/*</replacement>*/
|
||||
|
||||
|
||||
/*<replacement>*/
|
||||
var Buffer = require('buffer').Buffer;
|
||||
/*</replacement>*/
|
||||
|
||||
Readable.ReadableState = ReadableState;
|
||||
|
||||
var EE = require('events').EventEmitter;
|
||||
|
||||
/*<replacement>*/
|
||||
if (!EE.listenerCount) EE.listenerCount = function(emitter, type) {
|
||||
return emitter.listeners(type).length;
|
||||
};
|
||||
/*</replacement>*/
|
||||
|
||||
var Stream = require('stream');
|
||||
|
||||
/*<replacement>*/
|
||||
var util = require('core-util-is');
|
||||
util.inherits = require('inherits');
|
||||
/*</replacement>*/
|
||||
|
||||
var StringDecoder;
|
||||
|
||||
util.inherits(Readable, Stream);
|
||||
|
||||
function ReadableState(options, stream) {
|
||||
options = options || {};
|
||||
|
||||
// the point at which it stops calling _read() to fill the buffer
|
||||
// Note: 0 is a valid value, means "don't call _read preemptively ever"
|
||||
var hwm = options.highWaterMark;
|
||||
this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024;
|
||||
|
||||
// cast to ints.
|
||||
this.highWaterMark = ~~this.highWaterMark;
|
||||
|
||||
this.buffer = [];
|
||||
this.length = 0;
|
||||
this.pipes = null;
|
||||
this.pipesCount = 0;
|
||||
this.flowing = false;
|
||||
this.ended = false;
|
||||
this.endEmitted = false;
|
||||
this.reading = false;
|
||||
|
||||
// In streams that never have any data, and do push(null) right away,
|
||||
// the consumer can miss the 'end' event if they do some I/O before
|
||||
// consuming the stream. So, we don't emit('end') until some reading
|
||||
// happens.
|
||||
this.calledRead = false;
|
||||
|
||||
// a flag to be able to tell if the onwrite cb is called immediately,
|
||||
// or on a later tick. We set this to true at first, becuase any
|
||||
// actions that shouldn't happen until "later" should generally also
|
||||
// not happen before the first write call.
|
||||
this.sync = true;
|
||||
|
||||
// whenever we return null, then we set a flag to say
|
||||
// that we're awaiting a 'readable' event emission.
|
||||
this.needReadable = false;
|
||||
this.emittedReadable = false;
|
||||
this.readableListening = false;
|
||||
|
||||
|
||||
// object stream flag. Used to make read(n) ignore n and to
|
||||
// make all the buffer merging and length checks go away
|
||||
this.objectMode = !!options.objectMode;
|
||||
|
||||
// Crypto is kind of old and crusty. Historically, its default string
|
||||
// encoding is 'binary' so we have to make this configurable.
|
||||
// Everything else in the universe uses 'utf8', though.
|
||||
this.defaultEncoding = options.defaultEncoding || 'utf8';
|
||||
|
||||
// when piping, we only care about 'readable' events that happen
|
||||
// after read()ing all the bytes and not getting any pushback.
|
||||
this.ranOut = false;
|
||||
|
||||
// the number of writers that are awaiting a drain event in .pipe()s
|
||||
this.awaitDrain = 0;
|
||||
|
||||
// if true, a maybeReadMore has been scheduled
|
||||
this.readingMore = false;
|
||||
|
||||
this.decoder = null;
|
||||
this.encoding = null;
|
||||
if (options.encoding) {
|
||||
if (!StringDecoder)
|
||||
StringDecoder = require('string_decoder/').StringDecoder;
|
||||
this.decoder = new StringDecoder(options.encoding);
|
||||
this.encoding = options.encoding;
|
||||
}
|
||||
}
|
||||
|
||||
function Readable(options) {
|
||||
if (!(this instanceof Readable))
|
||||
return new Readable(options);
|
||||
|
||||
this._readableState = new ReadableState(options, this);
|
||||
|
||||
// legacy
|
||||
this.readable = true;
|
||||
|
||||
Stream.call(this);
|
||||
}
|
||||
|
||||
// Manually shove something into the read() buffer.
|
||||
// This returns true if the highWaterMark has not been hit yet,
|
||||
// similar to how Writable.write() returns true if you should
|
||||
// write() some more.
|
||||
Readable.prototype.push = function(chunk, encoding) {
|
||||
var state = this._readableState;
|
||||
|
||||
if (typeof chunk === 'string' && !state.objectMode) {
|
||||
encoding = encoding || state.defaultEncoding;
|
||||
if (encoding !== state.encoding) {
|
||||
chunk = new Buffer(chunk, encoding);
|
||||
encoding = '';
|
||||
}
|
||||
}
|
||||
|
||||
return readableAddChunk(this, state, chunk, encoding, false);
|
||||
};
|
||||
|
||||
// Unshift should *always* be something directly out of read()
|
||||
Readable.prototype.unshift = function(chunk) {
|
||||
var state = this._readableState;
|
||||
return readableAddChunk(this, state, chunk, '', true);
|
||||
};
|
||||
|
||||
function readableAddChunk(stream, state, chunk, encoding, addToFront) {
|
||||
var er = chunkInvalid(state, chunk);
|
||||
if (er) {
|
||||
stream.emit('error', er);
|
||||
} else if (chunk === null || chunk === undefined) {
|
||||
state.reading = false;
|
||||
if (!state.ended)
|
||||
onEofChunk(stream, state);
|
||||
} else if (state.objectMode || chunk && chunk.length > 0) {
|
||||
if (state.ended && !addToFront) {
|
||||
var e = new Error('stream.push() after EOF');
|
||||
stream.emit('error', e);
|
||||
} else if (state.endEmitted && addToFront) {
|
||||
var e = new Error('stream.unshift() after end event');
|
||||
stream.emit('error', e);
|
||||
} else {
|
||||
if (state.decoder && !addToFront && !encoding)
|
||||
chunk = state.decoder.write(chunk);
|
||||
|
||||
// update the buffer info.
|
||||
state.length += state.objectMode ? 1 : chunk.length;
|
||||
if (addToFront) {
|
||||
state.buffer.unshift(chunk);
|
||||
} else {
|
||||
state.reading = false;
|
||||
state.buffer.push(chunk);
|
||||
}
|
||||
|
||||
if (state.needReadable)
|
||||
emitReadable(stream);
|
||||
|
||||
maybeReadMore(stream, state);
|
||||
}
|
||||
} else if (!addToFront) {
|
||||
state.reading = false;
|
||||
}
|
||||
|
||||
return needMoreData(state);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// if it's past the high water mark, we can push in some more.
|
||||
// Also, if we have no data yet, we can stand some
|
||||
// more bytes. This is to work around cases where hwm=0,
|
||||
// such as the repl. Also, if the push() triggered a
|
||||
// readable event, and the user called read(largeNumber) such that
|
||||
// needReadable was set, then we ought to push more, so that another
|
||||
// 'readable' event will be triggered.
|
||||
function needMoreData(state) {
|
||||
return !state.ended &&
|
||||
(state.needReadable ||
|
||||
state.length < state.highWaterMark ||
|
||||
state.length === 0);
|
||||
}
|
||||
|
||||
// backwards compatibility.
|
||||
Readable.prototype.setEncoding = function(enc) {
|
||||
if (!StringDecoder)
|
||||
StringDecoder = require('string_decoder/').StringDecoder;
|
||||
this._readableState.decoder = new StringDecoder(enc);
|
||||
this._readableState.encoding = enc;
|
||||
};
|
||||
|
||||
// Don't raise the hwm > 128MB
|
||||
var MAX_HWM = 0x800000;
|
||||
function roundUpToNextPowerOf2(n) {
|
||||
if (n >= MAX_HWM) {
|
||||
n = MAX_HWM;
|
||||
} else {
|
||||
// Get the next highest power of 2
|
||||
n--;
|
||||
for (var p = 1; p < 32; p <<= 1) n |= n >> p;
|
||||
n++;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
function howMuchToRead(n, state) {
|
||||
if (state.length === 0 && state.ended)
|
||||
return 0;
|
||||
|
||||
if (state.objectMode)
|
||||
return n === 0 ? 0 : 1;
|
||||
|
||||
if (n === null || isNaN(n)) {
|
||||
// only flow one buffer at a time
|
||||
if (state.flowing && state.buffer.length)
|
||||
return state.buffer[0].length;
|
||||
else
|
||||
return state.length;
|
||||
}
|
||||
|
||||
if (n <= 0)
|
||||
return 0;
|
||||
|
||||
// If we're asking for more than the target buffer level,
|
||||
// then raise the water mark. Bump up to the next highest
|
||||
// power of 2, to prevent increasing it excessively in tiny
|
||||
// amounts.
|
||||
if (n > state.highWaterMark)
|
||||
state.highWaterMark = roundUpToNextPowerOf2(n);
|
||||
|
||||
// don't have that much. return null, unless we've ended.
|
||||
if (n > state.length) {
|
||||
if (!state.ended) {
|
||||
state.needReadable = true;
|
||||
return 0;
|
||||
} else
|
||||
return state.length;
|
||||
}
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
// you can override either this method, or the async _read(n) below.
|
||||
Readable.prototype.read = function(n) {
|
||||
var state = this._readableState;
|
||||
state.calledRead = true;
|
||||
var nOrig = n;
|
||||
var ret;
|
||||
|
||||
if (typeof n !== 'number' || n > 0)
|
||||
state.emittedReadable = false;
|
||||
|
||||
// if we're doing read(0) to trigger a readable event, but we
|
||||
// already have a bunch of data in the buffer, then just trigger
|
||||
// the 'readable' event and move on.
|
||||
if (n === 0 &&
|
||||
state.needReadable &&
|
||||
(state.length >= state.highWaterMark || state.ended)) {
|
||||
emitReadable(this);
|
||||
return null;
|
||||
}
|
||||
|
||||
n = howMuchToRead(n, state);
|
||||
|
||||
// if we've ended, and we're now clear, then finish it up.
|
||||
if (n === 0 && state.ended) {
|
||||
ret = null;
|
||||
|
||||
// In cases where the decoder did not receive enough data
|
||||
// to produce a full chunk, then immediately received an
|
||||
// EOF, state.buffer will contain [<Buffer >, <Buffer 00 ...>].
|
||||
// howMuchToRead will see this and coerce the amount to
|
||||
// read to zero (because it's looking at the length of the
|
||||
// first <Buffer > in state.buffer), and we'll end up here.
|
||||
//
|
||||
// This can only happen via state.decoder -- no other venue
|
||||
// exists for pushing a zero-length chunk into state.buffer
|
||||
// and triggering this behavior. In this case, we return our
|
||||
// remaining data and end the stream, if appropriate.
|
||||
if (state.length > 0 && state.decoder) {
|
||||
ret = fromList(n, state);
|
||||
state.length -= ret.length;
|
||||
}
|
||||
|
||||
if (state.length === 0)
|
||||
endReadable(this);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// All the actual chunk generation logic needs to be
|
||||
// *below* the call to _read. The reason is that in certain
|
||||
// synthetic stream cases, such as passthrough streams, _read
|
||||
// may be a completely synchronous operation which may change
|
||||
// the state of the read buffer, providing enough data when
|
||||
// before there was *not* enough.
|
||||
//
|
||||
// So, the steps are:
|
||||
// 1. Figure out what the state of things will be after we do
|
||||
// a read from the buffer.
|
||||
//
|
||||
// 2. If that resulting state will trigger a _read, then call _read.
|
||||
// Note that this may be asynchronous, or synchronous. Yes, it is
|
||||
// deeply ugly to write APIs this way, but that still doesn't mean
|
||||
// that the Readable class should behave improperly, as streams are
|
||||
// designed to be sync/async agnostic.
|
||||
// Take note if the _read call is sync or async (ie, if the read call
|
||||
// has returned yet), so that we know whether or not it's safe to emit
|
||||
// 'readable' etc.
|
||||
//
|
||||
// 3. Actually pull the requested chunks out of the buffer and return.
|
||||
|
||||
// if we need a readable event, then we need to do some reading.
|
||||
var doRead = state.needReadable;
|
||||
|
||||
// if we currently have less than the highWaterMark, then also read some
|
||||
if (state.length - n <= state.highWaterMark)
|
||||
doRead = true;
|
||||
|
||||
// however, if we've ended, then there's no point, and if we're already
|
||||
// reading, then it's unnecessary.
|
||||
if (state.ended || state.reading)
|
||||
doRead = false;
|
||||
|
||||
if (doRead) {
|
||||
state.reading = true;
|
||||
state.sync = true;
|
||||
// if the length is currently zero, then we *need* a readable event.
|
||||
if (state.length === 0)
|
||||
state.needReadable = true;
|
||||
// call internal read method
|
||||
this._read(state.highWaterMark);
|
||||
state.sync = false;
|
||||
}
|
||||
|
||||
// If _read called its callback synchronously, then `reading`
|
||||
// will be false, and we need to re-evaluate how much data we
|
||||
// can return to the user.
|
||||
if (doRead && !state.reading)
|
||||
n = howMuchToRead(nOrig, state);
|
||||
|
||||
if (n > 0)
|
||||
ret = fromList(n, state);
|
||||
else
|
||||
ret = null;
|
||||
|
||||
if (ret === null) {
|
||||
state.needReadable = true;
|
||||
n = 0;
|
||||
}
|
||||
|
||||
state.length -= n;
|
||||
|
||||
// If we have nothing in the buffer, then we want to know
|
||||
// as soon as we *do* get something into the buffer.
|
||||
if (state.length === 0 && !state.ended)
|
||||
state.needReadable = true;
|
||||
|
||||
// If we happened to read() exactly the remaining amount in the
|
||||
// buffer, and the EOF has been seen at this point, then make sure
|
||||
// that we emit 'end' on the very next tick.
|
||||
if (state.ended && !state.endEmitted && state.length === 0)
|
||||
endReadable(this);
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
||||
function chunkInvalid(state, chunk) {
|
||||
var er = null;
|
||||
if (!Buffer.isBuffer(chunk) &&
|
||||
'string' !== typeof chunk &&
|
||||
chunk !== null &&
|
||||
chunk !== undefined &&
|
||||
!state.objectMode) {
|
||||
er = new TypeError('Invalid non-string/buffer chunk');
|
||||
}
|
||||
return er;
|
||||
}
|
||||
|
||||
|
||||
function onEofChunk(stream, state) {
|
||||
if (state.decoder && !state.ended) {
|
||||
var chunk = state.decoder.end();
|
||||
if (chunk && chunk.length) {
|
||||
state.buffer.push(chunk);
|
||||
state.length += state.objectMode ? 1 : chunk.length;
|
||||
}
|
||||
}
|
||||
state.ended = true;
|
||||
|
||||
// if we've ended and we have some data left, then emit
|
||||
// 'readable' now to make sure it gets picked up.
|
||||
if (state.length > 0)
|
||||
emitReadable(stream);
|
||||
else
|
||||
endReadable(stream);
|
||||
}
|
||||
|
||||
// Don't emit readable right away in sync mode, because this can trigger
|
||||
// another read() call => stack overflow. This way, it might trigger
|
||||
// a nextTick recursion warning, but that's not so bad.
|
||||
function emitReadable(stream) {
|
||||
var state = stream._readableState;
|
||||
state.needReadable = false;
|
||||
if (state.emittedReadable)
|
||||
return;
|
||||
|
||||
state.emittedReadable = true;
|
||||
if (state.sync)
|
||||
process.nextTick(function() {
|
||||
emitReadable_(stream);
|
||||
});
|
||||
else
|
||||
emitReadable_(stream);
|
||||
}
|
||||
|
||||
function emitReadable_(stream) {
|
||||
stream.emit('readable');
|
||||
}
|
||||
|
||||
|
||||
// at this point, the user has presumably seen the 'readable' event,
|
||||
// and called read() to consume some data. that may have triggered
|
||||
// in turn another _read(n) call, in which case reading = true if
|
||||
// it's in progress.
|
||||
// However, if we're not ended, or reading, and the length < hwm,
|
||||
// then go ahead and try to read some more preemptively.
|
||||
function maybeReadMore(stream, state) {
|
||||
if (!state.readingMore) {
|
||||
state.readingMore = true;
|
||||
process.nextTick(function() {
|
||||
maybeReadMore_(stream, state);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function maybeReadMore_(stream, state) {
|
||||
var len = state.length;
|
||||
while (!state.reading && !state.flowing && !state.ended &&
|
||||
state.length < state.highWaterMark) {
|
||||
stream.read(0);
|
||||
if (len === state.length)
|
||||
// didn't get any data, stop spinning.
|
||||
break;
|
||||
else
|
||||
len = state.length;
|
||||
}
|
||||
state.readingMore = false;
|
||||
}
|
||||
|
||||
// abstract method. to be overridden in specific implementation classes.
|
||||
// call cb(er, data) where data is <= n in length.
|
||||
// for virtual (non-string, non-buffer) streams, "length" is somewhat
|
||||
// arbitrary, and perhaps not very meaningful.
|
||||
Readable.prototype._read = function(n) {
|
||||
this.emit('error', new Error('not implemented'));
|
||||
};
|
||||
|
||||
Readable.prototype.pipe = function(dest, pipeOpts) {
|
||||
var src = this;
|
||||
var state = this._readableState;
|
||||
|
||||
switch (state.pipesCount) {
|
||||
case 0:
|
||||
state.pipes = dest;
|
||||
break;
|
||||
case 1:
|
||||
state.pipes = [state.pipes, dest];
|
||||
break;
|
||||
default:
|
||||
state.pipes.push(dest);
|
||||
break;
|
||||
}
|
||||
state.pipesCount += 1;
|
||||
|
||||
var doEnd = (!pipeOpts || pipeOpts.end !== false) &&
|
||||
dest !== process.stdout &&
|
||||
dest !== process.stderr;
|
||||
|
||||
var endFn = doEnd ? onend : cleanup;
|
||||
if (state.endEmitted)
|
||||
process.nextTick(endFn);
|
||||
else
|
||||
src.once('end', endFn);
|
||||
|
||||
dest.on('unpipe', onunpipe);
|
||||
function onunpipe(readable) {
|
||||
if (readable !== src) return;
|
||||
cleanup();
|
||||
}
|
||||
|
||||
function onend() {
|
||||
dest.end();
|
||||
}
|
||||
|
||||
// when the dest drains, it reduces the awaitDrain counter
|
||||
// on the source. This would be more elegant with a .once()
|
||||
// handler in flow(), but adding and removing repeatedly is
|
||||
// too slow.
|
||||
var ondrain = pipeOnDrain(src);
|
||||
dest.on('drain', ondrain);
|
||||
|
||||
function cleanup() {
|
||||
// cleanup event handlers once the pipe is broken
|
||||
dest.removeListener('close', onclose);
|
||||
dest.removeListener('finish', onfinish);
|
||||
dest.removeListener('drain', ondrain);
|
||||
dest.removeListener('error', onerror);
|
||||
dest.removeListener('unpipe', onunpipe);
|
||||
src.removeListener('end', onend);
|
||||
src.removeListener('end', cleanup);
|
||||
|
||||
// if the reader is waiting for a drain event from this
|
||||
// specific writer, then it would cause it to never start
|
||||
// flowing again.
|
||||
// So, if this is awaiting a drain, then we just call it now.
|
||||
// If we don't know, then assume that we are waiting for one.
|
||||
if (!dest._writableState || dest._writableState.needDrain)
|
||||
ondrain();
|
||||
}
|
||||
|
||||
// if the dest has an error, then stop piping into it.
|
||||
// however, don't suppress the throwing behavior for this.
|
||||
function onerror(er) {
|
||||
unpipe();
|
||||
dest.removeListener('error', onerror);
|
||||
if (EE.listenerCount(dest, 'error') === 0)
|
||||
dest.emit('error', er);
|
||||
}
|
||||
// This is a brutally ugly hack to make sure that our error handler
|
||||
// is attached before any userland ones. NEVER DO THIS.
|
||||
if (!dest._events || !dest._events.error)
|
||||
dest.on('error', onerror);
|
||||
else if (isArray(dest._events.error))
|
||||
dest._events.error.unshift(onerror);
|
||||
else
|
||||
dest._events.error = [onerror, dest._events.error];
|
||||
|
||||
|
||||
|
||||
// Both close and finish should trigger unpipe, but only once.
|
||||
function onclose() {
|
||||
dest.removeListener('finish', onfinish);
|
||||
unpipe();
|
||||
}
|
||||
dest.once('close', onclose);
|
||||
function onfinish() {
|
||||
dest.removeListener('close', onclose);
|
||||
unpipe();
|
||||
}
|
||||
dest.once('finish', onfinish);
|
||||
|
||||
function unpipe() {
|
||||
src.unpipe(dest);
|
||||
}
|
||||
|
||||
// tell the dest that it's being piped to
|
||||
dest.emit('pipe', src);
|
||||
|
||||
// start the flow if it hasn't been started already.
|
||||
if (!state.flowing) {
|
||||
// the handler that waits for readable events after all
|
||||
// the data gets sucked out in flow.
|
||||
// This would be easier to follow with a .once() handler
|
||||
// in flow(), but that is too slow.
|
||||
this.on('readable', pipeOnReadable);
|
||||
|
||||
state.flowing = true;
|
||||
process.nextTick(function() {
|
||||
flow(src);
|
||||
});
|
||||
}
|
||||
|
||||
return dest;
|
||||
};
|
||||
|
||||
function pipeOnDrain(src) {
|
||||
return function() {
|
||||
var dest = this;
|
||||
var state = src._readableState;
|
||||
state.awaitDrain--;
|
||||
if (state.awaitDrain === 0)
|
||||
flow(src);
|
||||
};
|
||||
}
|
||||
|
||||
function flow(src) {
|
||||
var state = src._readableState;
|
||||
var chunk;
|
||||
state.awaitDrain = 0;
|
||||
|
||||
function write(dest, i, list) {
|
||||
var written = dest.write(chunk);
|
||||
if (false === written) {
|
||||
state.awaitDrain++;
|
||||
}
|
||||
}
|
||||
|
||||
while (state.pipesCount && null !== (chunk = src.read())) {
|
||||
|
||||
if (state.pipesCount === 1)
|
||||
write(state.pipes, 0, null);
|
||||
else
|
||||
forEach(state.pipes, write);
|
||||
|
||||
src.emit('data', chunk);
|
||||
|
||||
// if anyone needs a drain, then we have to wait for that.
|
||||
if (state.awaitDrain > 0)
|
||||
return;
|
||||
}
|
||||
|
||||
// if every destination was unpiped, either before entering this
|
||||
// function, or in the while loop, then stop flowing.
|
||||
//
|
||||
// NB: This is a pretty rare edge case.
|
||||
if (state.pipesCount === 0) {
|
||||
state.flowing = false;
|
||||
|
||||
// if there were data event listeners added, then switch to old mode.
|
||||
if (EE.listenerCount(src, 'data') > 0)
|
||||
emitDataEvents(src);
|
||||
return;
|
||||
}
|
||||
|
||||
// at this point, no one needed a drain, so we just ran out of data
|
||||
// on the next readable event, start it over again.
|
||||
state.ranOut = true;
|
||||
}
|
||||
|
||||
function pipeOnReadable() {
|
||||
if (this._readableState.ranOut) {
|
||||
this._readableState.ranOut = false;
|
||||
flow(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Readable.prototype.unpipe = function(dest) {
|
||||
var state = this._readableState;
|
||||
|
||||
// if we're not piping anywhere, then do nothing.
|
||||
if (state.pipesCount === 0)
|
||||
return this;
|
||||
|
||||
// just one destination. most common case.
|
||||
if (state.pipesCount === 1) {
|
||||
// passed in one, but it's not the right one.
|
||||
if (dest && dest !== state.pipes)
|
||||
return this;
|
||||
|
||||
if (!dest)
|
||||
dest = state.pipes;
|
||||
|
||||
// got a match.
|
||||
state.pipes = null;
|
||||
state.pipesCount = 0;
|
||||
this.removeListener('readable', pipeOnReadable);
|
||||
state.flowing = false;
|
||||
if (dest)
|
||||
dest.emit('unpipe', this);
|
||||
return this;
|
||||
}
|
||||
|
||||
// slow case. multiple pipe destinations.
|
||||
|
||||
if (!dest) {
|
||||
// remove all.
|
||||
var dests = state.pipes;
|
||||
var len = state.pipesCount;
|
||||
state.pipes = null;
|
||||
state.pipesCount = 0;
|
||||
this.removeListener('readable', pipeOnReadable);
|
||||
state.flowing = false;
|
||||
|
||||
for (var i = 0; i < len; i++)
|
||||
dests[i].emit('unpipe', this);
|
||||
return this;
|
||||
}
|
||||
|
||||
// try to find the right one.
|
||||
var i = indexOf(state.pipes, dest);
|
||||
if (i === -1)
|
||||
return this;
|
||||
|
||||
state.pipes.splice(i, 1);
|
||||
state.pipesCount -= 1;
|
||||
if (state.pipesCount === 1)
|
||||
state.pipes = state.pipes[0];
|
||||
|
||||
dest.emit('unpipe', this);
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
// set up data events if they are asked for
|
||||
// Ensure readable listeners eventually get something
|
||||
Readable.prototype.on = function(ev, fn) {
|
||||
var res = Stream.prototype.on.call(this, ev, fn);
|
||||
|
||||
if (ev === 'data' && !this._readableState.flowing)
|
||||
emitDataEvents(this);
|
||||
|
||||
if (ev === 'readable' && this.readable) {
|
||||
var state = this._readableState;
|
||||
if (!state.readableListening) {
|
||||
state.readableListening = true;
|
||||
state.emittedReadable = false;
|
||||
state.needReadable = true;
|
||||
if (!state.reading) {
|
||||
this.read(0);
|
||||
} else if (state.length) {
|
||||
emitReadable(this, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
};
|
||||
Readable.prototype.addListener = Readable.prototype.on;
|
||||
|
||||
// pause() and resume() are remnants of the legacy readable stream API
|
||||
// If the user uses them, then switch into old mode.
|
||||
Readable.prototype.resume = function() {
|
||||
emitDataEvents(this);
|
||||
this.read(0);
|
||||
this.emit('resume');
|
||||
};
|
||||
|
||||
Readable.prototype.pause = function() {
|
||||
emitDataEvents(this, true);
|
||||
this.emit('pause');
|
||||
};
|
||||
|
||||
function emitDataEvents(stream, startPaused) {
|
||||
var state = stream._readableState;
|
||||
|
||||
if (state.flowing) {
|
||||
// https://github.com/isaacs/readable-stream/issues/16
|
||||
throw new Error('Cannot switch to old mode now.');
|
||||
}
|
||||
|
||||
var paused = startPaused || false;
|
||||
var readable = false;
|
||||
|
||||
// convert to an old-style stream.
|
||||
stream.readable = true;
|
||||
stream.pipe = Stream.prototype.pipe;
|
||||
stream.on = stream.addListener = Stream.prototype.on;
|
||||
|
||||
stream.on('readable', function() {
|
||||
readable = true;
|
||||
|
||||
var c;
|
||||
while (!paused && (null !== (c = stream.read())))
|
||||
stream.emit('data', c);
|
||||
|
||||
if (c === null) {
|
||||
readable = false;
|
||||
stream._readableState.needReadable = true;
|
||||
}
|
||||
});
|
||||
|
||||
stream.pause = function() {
|
||||
paused = true;
|
||||
this.emit('pause');
|
||||
};
|
||||
|
||||
stream.resume = function() {
|
||||
paused = false;
|
||||
if (readable)
|
||||
process.nextTick(function() {
|
||||
stream.emit('readable');
|
||||
});
|
||||
else
|
||||
this.read(0);
|
||||
this.emit('resume');
|
||||
};
|
||||
|
||||
// now make it start, just in case it hadn't already.
|
||||
stream.emit('readable');
|
||||
}
|
||||
|
||||
// wrap an old-style stream as the async data source.
|
||||
// This is *not* part of the readable stream interface.
|
||||
// It is an ugly unfortunate mess of history.
|
||||
Readable.prototype.wrap = function(stream) {
|
||||
var state = this._readableState;
|
||||
var paused = false;
|
||||
|
||||
var self = this;
|
||||
stream.on('end', function() {
|
||||
if (state.decoder && !state.ended) {
|
||||
var chunk = state.decoder.end();
|
||||
if (chunk && chunk.length)
|
||||
self.push(chunk);
|
||||
}
|
||||
|
||||
self.push(null);
|
||||
});
|
||||
|
||||
stream.on('data', function(chunk) {
|
||||
if (state.decoder)
|
||||
chunk = state.decoder.write(chunk);
|
||||
|
||||
// don't skip over falsy values in objectMode
|
||||
//if (state.objectMode && util.isNullOrUndefined(chunk))
|
||||
if (state.objectMode && (chunk === null || chunk === undefined))
|
||||
return;
|
||||
else if (!state.objectMode && (!chunk || !chunk.length))
|
||||
return;
|
||||
|
||||
var ret = self.push(chunk);
|
||||
if (!ret) {
|
||||
paused = true;
|
||||
stream.pause();
|
||||
}
|
||||
});
|
||||
|
||||
// proxy all the other methods.
|
||||
// important when wrapping filters and duplexes.
|
||||
for (var i in stream) {
|
||||
if (typeof stream[i] === 'function' &&
|
||||
typeof this[i] === 'undefined') {
|
||||
this[i] = function(method) { return function() {
|
||||
return stream[method].apply(stream, arguments);
|
||||
}}(i);
|
||||
}
|
||||
}
|
||||
|
||||
// proxy certain important events.
|
||||
var events = ['error', 'close', 'destroy', 'pause', 'resume'];
|
||||
forEach(events, function(ev) {
|
||||
stream.on(ev, self.emit.bind(self, ev));
|
||||
});
|
||||
|
||||
// when we try to consume some more bytes, simply unpause the
|
||||
// underlying stream.
|
||||
self._read = function(n) {
|
||||
if (paused) {
|
||||
paused = false;
|
||||
stream.resume();
|
||||
}
|
||||
};
|
||||
|
||||
return self;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// exposed for testing purposes only.
|
||||
Readable._fromList = fromList;
|
||||
|
||||
// Pluck off n bytes from an array of buffers.
|
||||
// Length is the combined lengths of all the buffers in the list.
|
||||
function fromList(n, state) {
|
||||
var list = state.buffer;
|
||||
var length = state.length;
|
||||
var stringMode = !!state.decoder;
|
||||
var objectMode = !!state.objectMode;
|
||||
var ret;
|
||||
|
||||
// nothing in the list, definitely empty.
|
||||
if (list.length === 0)
|
||||
return null;
|
||||
|
||||
if (length === 0)
|
||||
ret = null;
|
||||
else if (objectMode)
|
||||
ret = list.shift();
|
||||
else if (!n || n >= length) {
|
||||
// read it all, truncate the array.
|
||||
if (stringMode)
|
||||
ret = list.join('');
|
||||
else
|
||||
ret = Buffer.concat(list, length);
|
||||
list.length = 0;
|
||||
} else {
|
||||
// read just some of it.
|
||||
if (n < list[0].length) {
|
||||
// just take a part of the first list item.
|
||||
// slice is the same for buffers and strings.
|
||||
var buf = list[0];
|
||||
ret = buf.slice(0, n);
|
||||
list[0] = buf.slice(n);
|
||||
} else if (n === list[0].length) {
|
||||
// first list is a perfect match
|
||||
ret = list.shift();
|
||||
} else {
|
||||
// complex case.
|
||||
// we have enough to cover it, but it spans past the first buffer.
|
||||
if (stringMode)
|
||||
ret = '';
|
||||
else
|
||||
ret = new Buffer(n);
|
||||
|
||||
var c = 0;
|
||||
for (var i = 0, l = list.length; i < l && c < n; i++) {
|
||||
var buf = list[0];
|
||||
var cpy = Math.min(n - c, buf.length);
|
||||
|
||||
if (stringMode)
|
||||
ret += buf.slice(0, cpy);
|
||||
else
|
||||
buf.copy(ret, c, 0, cpy);
|
||||
|
||||
if (cpy < buf.length)
|
||||
list[0] = buf.slice(cpy);
|
||||
else
|
||||
list.shift();
|
||||
|
||||
c += cpy;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
function endReadable(stream) {
|
||||
var state = stream._readableState;
|
||||
|
||||
// If we get here before consuming all the bytes, then that is a
|
||||
// bug in node. Should never happen.
|
||||
if (state.length > 0)
|
||||
throw new Error('endReadable called on non-empty stream');
|
||||
|
||||
if (!state.endEmitted && state.calledRead) {
|
||||
state.ended = true;
|
||||
process.nextTick(function() {
|
||||
// Check that we didn't get one last unshift.
|
||||
if (!state.endEmitted && state.length === 0) {
|
||||
state.endEmitted = true;
|
||||
stream.readable = false;
|
||||
stream.emit('end');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function forEach (xs, f) {
|
||||
for (var i = 0, l = xs.length; i < l; i++) {
|
||||
f(xs[i], i);
|
||||
}
|
||||
}
|
||||
|
||||
function indexOf (xs, x) {
|
||||
for (var i = 0, l = xs.length; i < l; i++) {
|
||||
if (xs[i] === x) return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
210
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/lib/_stream_transform.js
generated
vendored
Normal file
210
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/lib/_stream_transform.js
generated
vendored
Normal file
@@ -0,0 +1,210 @@
|
||||
// Copyright Joyent, Inc. and other Node 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, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
// a transform stream is a readable/writable stream where you do
|
||||
// something with the data. Sometimes it's called a "filter",
|
||||
// but that's not a great name for it, since that implies a thing where
|
||||
// some bits pass through, and others are simply ignored. (That would
|
||||
// be a valid example of a transform, of course.)
|
||||
//
|
||||
// While the output is causally related to the input, it's not a
|
||||
// necessarily symmetric or synchronous transformation. For example,
|
||||
// a zlib stream might take multiple plain-text writes(), and then
|
||||
// emit a single compressed chunk some time in the future.
|
||||
//
|
||||
// Here's how this works:
|
||||
//
|
||||
// The Transform stream has all the aspects of the readable and writable
|
||||
// stream classes. When you write(chunk), that calls _write(chunk,cb)
|
||||
// internally, and returns false if there's a lot of pending writes
|
||||
// buffered up. When you call read(), that calls _read(n) until
|
||||
// there's enough pending readable data buffered up.
|
||||
//
|
||||
// In a transform stream, the written data is placed in a buffer. When
|
||||
// _read(n) is called, it transforms the queued up data, calling the
|
||||
// buffered _write cb's as it consumes chunks. If consuming a single
|
||||
// written chunk would result in multiple output chunks, then the first
|
||||
// outputted bit calls the readcb, and subsequent chunks just go into
|
||||
// the read buffer, and will cause it to emit 'readable' if necessary.
|
||||
//
|
||||
// This way, back-pressure is actually determined by the reading side,
|
||||
// since _read has to be called to start processing a new chunk. However,
|
||||
// a pathological inflate type of transform can cause excessive buffering
|
||||
// here. For example, imagine a stream where every byte of input is
|
||||
// interpreted as an integer from 0-255, and then results in that many
|
||||
// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
|
||||
// 1kb of data being output. In this case, you could write a very small
|
||||
// amount of input, and end up with a very large amount of output. In
|
||||
// such a pathological inflating mechanism, there'd be no way to tell
|
||||
// the system to stop doing the transform. A single 4MB write could
|
||||
// cause the system to run out of memory.
|
||||
//
|
||||
// However, even in such a pathological case, only a single written chunk
|
||||
// would be consumed, and then the rest would wait (un-transformed) until
|
||||
// the results of the previous transformed chunk were consumed.
|
||||
|
||||
module.exports = Transform;
|
||||
|
||||
var Duplex = require('./_stream_duplex');
|
||||
|
||||
/*<replacement>*/
|
||||
var util = require('core-util-is');
|
||||
util.inherits = require('inherits');
|
||||
/*</replacement>*/
|
||||
|
||||
util.inherits(Transform, Duplex);
|
||||
|
||||
|
||||
function TransformState(options, stream) {
|
||||
this.afterTransform = function(er, data) {
|
||||
return afterTransform(stream, er, data);
|
||||
};
|
||||
|
||||
this.needTransform = false;
|
||||
this.transforming = false;
|
||||
this.writecb = null;
|
||||
this.writechunk = null;
|
||||
}
|
||||
|
||||
function afterTransform(stream, er, data) {
|
||||
var ts = stream._transformState;
|
||||
ts.transforming = false;
|
||||
|
||||
var cb = ts.writecb;
|
||||
|
||||
if (!cb)
|
||||
return stream.emit('error', new Error('no writecb in Transform class'));
|
||||
|
||||
ts.writechunk = null;
|
||||
ts.writecb = null;
|
||||
|
||||
if (data !== null && data !== undefined)
|
||||
stream.push(data);
|
||||
|
||||
if (cb)
|
||||
cb(er);
|
||||
|
||||
var rs = stream._readableState;
|
||||
rs.reading = false;
|
||||
if (rs.needReadable || rs.length < rs.highWaterMark) {
|
||||
stream._read(rs.highWaterMark);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function Transform(options) {
|
||||
if (!(this instanceof Transform))
|
||||
return new Transform(options);
|
||||
|
||||
Duplex.call(this, options);
|
||||
|
||||
var ts = this._transformState = new TransformState(options, this);
|
||||
|
||||
// when the writable side finishes, then flush out anything remaining.
|
||||
var stream = this;
|
||||
|
||||
// start out asking for a readable event once data is transformed.
|
||||
this._readableState.needReadable = true;
|
||||
|
||||
// we have implemented the _read method, and done the other things
|
||||
// that Readable wants before the first _read call, so unset the
|
||||
// sync guard flag.
|
||||
this._readableState.sync = false;
|
||||
|
||||
this.once('finish', function() {
|
||||
if ('function' === typeof this._flush)
|
||||
this._flush(function(er) {
|
||||
done(stream, er);
|
||||
});
|
||||
else
|
||||
done(stream);
|
||||
});
|
||||
}
|
||||
|
||||
Transform.prototype.push = function(chunk, encoding) {
|
||||
this._transformState.needTransform = false;
|
||||
return Duplex.prototype.push.call(this, chunk, encoding);
|
||||
};
|
||||
|
||||
// This is the part where you do stuff!
|
||||
// override this function in implementation classes.
|
||||
// 'chunk' is an input chunk.
|
||||
//
|
||||
// Call `push(newChunk)` to pass along transformed output
|
||||
// to the readable side. You may call 'push' zero or more times.
|
||||
//
|
||||
// Call `cb(err)` when you are done with this chunk. If you pass
|
||||
// an error, then that'll put the hurt on the whole operation. If you
|
||||
// never call cb(), then you'll never get another chunk.
|
||||
Transform.prototype._transform = function(chunk, encoding, cb) {
|
||||
throw new Error('not implemented');
|
||||
};
|
||||
|
||||
Transform.prototype._write = function(chunk, encoding, cb) {
|
||||
var ts = this._transformState;
|
||||
ts.writecb = cb;
|
||||
ts.writechunk = chunk;
|
||||
ts.writeencoding = encoding;
|
||||
if (!ts.transforming) {
|
||||
var rs = this._readableState;
|
||||
if (ts.needTransform ||
|
||||
rs.needReadable ||
|
||||
rs.length < rs.highWaterMark)
|
||||
this._read(rs.highWaterMark);
|
||||
}
|
||||
};
|
||||
|
||||
// Doesn't matter what the args are here.
|
||||
// _transform does all the work.
|
||||
// That we got here means that the readable side wants more data.
|
||||
Transform.prototype._read = function(n) {
|
||||
var ts = this._transformState;
|
||||
|
||||
if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
|
||||
ts.transforming = true;
|
||||
this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
|
||||
} else {
|
||||
// mark that we need a transform, so that any data that comes in
|
||||
// will get processed, now that we've asked for it.
|
||||
ts.needTransform = true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
function done(stream, er) {
|
||||
if (er)
|
||||
return stream.emit('error', er);
|
||||
|
||||
// if there's nothing in the write buffer, then that means
|
||||
// that nothing more will ever be provided
|
||||
var ws = stream._writableState;
|
||||
var rs = stream._readableState;
|
||||
var ts = stream._transformState;
|
||||
|
||||
if (ws.length)
|
||||
throw new Error('calling transform done when ws.length != 0');
|
||||
|
||||
if (ts.transforming)
|
||||
throw new Error('calling transform done when still transforming');
|
||||
|
||||
return stream.push(null);
|
||||
}
|
||||
386
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/lib/_stream_writable.js
generated
vendored
Normal file
386
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/lib/_stream_writable.js
generated
vendored
Normal file
@@ -0,0 +1,386 @@
|
||||
// Copyright Joyent, Inc. and other Node 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, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// A bit simpler than readable streams.
|
||||
// Implement an async ._write(chunk, cb), and it'll handle all
|
||||
// the drain event emission and buffering.
|
||||
|
||||
module.exports = Writable;
|
||||
|
||||
/*<replacement>*/
|
||||
var Buffer = require('buffer').Buffer;
|
||||
/*</replacement>*/
|
||||
|
||||
Writable.WritableState = WritableState;
|
||||
|
||||
|
||||
/*<replacement>*/
|
||||
var util = require('core-util-is');
|
||||
util.inherits = require('inherits');
|
||||
/*</replacement>*/
|
||||
|
||||
var Stream = require('stream');
|
||||
|
||||
util.inherits(Writable, Stream);
|
||||
|
||||
function WriteReq(chunk, encoding, cb) {
|
||||
this.chunk = chunk;
|
||||
this.encoding = encoding;
|
||||
this.callback = cb;
|
||||
}
|
||||
|
||||
function WritableState(options, stream) {
|
||||
options = options || {};
|
||||
|
||||
// the point at which write() starts returning false
|
||||
// Note: 0 is a valid value, means that we always return false if
|
||||
// the entire buffer is not flushed immediately on write()
|
||||
var hwm = options.highWaterMark;
|
||||
this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024;
|
||||
|
||||
// object stream flag to indicate whether or not this stream
|
||||
// contains buffers or objects.
|
||||
this.objectMode = !!options.objectMode;
|
||||
|
||||
// cast to ints.
|
||||
this.highWaterMark = ~~this.highWaterMark;
|
||||
|
||||
this.needDrain = false;
|
||||
// at the start of calling end()
|
||||
this.ending = false;
|
||||
// when end() has been called, and returned
|
||||
this.ended = false;
|
||||
// when 'finish' is emitted
|
||||
this.finished = false;
|
||||
|
||||
// should we decode strings into buffers before passing to _write?
|
||||
// this is here so that some node-core streams can optimize string
|
||||
// handling at a lower level.
|
||||
var noDecode = options.decodeStrings === false;
|
||||
this.decodeStrings = !noDecode;
|
||||
|
||||
// Crypto is kind of old and crusty. Historically, its default string
|
||||
// encoding is 'binary' so we have to make this configurable.
|
||||
// Everything else in the universe uses 'utf8', though.
|
||||
this.defaultEncoding = options.defaultEncoding || 'utf8';
|
||||
|
||||
// not an actual buffer we keep track of, but a measurement
|
||||
// of how much we're waiting to get pushed to some underlying
|
||||
// socket or file.
|
||||
this.length = 0;
|
||||
|
||||
// a flag to see when we're in the middle of a write.
|
||||
this.writing = false;
|
||||
|
||||
// a flag to be able to tell if the onwrite cb is called immediately,
|
||||
// or on a later tick. We set this to true at first, becuase any
|
||||
// actions that shouldn't happen until "later" should generally also
|
||||
// not happen before the first write call.
|
||||
this.sync = true;
|
||||
|
||||
// a flag to know if we're processing previously buffered items, which
|
||||
// may call the _write() callback in the same tick, so that we don't
|
||||
// end up in an overlapped onwrite situation.
|
||||
this.bufferProcessing = false;
|
||||
|
||||
// the callback that's passed to _write(chunk,cb)
|
||||
this.onwrite = function(er) {
|
||||
onwrite(stream, er);
|
||||
};
|
||||
|
||||
// the callback that the user supplies to write(chunk,encoding,cb)
|
||||
this.writecb = null;
|
||||
|
||||
// the amount that is being written when _write is called.
|
||||
this.writelen = 0;
|
||||
|
||||
this.buffer = [];
|
||||
|
||||
// True if the error was already emitted and should not be thrown again
|
||||
this.errorEmitted = false;
|
||||
}
|
||||
|
||||
function Writable(options) {
|
||||
var Duplex = require('./_stream_duplex');
|
||||
|
||||
// Writable ctor is applied to Duplexes, though they're not
|
||||
// instanceof Writable, they're instanceof Readable.
|
||||
if (!(this instanceof Writable) && !(this instanceof Duplex))
|
||||
return new Writable(options);
|
||||
|
||||
this._writableState = new WritableState(options, this);
|
||||
|
||||
// legacy.
|
||||
this.writable = true;
|
||||
|
||||
Stream.call(this);
|
||||
}
|
||||
|
||||
// Otherwise people can pipe Writable streams, which is just wrong.
|
||||
Writable.prototype.pipe = function() {
|
||||
this.emit('error', new Error('Cannot pipe. Not readable.'));
|
||||
};
|
||||
|
||||
|
||||
function writeAfterEnd(stream, state, cb) {
|
||||
var er = new Error('write after end');
|
||||
// TODO: defer error events consistently everywhere, not just the cb
|
||||
stream.emit('error', er);
|
||||
process.nextTick(function() {
|
||||
cb(er);
|
||||
});
|
||||
}
|
||||
|
||||
// If we get something that is not a buffer, string, null, or undefined,
|
||||
// and we're not in objectMode, then that's an error.
|
||||
// Otherwise stream chunks are all considered to be of length=1, and the
|
||||
// watermarks determine how many objects to keep in the buffer, rather than
|
||||
// how many bytes or characters.
|
||||
function validChunk(stream, state, chunk, cb) {
|
||||
var valid = true;
|
||||
if (!Buffer.isBuffer(chunk) &&
|
||||
'string' !== typeof chunk &&
|
||||
chunk !== null &&
|
||||
chunk !== undefined &&
|
||||
!state.objectMode) {
|
||||
var er = new TypeError('Invalid non-string/buffer chunk');
|
||||
stream.emit('error', er);
|
||||
process.nextTick(function() {
|
||||
cb(er);
|
||||
});
|
||||
valid = false;
|
||||
}
|
||||
return valid;
|
||||
}
|
||||
|
||||
Writable.prototype.write = function(chunk, encoding, cb) {
|
||||
var state = this._writableState;
|
||||
var ret = false;
|
||||
|
||||
if (typeof encoding === 'function') {
|
||||
cb = encoding;
|
||||
encoding = null;
|
||||
}
|
||||
|
||||
if (Buffer.isBuffer(chunk))
|
||||
encoding = 'buffer';
|
||||
else if (!encoding)
|
||||
encoding = state.defaultEncoding;
|
||||
|
||||
if (typeof cb !== 'function')
|
||||
cb = function() {};
|
||||
|
||||
if (state.ended)
|
||||
writeAfterEnd(this, state, cb);
|
||||
else if (validChunk(this, state, chunk, cb))
|
||||
ret = writeOrBuffer(this, state, chunk, encoding, cb);
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
||||
function decodeChunk(state, chunk, encoding) {
|
||||
if (!state.objectMode &&
|
||||
state.decodeStrings !== false &&
|
||||
typeof chunk === 'string') {
|
||||
chunk = new Buffer(chunk, encoding);
|
||||
}
|
||||
return chunk;
|
||||
}
|
||||
|
||||
// if we're already writing something, then just put this
|
||||
// in the queue, and wait our turn. Otherwise, call _write
|
||||
// If we return false, then we need a drain event, so set that flag.
|
||||
function writeOrBuffer(stream, state, chunk, encoding, cb) {
|
||||
chunk = decodeChunk(state, chunk, encoding);
|
||||
if (Buffer.isBuffer(chunk))
|
||||
encoding = 'buffer';
|
||||
var len = state.objectMode ? 1 : chunk.length;
|
||||
|
||||
state.length += len;
|
||||
|
||||
var ret = state.length < state.highWaterMark;
|
||||
// we must ensure that previous needDrain will not be reset to false.
|
||||
if (!ret)
|
||||
state.needDrain = true;
|
||||
|
||||
if (state.writing)
|
||||
state.buffer.push(new WriteReq(chunk, encoding, cb));
|
||||
else
|
||||
doWrite(stream, state, len, chunk, encoding, cb);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
function doWrite(stream, state, len, chunk, encoding, cb) {
|
||||
state.writelen = len;
|
||||
state.writecb = cb;
|
||||
state.writing = true;
|
||||
state.sync = true;
|
||||
stream._write(chunk, encoding, state.onwrite);
|
||||
state.sync = false;
|
||||
}
|
||||
|
||||
function onwriteError(stream, state, sync, er, cb) {
|
||||
if (sync)
|
||||
process.nextTick(function() {
|
||||
cb(er);
|
||||
});
|
||||
else
|
||||
cb(er);
|
||||
|
||||
stream._writableState.errorEmitted = true;
|
||||
stream.emit('error', er);
|
||||
}
|
||||
|
||||
function onwriteStateUpdate(state) {
|
||||
state.writing = false;
|
||||
state.writecb = null;
|
||||
state.length -= state.writelen;
|
||||
state.writelen = 0;
|
||||
}
|
||||
|
||||
function onwrite(stream, er) {
|
||||
var state = stream._writableState;
|
||||
var sync = state.sync;
|
||||
var cb = state.writecb;
|
||||
|
||||
onwriteStateUpdate(state);
|
||||
|
||||
if (er)
|
||||
onwriteError(stream, state, sync, er, cb);
|
||||
else {
|
||||
// Check if we're actually ready to finish, but don't emit yet
|
||||
var finished = needFinish(stream, state);
|
||||
|
||||
if (!finished && !state.bufferProcessing && state.buffer.length)
|
||||
clearBuffer(stream, state);
|
||||
|
||||
if (sync) {
|
||||
process.nextTick(function() {
|
||||
afterWrite(stream, state, finished, cb);
|
||||
});
|
||||
} else {
|
||||
afterWrite(stream, state, finished, cb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function afterWrite(stream, state, finished, cb) {
|
||||
if (!finished)
|
||||
onwriteDrain(stream, state);
|
||||
cb();
|
||||
if (finished)
|
||||
finishMaybe(stream, state);
|
||||
}
|
||||
|
||||
// Must force callback to be called on nextTick, so that we don't
|
||||
// emit 'drain' before the write() consumer gets the 'false' return
|
||||
// value, and has a chance to attach a 'drain' listener.
|
||||
function onwriteDrain(stream, state) {
|
||||
if (state.length === 0 && state.needDrain) {
|
||||
state.needDrain = false;
|
||||
stream.emit('drain');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// if there's something in the buffer waiting, then process it
|
||||
function clearBuffer(stream, state) {
|
||||
state.bufferProcessing = true;
|
||||
|
||||
for (var c = 0; c < state.buffer.length; c++) {
|
||||
var entry = state.buffer[c];
|
||||
var chunk = entry.chunk;
|
||||
var encoding = entry.encoding;
|
||||
var cb = entry.callback;
|
||||
var len = state.objectMode ? 1 : chunk.length;
|
||||
|
||||
doWrite(stream, state, len, chunk, encoding, cb);
|
||||
|
||||
// if we didn't call the onwrite immediately, then
|
||||
// it means that we need to wait until it does.
|
||||
// also, that means that the chunk and cb are currently
|
||||
// being processed, so move the buffer counter past them.
|
||||
if (state.writing) {
|
||||
c++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
state.bufferProcessing = false;
|
||||
if (c < state.buffer.length)
|
||||
state.buffer = state.buffer.slice(c);
|
||||
else
|
||||
state.buffer.length = 0;
|
||||
}
|
||||
|
||||
Writable.prototype._write = function(chunk, encoding, cb) {
|
||||
cb(new Error('not implemented'));
|
||||
};
|
||||
|
||||
Writable.prototype.end = function(chunk, encoding, cb) {
|
||||
var state = this._writableState;
|
||||
|
||||
if (typeof chunk === 'function') {
|
||||
cb = chunk;
|
||||
chunk = null;
|
||||
encoding = null;
|
||||
} else if (typeof encoding === 'function') {
|
||||
cb = encoding;
|
||||
encoding = null;
|
||||
}
|
||||
|
||||
if (typeof chunk !== 'undefined' && chunk !== null)
|
||||
this.write(chunk, encoding);
|
||||
|
||||
// ignore unnecessary end() calls.
|
||||
if (!state.ending && !state.finished)
|
||||
endWritable(this, state, cb);
|
||||
};
|
||||
|
||||
|
||||
function needFinish(stream, state) {
|
||||
return (state.ending &&
|
||||
state.length === 0 &&
|
||||
!state.finished &&
|
||||
!state.writing);
|
||||
}
|
||||
|
||||
function finishMaybe(stream, state) {
|
||||
var need = needFinish(stream, state);
|
||||
if (need) {
|
||||
state.finished = true;
|
||||
stream.emit('finish');
|
||||
}
|
||||
return need;
|
||||
}
|
||||
|
||||
function endWritable(stream, state, cb) {
|
||||
state.ending = true;
|
||||
finishMaybe(stream, state);
|
||||
if (cb) {
|
||||
if (state.finished)
|
||||
process.nextTick(cb);
|
||||
else
|
||||
stream.once('finish', cb);
|
||||
}
|
||||
state.ended = true;
|
||||
}
|
||||
32
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/package.json
generated
vendored
Normal file
32
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/package.json
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "readable-stream",
|
||||
"version": "1.0.34",
|
||||
"description": "Streams2, a user-land copy of the stream library from Node.js v0.10.x",
|
||||
"main": "readable.js",
|
||||
"dependencies": {
|
||||
"core-util-is": "~1.0.0",
|
||||
"isarray": "0.0.1",
|
||||
"string_decoder": "~0.10.x",
|
||||
"inherits": "~2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"tap": "~0.2.6"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tap test/simple/*.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/isaacs/readable-stream"
|
||||
},
|
||||
"keywords": [
|
||||
"readable",
|
||||
"stream",
|
||||
"pipe"
|
||||
],
|
||||
"browser": {
|
||||
"util": false
|
||||
},
|
||||
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
|
||||
"license": "MIT"
|
||||
}
|
||||
1
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/passthrough.js
generated
vendored
Normal file
1
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/passthrough.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = require("./lib/_stream_passthrough.js")
|
||||
11
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/readable.js
generated
vendored
Normal file
11
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/readable.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
var Stream = require('stream'); // hack to fix a circular dependency issue when used with browserify
|
||||
exports = module.exports = require('./lib/_stream_readable.js');
|
||||
exports.Stream = Stream;
|
||||
exports.Readable = exports;
|
||||
exports.Writable = require('./lib/_stream_writable.js');
|
||||
exports.Duplex = require('./lib/_stream_duplex.js');
|
||||
exports.Transform = require('./lib/_stream_transform.js');
|
||||
exports.PassThrough = require('./lib/_stream_passthrough.js');
|
||||
if (!process.browser && process.env.READABLE_STREAM === 'disable') {
|
||||
module.exports = require('stream');
|
||||
}
|
||||
1
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/transform.js
generated
vendored
Normal file
1
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/transform.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = require("./lib/_stream_transform.js")
|
||||
1
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/writable.js
generated
vendored
Normal file
1
node_modules/decompress/node_modules/glob-stream/node_modules/readable-stream/writable.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = require("./lib/_stream_writable.js")
|
||||
3
node_modules/decompress/node_modules/glob-stream/node_modules/through2/.npmignore
generated
vendored
Normal file
3
node_modules/decompress/node_modules/glob-stream/node_modules/through2/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
test
|
||||
.jshintrc
|
||||
.travis.yml
|
||||
39
node_modules/decompress/node_modules/glob-stream/node_modules/through2/LICENSE
generated
vendored
Normal file
39
node_modules/decompress/node_modules/glob-stream/node_modules/through2/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
Copyright 2013, Rod Vagg (the "Original Author")
|
||||
All rights reserved.
|
||||
|
||||
MIT +no-false-attribs License
|
||||
|
||||
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.
|
||||
|
||||
Distributions of all or part of the Software intended to be used
|
||||
by the recipients as they would use the unmodified Software,
|
||||
containing modifications that substantially alter, remove, or
|
||||
disable functionality of the Software, outside of the documented
|
||||
configuration mechanisms provided by the Software, shall be
|
||||
modified such that the Original Author's bug reporting email
|
||||
addresses and urls are either replaced with the contact information
|
||||
of the parties responsible for the changes, or removed entirely.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
Except where noted, this license applies to any and all software
|
||||
programs and associated documentation files created by the
|
||||
Original Author, when distributed with the Software.
|
||||
132
node_modules/decompress/node_modules/glob-stream/node_modules/through2/README.md
generated
vendored
Normal file
132
node_modules/decompress/node_modules/glob-stream/node_modules/through2/README.md
generated
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
# through2
|
||||
|
||||
[](https://nodei.co/npm/through2/)
|
||||
|
||||
**A tiny wrapper around Node streams.Transform (Streams2) to avoid explicit subclassing noise**
|
||||
|
||||
Inspired by [Dominic Tarr](https://github.com/dominictarr)'s [through](https://github.com/dominictarr/through) in that it's so much easier to make a stream out of a function than it is to set up the prototype chain properly: `through(function (chunk) { ... })`.
|
||||
|
||||
Note: A **Streams3** version of through2 is available in npm with the tag `"1.0"` rather than `"latest"` so an `npm install through2` will get you the current Streams2 version (version number is 0.x.x). To use a Streams3 version use `npm install through2@1` to fetch the latest version 1.x.x. More information about Streams2 vs Streams3 and recommendations see the article **[Why I don't use Node's core 'stream' module](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html)**.
|
||||
|
||||
```js
|
||||
fs.createReadStream('ex.txt')
|
||||
.pipe(through2(function (chunk, enc, callback) {
|
||||
for (var i = 0; i < chunk.length; i++)
|
||||
if (chunk[i] == 97)
|
||||
chunk[i] = 122 // swap 'a' for 'z'
|
||||
|
||||
this.push(chunk)
|
||||
|
||||
callback()
|
||||
}))
|
||||
.pipe(fs.createWriteStream('out.txt'))
|
||||
```
|
||||
|
||||
Or object streams:
|
||||
|
||||
```js
|
||||
var all = []
|
||||
|
||||
fs.createReadStream('data.csv')
|
||||
.pipe(csv2())
|
||||
.pipe(through2.obj(function (chunk, enc, callback) {
|
||||
var data = {
|
||||
name : chunk[0]
|
||||
, address : chunk[3]
|
||||
, phone : chunk[10]
|
||||
}
|
||||
this.push(data)
|
||||
|
||||
callback()
|
||||
}))
|
||||
.on('data', function (data) {
|
||||
all.push(data)
|
||||
})
|
||||
.on('end', function () {
|
||||
doSomethingSpecial(all)
|
||||
})
|
||||
```
|
||||
|
||||
Note that `through2.obj(fn)` is a convenience wrapper around `through2({ objectMode: true }, fn)`.
|
||||
|
||||
## API
|
||||
|
||||
<b><code>through2([ options, ] [ transformFunction ] [, flushFunction ])</code></b>
|
||||
|
||||
Consult the **[stream.Transform](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_transform)** documentation for the exact rules of the `transformFunction` (i.e. `this._transform`) and the optional `flushFunction` (i.e. `this._flush`).
|
||||
|
||||
### options
|
||||
|
||||
The options argument is optional and is passed straight through to `stream.Transform`. So you can use `objectMode:true` if you are processing non-binary streams (or just use `through2.obj()`).
|
||||
|
||||
The `options` argument is first, unlike standard convention, because if I'm passing in an anonymous function then I'd prefer for the options argument to not get lost at the end of the call:
|
||||
|
||||
```js
|
||||
fs.createReadStream('/tmp/important.dat')
|
||||
.pipe(through2({ objectMode: true, allowHalfOpen: false },
|
||||
function (chunk, enc, cb) {
|
||||
cb(null, 'wut?') // note we can use the second argument on the callback
|
||||
// to provide data as an alternative to this.push('wut?')
|
||||
}
|
||||
)
|
||||
.pipe(fs.createWriteStream('/tmp/wut.txt'))
|
||||
```
|
||||
|
||||
### transformFunction
|
||||
|
||||
The `transformFunction` must have the following signature: `function (chunk, encoding, callback) {}`. A minimal implementation should call the `callback` function to indicate that the transformation is done, even if that transformation means discarding the chunk.
|
||||
|
||||
To queue a new chunk, call `this.push(chunk)`—this can be called as many times as required before the `callback()` if you have multiple pieces to send on.
|
||||
|
||||
Alternatively, you may use `callback(err, chunk)` as shorthand for emitting a single chunk or an error.
|
||||
|
||||
If you **do not provide a `transformFunction`** then you will get a simple pass-through stream.
|
||||
|
||||
### flushFunction
|
||||
|
||||
The optional `flushFunction` is provided as the last argument (2nd or 3rd, depending on whether you've supplied options) is called just prior to the stream ending. Can be used to finish up any processing that may be in progress.
|
||||
|
||||
```js
|
||||
fs.createReadStream('/tmp/important.dat')
|
||||
.pipe(through2(
|
||||
function (chunk, enc, cb) { cb(null, chunk) }, // transform is a noop
|
||||
function (cb) { // flush function
|
||||
this.push('tacking on an extra buffer to the end');
|
||||
cb();
|
||||
}
|
||||
))
|
||||
.pipe(fs.createWriteStream('/tmp/wut.txt'));
|
||||
```
|
||||
|
||||
<b><code>through2.ctor([ options, ] transformFunction[, flushFunction ])</code></b>
|
||||
|
||||
Instead of returning a `stream.Transform` instance, `through2.ctor()` returns a **constructor** for a custom Transform. This is useful when you want to use the same transform logic in multiple instances.
|
||||
|
||||
```js
|
||||
var FToC = through2.ctor({objectMode: true}, function (record, encoding, callback) {
|
||||
if (record.temp != null && record.unit = "F") {
|
||||
record.temp = ( ( record.temp - 32 ) * 5 ) / 9
|
||||
record.unit = "C"
|
||||
}
|
||||
this.push(record)
|
||||
callback()
|
||||
})
|
||||
|
||||
// Create instances of FToC like so:
|
||||
var converter = new FToC()
|
||||
// Or:
|
||||
var converter = FToC()
|
||||
// Or specify/override options when you instantiate, if you prefer:
|
||||
var converter = FToC({objectMode: true})
|
||||
```
|
||||
|
||||
## See Also
|
||||
|
||||
- [through2-map](https://github.com/brycebaril/through2-map) - Array.prototype.map analog for streams.
|
||||
- [through2-filter](https://github.com/brycebaril/through2-filter) - Array.prototype.filter analog for streams.
|
||||
- [through2-reduce](https://github.com/brycebaril/through2-reduce) - Array.prototype.reduce analog for streams.
|
||||
- [through2-spy](https://github.com/brycebaril/through2-spy) - Wrapper for simple stream.PassThrough spies.
|
||||
|
||||
## License
|
||||
|
||||
**through2** is Copyright (c) 2013 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.
|
||||
31
node_modules/decompress/node_modules/glob-stream/node_modules/through2/package.json
generated
vendored
Normal file
31
node_modules/decompress/node_modules/glob-stream/node_modules/through2/package.json
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"name": "through2",
|
||||
"version": "0.6.5",
|
||||
"description": "A tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise",
|
||||
"main": "through2.js",
|
||||
"scripts": {
|
||||
"test": "node test/test.js",
|
||||
"test-local": "brtapsauce-local test/basic-test.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/rvagg/through2.git"
|
||||
},
|
||||
"keywords": [
|
||||
"stream",
|
||||
"streams2",
|
||||
"through",
|
||||
"transform"
|
||||
],
|
||||
"author": "Rod Vagg <r@va.gg> (https://github.com/rvagg)",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"readable-stream": ">=1.0.33-1 <1.1.0-0",
|
||||
"xtend": ">=4.0.0 <4.1.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"bl": ">=0.9.0 <0.10.0-0",
|
||||
"stream-spigot": ">=3.0.4 <3.1.0-0",
|
||||
"tape": ">=2.14.0 <2.15.0-0"
|
||||
}
|
||||
}
|
||||
96
node_modules/decompress/node_modules/glob-stream/node_modules/through2/through2.js
generated
vendored
Normal file
96
node_modules/decompress/node_modules/glob-stream/node_modules/through2/through2.js
generated
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
var Transform = require('readable-stream/transform')
|
||||
, inherits = require('util').inherits
|
||||
, xtend = require('xtend')
|
||||
|
||||
function DestroyableTransform(opts) {
|
||||
Transform.call(this, opts)
|
||||
this._destroyed = false
|
||||
}
|
||||
|
||||
inherits(DestroyableTransform, Transform)
|
||||
|
||||
DestroyableTransform.prototype.destroy = function(err) {
|
||||
if (this._destroyed) return
|
||||
this._destroyed = true
|
||||
|
||||
var self = this
|
||||
process.nextTick(function() {
|
||||
if (err)
|
||||
self.emit('error', err)
|
||||
self.emit('close')
|
||||
})
|
||||
}
|
||||
|
||||
// a noop _transform function
|
||||
function noop (chunk, enc, callback) {
|
||||
callback(null, chunk)
|
||||
}
|
||||
|
||||
|
||||
// create a new export function, used by both the main export and
|
||||
// the .ctor export, contains common logic for dealing with arguments
|
||||
function through2 (construct) {
|
||||
return function (options, transform, flush) {
|
||||
if (typeof options == 'function') {
|
||||
flush = transform
|
||||
transform = options
|
||||
options = {}
|
||||
}
|
||||
|
||||
if (typeof transform != 'function')
|
||||
transform = noop
|
||||
|
||||
if (typeof flush != 'function')
|
||||
flush = null
|
||||
|
||||
return construct(options, transform, flush)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// main export, just make me a transform stream!
|
||||
module.exports = through2(function (options, transform, flush) {
|
||||
var t2 = new DestroyableTransform(options)
|
||||
|
||||
t2._transform = transform
|
||||
|
||||
if (flush)
|
||||
t2._flush = flush
|
||||
|
||||
return t2
|
||||
})
|
||||
|
||||
|
||||
// make me a reusable prototype that I can `new`, or implicitly `new`
|
||||
// with a constructor call
|
||||
module.exports.ctor = through2(function (options, transform, flush) {
|
||||
function Through2 (override) {
|
||||
if (!(this instanceof Through2))
|
||||
return new Through2(override)
|
||||
|
||||
this.options = xtend(options, override)
|
||||
|
||||
DestroyableTransform.call(this, this.options)
|
||||
}
|
||||
|
||||
inherits(Through2, DestroyableTransform)
|
||||
|
||||
Through2.prototype._transform = transform
|
||||
|
||||
if (flush)
|
||||
Through2.prototype._flush = flush
|
||||
|
||||
return Through2
|
||||
})
|
||||
|
||||
|
||||
module.exports.obj = through2(function (options, transform, flush) {
|
||||
var t2 = new DestroyableTransform(xtend({ objectMode: true, highWaterMark: 16 }, options))
|
||||
|
||||
t2._transform = transform
|
||||
|
||||
if (flush)
|
||||
t2._flush = flush
|
||||
|
||||
return t2
|
||||
})
|
||||
51
node_modules/decompress/node_modules/glob-stream/package.json
generated
vendored
Normal file
51
node_modules/decompress/node_modules/glob-stream/package.json
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"name": "glob-stream",
|
||||
"version": "5.3.5",
|
||||
"description": "A wrapper around node-glob to make it streamy",
|
||||
"author": "Gulp Team <team@gulpjs.com> (http://gulpjs.com/)",
|
||||
"contributors": [],
|
||||
"homepage": "http://gulpjs.com",
|
||||
"repository": "gulpjs/glob-stream",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
},
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"scripts": {
|
||||
"lint": "eslint . && jscs . test/",
|
||||
"pretest": "npm run lint",
|
||||
"test": "mocha",
|
||||
"coveralls": "istanbul cover _mocha --report lcovonly && istanbul-coveralls"
|
||||
},
|
||||
"dependencies": {
|
||||
"extend": "^3.0.0",
|
||||
"glob": "^5.0.3",
|
||||
"glob-parent": "^3.0.0",
|
||||
"micromatch": "^2.3.7",
|
||||
"ordered-read-streams": "^0.3.0",
|
||||
"through2": "^0.6.0",
|
||||
"to-absolute-glob": "^0.1.1",
|
||||
"unique-stream": "^2.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"coveralls": "^2.11.2",
|
||||
"eslint": "^1.7.3",
|
||||
"eslint-config-gulp": "^2.0.0",
|
||||
"istanbul": "^0.3.0",
|
||||
"istanbul-coveralls": "^1.0.1",
|
||||
"jscs": "^2.3.5",
|
||||
"jscs-preset-gulp": "^1.0.0",
|
||||
"mocha": "^2.0.0",
|
||||
"mocha-lcov-reporter": "^0.0.2",
|
||||
"rimraf": "^2.2.5",
|
||||
"should": "^7.1.0",
|
||||
"stream-sink": "^1.2.0"
|
||||
},
|
||||
"keywords": [
|
||||
"glob",
|
||||
"stream"
|
||||
]
|
||||
}
|
||||
15
node_modules/decompress/node_modules/glob/LICENSE
generated
vendored
Normal file
15
node_modules/decompress/node_modules/glob/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
377
node_modules/decompress/node_modules/glob/README.md
generated
vendored
Normal file
377
node_modules/decompress/node_modules/glob/README.md
generated
vendored
Normal file
@@ -0,0 +1,377 @@
|
||||
[](https://travis-ci.org/isaacs/node-glob/) [](https://david-dm.org/isaacs/node-glob) [](https://david-dm.org/isaacs/node-glob#info=devDependencies) [](https://david-dm.org/isaacs/node-glob#info=optionalDependencies)
|
||||
|
||||
# Glob
|
||||
|
||||
Match files using the patterns the shell uses, like stars and stuff.
|
||||
|
||||
This is a glob implementation in JavaScript. It uses the `minimatch`
|
||||
library to do its matching.
|
||||
|
||||

|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
var glob = require("glob")
|
||||
|
||||
// options is optional
|
||||
glob("**/*.js", options, function (er, files) {
|
||||
// files is an array of filenames.
|
||||
// If the `nonull` option is set, and nothing
|
||||
// was found, then files is ["**/*.js"]
|
||||
// er is an error object or null.
|
||||
})
|
||||
```
|
||||
|
||||
## Glob Primer
|
||||
|
||||
"Globs" are the patterns you type when you do stuff like `ls *.js` on
|
||||
the command line, or put `build/*` in a `.gitignore` file.
|
||||
|
||||
Before parsing the path part patterns, braced sections are expanded
|
||||
into a set. Braced sections start with `{` and end with `}`, with any
|
||||
number of comma-delimited sections within. Braced sections may contain
|
||||
slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`.
|
||||
|
||||
The following characters have special magic meaning when used in a
|
||||
path portion:
|
||||
|
||||
* `*` Matches 0 or more characters in a single path portion
|
||||
* `?` Matches 1 character
|
||||
* `[...]` Matches a range of characters, similar to a RegExp range.
|
||||
If the first character of the range is `!` or `^` then it matches
|
||||
any character not in the range.
|
||||
* `!(pattern|pattern|pattern)` Matches anything that does not match
|
||||
any of the patterns provided.
|
||||
* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the
|
||||
patterns provided.
|
||||
* `+(pattern|pattern|pattern)` Matches one or more occurrences of the
|
||||
patterns provided.
|
||||
* `*(a|b|c)` Matches zero or more occurrences of the patterns provided
|
||||
* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns
|
||||
provided
|
||||
* `**` If a "globstar" is alone in a path portion, then it matches
|
||||
zero or more directories and subdirectories searching for matches.
|
||||
It does not crawl symlinked directories.
|
||||
|
||||
### Dots
|
||||
|
||||
If a file or directory path portion has a `.` as the first character,
|
||||
then it will not match any glob pattern unless that pattern's
|
||||
corresponding path part also has a `.` as its first character.
|
||||
|
||||
For example, the pattern `a/.*/c` would match the file at `a/.b/c`.
|
||||
However the pattern `a/*/c` would not, because `*` does not start with
|
||||
a dot character.
|
||||
|
||||
You can make glob treat dots as normal characters by setting
|
||||
`dot:true` in the options.
|
||||
|
||||
### Basename Matching
|
||||
|
||||
If you set `matchBase:true` in the options, and the pattern has no
|
||||
slashes in it, then it will seek for any file anywhere in the tree
|
||||
with a matching basename. For example, `*.js` would match
|
||||
`test/simple/basic.js`.
|
||||
|
||||
### Negation
|
||||
|
||||
The intent for negation would be for a pattern starting with `!` to
|
||||
match everything that *doesn't* match the supplied pattern. However,
|
||||
the implementation is weird, and for the time being, this should be
|
||||
avoided. The behavior is deprecated in version 5, and will be removed
|
||||
entirely in version 6.
|
||||
|
||||
### Empty Sets
|
||||
|
||||
If no matching files are found, then an empty array is returned. This
|
||||
differs from the shell, where the pattern itself is returned. For
|
||||
example:
|
||||
|
||||
$ echo a*s*d*f
|
||||
a*s*d*f
|
||||
|
||||
To get the bash-style behavior, set the `nonull:true` in the options.
|
||||
|
||||
### See Also:
|
||||
|
||||
* `man sh`
|
||||
* `man bash` (Search for "Pattern Matching")
|
||||
* `man 3 fnmatch`
|
||||
* `man 5 gitignore`
|
||||
* [minimatch documentation](https://github.com/isaacs/minimatch)
|
||||
|
||||
## glob.hasMagic(pattern, [options])
|
||||
|
||||
Returns `true` if there are any special characters in the pattern, and
|
||||
`false` otherwise.
|
||||
|
||||
Note that the options affect the results. If `noext:true` is set in
|
||||
the options object, then `+(a|b)` will not be considered a magic
|
||||
pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}`
|
||||
then that is considered magical, unless `nobrace:true` is set in the
|
||||
options.
|
||||
|
||||
## glob(pattern, [options], cb)
|
||||
|
||||
* `pattern` {String} Pattern to be matched
|
||||
* `options` {Object}
|
||||
* `cb` {Function}
|
||||
* `err` {Error | null}
|
||||
* `matches` {Array<String>} filenames found matching the pattern
|
||||
|
||||
Perform an asynchronous glob search.
|
||||
|
||||
## glob.sync(pattern, [options])
|
||||
|
||||
* `pattern` {String} Pattern to be matched
|
||||
* `options` {Object}
|
||||
* return: {Array<String>} filenames found matching the pattern
|
||||
|
||||
Perform a synchronous glob search.
|
||||
|
||||
## Class: glob.Glob
|
||||
|
||||
Create a Glob object by instantiating the `glob.Glob` class.
|
||||
|
||||
```javascript
|
||||
var Glob = require("glob").Glob
|
||||
var mg = new Glob(pattern, options, cb)
|
||||
```
|
||||
|
||||
It's an EventEmitter, and starts walking the filesystem to find matches
|
||||
immediately.
|
||||
|
||||
### new glob.Glob(pattern, [options], [cb])
|
||||
|
||||
* `pattern` {String} pattern to search for
|
||||
* `options` {Object}
|
||||
* `cb` {Function} Called when an error occurs, or matches are found
|
||||
* `err` {Error | null}
|
||||
* `matches` {Array<String>} filenames found matching the pattern
|
||||
|
||||
Note that if the `sync` flag is set in the options, then matches will
|
||||
be immediately available on the `g.found` member.
|
||||
|
||||
### Properties
|
||||
|
||||
* `minimatch` The minimatch object that the glob uses.
|
||||
* `options` The options object passed in.
|
||||
* `aborted` Boolean which is set to true when calling `abort()`. There
|
||||
is no way at this time to continue a glob search after aborting, but
|
||||
you can re-use the statCache to avoid having to duplicate syscalls.
|
||||
* `cache` Convenience object. Each field has the following possible
|
||||
values:
|
||||
* `false` - Path does not exist
|
||||
* `true` - Path exists
|
||||
* `'DIR'` - Path exists, and is not a directory
|
||||
* `'FILE'` - Path exists, and is a directory
|
||||
* `[file, entries, ...]` - Path exists, is a directory, and the
|
||||
array value is the results of `fs.readdir`
|
||||
* `statCache` Cache of `fs.stat` results, to prevent statting the same
|
||||
path multiple times.
|
||||
* `symlinks` A record of which paths are symbolic links, which is
|
||||
relevant in resolving `**` patterns.
|
||||
* `realpathCache` An optional object which is passed to `fs.realpath`
|
||||
to minimize unnecessary syscalls. It is stored on the instantiated
|
||||
Glob object, and may be re-used.
|
||||
|
||||
### Events
|
||||
|
||||
* `end` When the matching is finished, this is emitted with all the
|
||||
matches found. If the `nonull` option is set, and no match was found,
|
||||
then the `matches` list contains the original pattern. The matches
|
||||
are sorted, unless the `nosort` flag is set.
|
||||
* `match` Every time a match is found, this is emitted with the matched.
|
||||
* `error` Emitted when an unexpected error is encountered, or whenever
|
||||
any fs error occurs if `options.strict` is set.
|
||||
* `abort` When `abort()` is called, this event is raised.
|
||||
|
||||
### Methods
|
||||
|
||||
* `pause` Temporarily stop the search
|
||||
* `resume` Resume the search
|
||||
* `abort` Stop the search forever
|
||||
|
||||
### Options
|
||||
|
||||
All the options that can be passed to Minimatch can also be passed to
|
||||
Glob to change pattern matching behavior. Also, some have been added,
|
||||
or have glob-specific ramifications.
|
||||
|
||||
All options are false by default, unless otherwise noted.
|
||||
|
||||
All options are added to the Glob object, as well.
|
||||
|
||||
If you are running many `glob` operations, you can pass a Glob object
|
||||
as the `options` argument to a subsequent operation to shortcut some
|
||||
`stat` and `readdir` calls. At the very least, you may pass in shared
|
||||
`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that
|
||||
parallel glob operations will be sped up by sharing information about
|
||||
the filesystem.
|
||||
|
||||
* `cwd` The current working directory in which to search. Defaults
|
||||
to `process.cwd()`.
|
||||
* `root` The place where patterns starting with `/` will be mounted
|
||||
onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix
|
||||
systems, and `C:\` or some such on Windows.)
|
||||
* `dot` Include `.dot` files in normal matches and `globstar` matches.
|
||||
Note that an explicit dot in a portion of the pattern will always
|
||||
match dot files.
|
||||
* `nomount` By default, a pattern starting with a forward-slash will be
|
||||
"mounted" onto the root setting, so that a valid filesystem path is
|
||||
returned. Set this flag to disable that behavior.
|
||||
* `mark` Add a `/` character to directory matches. Note that this
|
||||
requires additional stat calls.
|
||||
* `nosort` Don't sort the results.
|
||||
* `stat` Set to true to stat *all* results. This reduces performance
|
||||
somewhat, and is completely unnecessary, unless `readdir` is presumed
|
||||
to be an untrustworthy indicator of file existence.
|
||||
* `silent` When an unusual error is encountered when attempting to
|
||||
read a directory, a warning will be printed to stderr. Set the
|
||||
`silent` option to true to suppress these warnings.
|
||||
* `strict` When an unusual error is encountered when attempting to
|
||||
read a directory, the process will just continue on in search of
|
||||
other matches. Set the `strict` option to raise an error in these
|
||||
cases.
|
||||
* `cache` See `cache` property above. Pass in a previously generated
|
||||
cache object to save some fs calls.
|
||||
* `statCache` A cache of results of filesystem information, to prevent
|
||||
unnecessary stat calls. While it should not normally be necessary
|
||||
to set this, you may pass the statCache from one glob() call to the
|
||||
options object of another, if you know that the filesystem will not
|
||||
change between calls. (See "Race Conditions" below.)
|
||||
* `symlinks` A cache of known symbolic links. You may pass in a
|
||||
previously generated `symlinks` object to save `lstat` calls when
|
||||
resolving `**` matches.
|
||||
* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead.
|
||||
* `nounique` In some cases, brace-expanded patterns can result in the
|
||||
same file showing up multiple times in the result set. By default,
|
||||
this implementation prevents duplicates in the result set. Set this
|
||||
flag to disable that behavior.
|
||||
* `nonull` Set to never return an empty set, instead returning a set
|
||||
containing the pattern itself. This is the default in glob(3).
|
||||
* `debug` Set to enable debug logging in minimatch and glob.
|
||||
* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets.
|
||||
* `noglobstar` Do not match `**` against multiple filenames. (Ie,
|
||||
treat it as a normal `*` instead.)
|
||||
* `noext` Do not match `+(a|b)` "extglob" patterns.
|
||||
* `nocase` Perform a case-insensitive match. Note: on
|
||||
case-insensitive filesystems, non-magic patterns will match by
|
||||
default, since `stat` and `readdir` will not raise errors.
|
||||
* `matchBase` Perform a basename-only match if the pattern does not
|
||||
contain any slash characters. That is, `*.js` would be treated as
|
||||
equivalent to `**/*.js`, matching all js files in all directories.
|
||||
* `nodir` Do not match directories, only files. (Note: to match
|
||||
*only* directories, simply put a `/` at the end of the pattern.)
|
||||
* `ignore` Add a pattern or an array of patterns to exclude matches.
|
||||
* `follow` Follow symlinked directories when expanding `**` patterns.
|
||||
Note that this can result in a lot of duplicate references in the
|
||||
presence of cyclic links.
|
||||
* `realpath` Set to true to call `fs.realpath` on all of the results.
|
||||
In the case of a symlink that cannot be resolved, the full absolute
|
||||
path to the matched entry is returned (though it will usually be a
|
||||
broken symlink)
|
||||
* `nonegate` Suppress deprecated `negate` behavior. (See below.)
|
||||
Default=true
|
||||
* `nocomment` Suppress deprecated `comment` behavior. (See below.)
|
||||
Default=true
|
||||
|
||||
## Comparisons to other fnmatch/glob implementations
|
||||
|
||||
While strict compliance with the existing standards is a worthwhile
|
||||
goal, some discrepancies exist between node-glob and other
|
||||
implementations, and are intentional.
|
||||
|
||||
The double-star character `**` is supported by default, unless the
|
||||
`noglobstar` flag is set. This is supported in the manner of bsdglob
|
||||
and bash 4.3, where `**` only has special significance if it is the only
|
||||
thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but
|
||||
`a/**b` will not.
|
||||
|
||||
Note that symlinked directories are not crawled as part of a `**`,
|
||||
though their contents may match against subsequent portions of the
|
||||
pattern. This prevents infinite loops and duplicates and the like.
|
||||
|
||||
If an escaped pattern has no matches, and the `nonull` flag is set,
|
||||
then glob returns the pattern as-provided, rather than
|
||||
interpreting the character escapes. For example,
|
||||
`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than
|
||||
`"*a?"`. This is akin to setting the `nullglob` option in bash, except
|
||||
that it does not resolve escaped pattern characters.
|
||||
|
||||
If brace expansion is not disabled, then it is performed before any
|
||||
other interpretation of the glob pattern. Thus, a pattern like
|
||||
`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded
|
||||
**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are
|
||||
checked for validity. Since those two are valid, matching proceeds.
|
||||
|
||||
### Comments and Negation
|
||||
|
||||
**Note**: In version 5 of this module, negation and comments are
|
||||
**disabled** by default. You can explicitly set `nonegate:false` or
|
||||
`nocomment:false` to re-enable them. They are going away entirely in
|
||||
version 6.
|
||||
|
||||
The intent for negation would be for a pattern starting with `!` to
|
||||
match everything that *doesn't* match the supplied pattern. However,
|
||||
the implementation is weird. It is better to use the `ignore` option
|
||||
to set a pattern or set of patterns to exclude from matches. If you
|
||||
want the "everything except *x*" type of behavior, you can use `**` as
|
||||
the main pattern, and set an `ignore` for the things to exclude.
|
||||
|
||||
The comments feature is added in minimatch, primarily to more easily
|
||||
support use cases like ignore files, where a `#` at the start of a
|
||||
line makes the pattern "empty". However, in the context of a
|
||||
straightforward filesystem globber, "comments" don't make much sense.
|
||||
|
||||
## Windows
|
||||
|
||||
**Please only use forward-slashes in glob expressions.**
|
||||
|
||||
Though windows uses either `/` or `\` as its path separator, only `/`
|
||||
characters are used by this glob implementation. You must use
|
||||
forward-slashes **only** in glob expressions. Back-slashes will always
|
||||
be interpreted as escape characters, not path separators.
|
||||
|
||||
Results from absolute patterns such as `/foo/*` are mounted onto the
|
||||
root setting using `path.join`. On windows, this will by default result
|
||||
in `/foo/*` matching `C:\foo\bar.txt`.
|
||||
|
||||
## Race Conditions
|
||||
|
||||
Glob searching, by its very nature, is susceptible to race conditions,
|
||||
since it relies on directory walking and such.
|
||||
|
||||
As a result, it is possible that a file that exists when glob looks for
|
||||
it may have been deleted or modified by the time it returns the result.
|
||||
|
||||
As part of its internal implementation, this program caches all stat
|
||||
and readdir calls that it makes, in order to cut down on system
|
||||
overhead. However, this also makes it even more susceptible to races,
|
||||
especially if the cache or statCache objects are reused between glob
|
||||
calls.
|
||||
|
||||
Users are thus advised not to use a glob result as a guarantee of
|
||||
filesystem state in the face of rapid changes. For the vast majority
|
||||
of operations, this is never a problem.
|
||||
|
||||
## Contributing
|
||||
|
||||
Any change to behavior (including bugfixes) must come with a test.
|
||||
|
||||
Patches that fail tests or reduce performance will be rejected.
|
||||
|
||||
```
|
||||
# to run tests
|
||||
npm test
|
||||
|
||||
# to re-generate test fixtures
|
||||
npm run test-regen
|
||||
|
||||
# to benchmark against bash/zsh
|
||||
npm run bench
|
||||
|
||||
# to profile javascript
|
||||
npm run prof
|
||||
```
|
||||
245
node_modules/decompress/node_modules/glob/common.js
generated
vendored
Normal file
245
node_modules/decompress/node_modules/glob/common.js
generated
vendored
Normal file
@@ -0,0 +1,245 @@
|
||||
exports.alphasort = alphasort
|
||||
exports.alphasorti = alphasorti
|
||||
exports.setopts = setopts
|
||||
exports.ownProp = ownProp
|
||||
exports.makeAbs = makeAbs
|
||||
exports.finish = finish
|
||||
exports.mark = mark
|
||||
exports.isIgnored = isIgnored
|
||||
exports.childrenIgnored = childrenIgnored
|
||||
|
||||
function ownProp (obj, field) {
|
||||
return Object.prototype.hasOwnProperty.call(obj, field)
|
||||
}
|
||||
|
||||
var path = require("path")
|
||||
var minimatch = require("minimatch")
|
||||
var isAbsolute = require("path-is-absolute")
|
||||
var Minimatch = minimatch.Minimatch
|
||||
|
||||
function alphasorti (a, b) {
|
||||
return a.toLowerCase().localeCompare(b.toLowerCase())
|
||||
}
|
||||
|
||||
function alphasort (a, b) {
|
||||
return a.localeCompare(b)
|
||||
}
|
||||
|
||||
function setupIgnores (self, options) {
|
||||
self.ignore = options.ignore || []
|
||||
|
||||
if (!Array.isArray(self.ignore))
|
||||
self.ignore = [self.ignore]
|
||||
|
||||
if (self.ignore.length) {
|
||||
self.ignore = self.ignore.map(ignoreMap)
|
||||
}
|
||||
}
|
||||
|
||||
function ignoreMap (pattern) {
|
||||
var gmatcher = null
|
||||
if (pattern.slice(-3) === '/**') {
|
||||
var gpattern = pattern.replace(/(\/\*\*)+$/, '')
|
||||
gmatcher = new Minimatch(gpattern)
|
||||
}
|
||||
|
||||
return {
|
||||
matcher: new Minimatch(pattern),
|
||||
gmatcher: gmatcher
|
||||
}
|
||||
}
|
||||
|
||||
function setopts (self, pattern, options) {
|
||||
if (!options)
|
||||
options = {}
|
||||
|
||||
// base-matching: just use globstar for that.
|
||||
if (options.matchBase && -1 === pattern.indexOf("/")) {
|
||||
if (options.noglobstar) {
|
||||
throw new Error("base matching requires globstar")
|
||||
}
|
||||
pattern = "**/" + pattern
|
||||
}
|
||||
|
||||
self.silent = !!options.silent
|
||||
self.pattern = pattern
|
||||
self.strict = options.strict !== false
|
||||
self.realpath = !!options.realpath
|
||||
self.realpathCache = options.realpathCache || Object.create(null)
|
||||
self.follow = !!options.follow
|
||||
self.dot = !!options.dot
|
||||
self.mark = !!options.mark
|
||||
self.nodir = !!options.nodir
|
||||
if (self.nodir)
|
||||
self.mark = true
|
||||
self.sync = !!options.sync
|
||||
self.nounique = !!options.nounique
|
||||
self.nonull = !!options.nonull
|
||||
self.nosort = !!options.nosort
|
||||
self.nocase = !!options.nocase
|
||||
self.stat = !!options.stat
|
||||
self.noprocess = !!options.noprocess
|
||||
|
||||
self.maxLength = options.maxLength || Infinity
|
||||
self.cache = options.cache || Object.create(null)
|
||||
self.statCache = options.statCache || Object.create(null)
|
||||
self.symlinks = options.symlinks || Object.create(null)
|
||||
|
||||
setupIgnores(self, options)
|
||||
|
||||
self.changedCwd = false
|
||||
var cwd = process.cwd()
|
||||
if (!ownProp(options, "cwd"))
|
||||
self.cwd = cwd
|
||||
else {
|
||||
self.cwd = options.cwd
|
||||
self.changedCwd = path.resolve(options.cwd) !== cwd
|
||||
}
|
||||
|
||||
self.root = options.root || path.resolve(self.cwd, "/")
|
||||
self.root = path.resolve(self.root)
|
||||
if (process.platform === "win32")
|
||||
self.root = self.root.replace(/\\/g, "/")
|
||||
|
||||
self.nomount = !!options.nomount
|
||||
|
||||
// disable comments and negation unless the user explicitly
|
||||
// passes in false as the option.
|
||||
options.nonegate = options.nonegate === false ? false : true
|
||||
options.nocomment = options.nocomment === false ? false : true
|
||||
deprecationWarning(options)
|
||||
|
||||
self.minimatch = new Minimatch(pattern, options)
|
||||
self.options = self.minimatch.options
|
||||
}
|
||||
|
||||
// TODO(isaacs): remove entirely in v6
|
||||
// exported to reset in tests
|
||||
exports.deprecationWarned
|
||||
function deprecationWarning(options) {
|
||||
if (!options.nonegate || !options.nocomment) {
|
||||
if (process.noDeprecation !== true && !exports.deprecationWarned) {
|
||||
var msg = 'glob WARNING: comments and negation will be disabled in v6'
|
||||
if (process.throwDeprecation)
|
||||
throw new Error(msg)
|
||||
else if (process.traceDeprecation)
|
||||
console.trace(msg)
|
||||
else
|
||||
console.error(msg)
|
||||
|
||||
exports.deprecationWarned = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function finish (self) {
|
||||
var nou = self.nounique
|
||||
var all = nou ? [] : Object.create(null)
|
||||
|
||||
for (var i = 0, l = self.matches.length; i < l; i ++) {
|
||||
var matches = self.matches[i]
|
||||
if (!matches || Object.keys(matches).length === 0) {
|
||||
if (self.nonull) {
|
||||
// do like the shell, and spit out the literal glob
|
||||
var literal = self.minimatch.globSet[i]
|
||||
if (nou)
|
||||
all.push(literal)
|
||||
else
|
||||
all[literal] = true
|
||||
}
|
||||
} else {
|
||||
// had matches
|
||||
var m = Object.keys(matches)
|
||||
if (nou)
|
||||
all.push.apply(all, m)
|
||||
else
|
||||
m.forEach(function (m) {
|
||||
all[m] = true
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if (!nou)
|
||||
all = Object.keys(all)
|
||||
|
||||
if (!self.nosort)
|
||||
all = all.sort(self.nocase ? alphasorti : alphasort)
|
||||
|
||||
// at *some* point we statted all of these
|
||||
if (self.mark) {
|
||||
for (var i = 0; i < all.length; i++) {
|
||||
all[i] = self._mark(all[i])
|
||||
}
|
||||
if (self.nodir) {
|
||||
all = all.filter(function (e) {
|
||||
return !(/\/$/.test(e))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if (self.ignore.length)
|
||||
all = all.filter(function(m) {
|
||||
return !isIgnored(self, m)
|
||||
})
|
||||
|
||||
self.found = all
|
||||
}
|
||||
|
||||
function mark (self, p) {
|
||||
var abs = makeAbs(self, p)
|
||||
var c = self.cache[abs]
|
||||
var m = p
|
||||
if (c) {
|
||||
var isDir = c === 'DIR' || Array.isArray(c)
|
||||
var slash = p.slice(-1) === '/'
|
||||
|
||||
if (isDir && !slash)
|
||||
m += '/'
|
||||
else if (!isDir && slash)
|
||||
m = m.slice(0, -1)
|
||||
|
||||
if (m !== p) {
|
||||
var mabs = makeAbs(self, m)
|
||||
self.statCache[mabs] = self.statCache[abs]
|
||||
self.cache[mabs] = self.cache[abs]
|
||||
}
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
// lotta situps...
|
||||
function makeAbs (self, f) {
|
||||
var abs = f
|
||||
if (f.charAt(0) === '/') {
|
||||
abs = path.join(self.root, f)
|
||||
} else if (isAbsolute(f) || f === '') {
|
||||
abs = f
|
||||
} else if (self.changedCwd) {
|
||||
abs = path.resolve(self.cwd, f)
|
||||
} else {
|
||||
abs = path.resolve(f)
|
||||
}
|
||||
return abs
|
||||
}
|
||||
|
||||
|
||||
// Return true, if pattern ends with globstar '**', for the accompanying parent directory.
|
||||
// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents
|
||||
function isIgnored (self, path) {
|
||||
if (!self.ignore.length)
|
||||
return false
|
||||
|
||||
return self.ignore.some(function(item) {
|
||||
return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))
|
||||
})
|
||||
}
|
||||
|
||||
function childrenIgnored (self, path) {
|
||||
if (!self.ignore.length)
|
||||
return false
|
||||
|
||||
return self.ignore.some(function(item) {
|
||||
return !!(item.gmatcher && item.gmatcher.match(path))
|
||||
})
|
||||
}
|
||||
752
node_modules/decompress/node_modules/glob/glob.js
generated
vendored
Normal file
752
node_modules/decompress/node_modules/glob/glob.js
generated
vendored
Normal file
@@ -0,0 +1,752 @@
|
||||
// Approach:
|
||||
//
|
||||
// 1. Get the minimatch set
|
||||
// 2. For each pattern in the set, PROCESS(pattern, false)
|
||||
// 3. Store matches per-set, then uniq them
|
||||
//
|
||||
// PROCESS(pattern, inGlobStar)
|
||||
// Get the first [n] items from pattern that are all strings
|
||||
// Join these together. This is PREFIX.
|
||||
// If there is no more remaining, then stat(PREFIX) and
|
||||
// add to matches if it succeeds. END.
|
||||
//
|
||||
// If inGlobStar and PREFIX is symlink and points to dir
|
||||
// set ENTRIES = []
|
||||
// else readdir(PREFIX) as ENTRIES
|
||||
// If fail, END
|
||||
//
|
||||
// with ENTRIES
|
||||
// If pattern[n] is GLOBSTAR
|
||||
// // handle the case where the globstar match is empty
|
||||
// // by pruning it out, and testing the resulting pattern
|
||||
// PROCESS(pattern[0..n] + pattern[n+1 .. $], false)
|
||||
// // handle other cases.
|
||||
// for ENTRY in ENTRIES (not dotfiles)
|
||||
// // attach globstar + tail onto the entry
|
||||
// // Mark that this entry is a globstar match
|
||||
// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true)
|
||||
//
|
||||
// else // not globstar
|
||||
// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot)
|
||||
// Test ENTRY against pattern[n]
|
||||
// If fails, continue
|
||||
// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $])
|
||||
//
|
||||
// Caveat:
|
||||
// Cache all stats and readdirs results to minimize syscall. Since all
|
||||
// we ever care about is existence and directory-ness, we can just keep
|
||||
// `true` for files, and [children,...] for directories, or `false` for
|
||||
// things that don't exist.
|
||||
|
||||
module.exports = glob
|
||||
|
||||
var fs = require('fs')
|
||||
var minimatch = require('minimatch')
|
||||
var Minimatch = minimatch.Minimatch
|
||||
var inherits = require('inherits')
|
||||
var EE = require('events').EventEmitter
|
||||
var path = require('path')
|
||||
var assert = require('assert')
|
||||
var isAbsolute = require('path-is-absolute')
|
||||
var globSync = require('./sync.js')
|
||||
var common = require('./common.js')
|
||||
var alphasort = common.alphasort
|
||||
var alphasorti = common.alphasorti
|
||||
var setopts = common.setopts
|
||||
var ownProp = common.ownProp
|
||||
var inflight = require('inflight')
|
||||
var util = require('util')
|
||||
var childrenIgnored = common.childrenIgnored
|
||||
var isIgnored = common.isIgnored
|
||||
|
||||
var once = require('once')
|
||||
|
||||
function glob (pattern, options, cb) {
|
||||
if (typeof options === 'function') cb = options, options = {}
|
||||
if (!options) options = {}
|
||||
|
||||
if (options.sync) {
|
||||
if (cb)
|
||||
throw new TypeError('callback provided to sync glob')
|
||||
return globSync(pattern, options)
|
||||
}
|
||||
|
||||
return new Glob(pattern, options, cb)
|
||||
}
|
||||
|
||||
glob.sync = globSync
|
||||
var GlobSync = glob.GlobSync = globSync.GlobSync
|
||||
|
||||
// old api surface
|
||||
glob.glob = glob
|
||||
|
||||
glob.hasMagic = function (pattern, options_) {
|
||||
var options = util._extend({}, options_)
|
||||
options.noprocess = true
|
||||
|
||||
var g = new Glob(pattern, options)
|
||||
var set = g.minimatch.set
|
||||
if (set.length > 1)
|
||||
return true
|
||||
|
||||
for (var j = 0; j < set[0].length; j++) {
|
||||
if (typeof set[0][j] !== 'string')
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
glob.Glob = Glob
|
||||
inherits(Glob, EE)
|
||||
function Glob (pattern, options, cb) {
|
||||
if (typeof options === 'function') {
|
||||
cb = options
|
||||
options = null
|
||||
}
|
||||
|
||||
if (options && options.sync) {
|
||||
if (cb)
|
||||
throw new TypeError('callback provided to sync glob')
|
||||
return new GlobSync(pattern, options)
|
||||
}
|
||||
|
||||
if (!(this instanceof Glob))
|
||||
return new Glob(pattern, options, cb)
|
||||
|
||||
setopts(this, pattern, options)
|
||||
this._didRealPath = false
|
||||
|
||||
// process each pattern in the minimatch set
|
||||
var n = this.minimatch.set.length
|
||||
|
||||
// The matches are stored as {<filename>: true,...} so that
|
||||
// duplicates are automagically pruned.
|
||||
// Later, we do an Object.keys() on these.
|
||||
// Keep them as a list so we can fill in when nonull is set.
|
||||
this.matches = new Array(n)
|
||||
|
||||
if (typeof cb === 'function') {
|
||||
cb = once(cb)
|
||||
this.on('error', cb)
|
||||
this.on('end', function (matches) {
|
||||
cb(null, matches)
|
||||
})
|
||||
}
|
||||
|
||||
var self = this
|
||||
var n = this.minimatch.set.length
|
||||
this._processing = 0
|
||||
this.matches = new Array(n)
|
||||
|
||||
this._emitQueue = []
|
||||
this._processQueue = []
|
||||
this.paused = false
|
||||
|
||||
if (this.noprocess)
|
||||
return this
|
||||
|
||||
if (n === 0)
|
||||
return done()
|
||||
|
||||
for (var i = 0; i < n; i ++) {
|
||||
this._process(this.minimatch.set[i], i, false, done)
|
||||
}
|
||||
|
||||
function done () {
|
||||
--self._processing
|
||||
if (self._processing <= 0)
|
||||
self._finish()
|
||||
}
|
||||
}
|
||||
|
||||
Glob.prototype._finish = function () {
|
||||
assert(this instanceof Glob)
|
||||
if (this.aborted)
|
||||
return
|
||||
|
||||
if (this.realpath && !this._didRealpath)
|
||||
return this._realpath()
|
||||
|
||||
common.finish(this)
|
||||
this.emit('end', this.found)
|
||||
}
|
||||
|
||||
Glob.prototype._realpath = function () {
|
||||
if (this._didRealpath)
|
||||
return
|
||||
|
||||
this._didRealpath = true
|
||||
|
||||
var n = this.matches.length
|
||||
if (n === 0)
|
||||
return this._finish()
|
||||
|
||||
var self = this
|
||||
for (var i = 0; i < this.matches.length; i++)
|
||||
this._realpathSet(i, next)
|
||||
|
||||
function next () {
|
||||
if (--n === 0)
|
||||
self._finish()
|
||||
}
|
||||
}
|
||||
|
||||
Glob.prototype._realpathSet = function (index, cb) {
|
||||
var matchset = this.matches[index]
|
||||
if (!matchset)
|
||||
return cb()
|
||||
|
||||
var found = Object.keys(matchset)
|
||||
var self = this
|
||||
var n = found.length
|
||||
|
||||
if (n === 0)
|
||||
return cb()
|
||||
|
||||
var set = this.matches[index] = Object.create(null)
|
||||
found.forEach(function (p, i) {
|
||||
// If there's a problem with the stat, then it means that
|
||||
// one or more of the links in the realpath couldn't be
|
||||
// resolved. just return the abs value in that case.
|
||||
p = self._makeAbs(p)
|
||||
fs.realpath(p, self.realpathCache, function (er, real) {
|
||||
if (!er)
|
||||
set[real] = true
|
||||
else if (er.syscall === 'stat')
|
||||
set[p] = true
|
||||
else
|
||||
self.emit('error', er) // srsly wtf right here
|
||||
|
||||
if (--n === 0) {
|
||||
self.matches[index] = set
|
||||
cb()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Glob.prototype._mark = function (p) {
|
||||
return common.mark(this, p)
|
||||
}
|
||||
|
||||
Glob.prototype._makeAbs = function (f) {
|
||||
return common.makeAbs(this, f)
|
||||
}
|
||||
|
||||
Glob.prototype.abort = function () {
|
||||
this.aborted = true
|
||||
this.emit('abort')
|
||||
}
|
||||
|
||||
Glob.prototype.pause = function () {
|
||||
if (!this.paused) {
|
||||
this.paused = true
|
||||
this.emit('pause')
|
||||
}
|
||||
}
|
||||
|
||||
Glob.prototype.resume = function () {
|
||||
if (this.paused) {
|
||||
this.emit('resume')
|
||||
this.paused = false
|
||||
if (this._emitQueue.length) {
|
||||
var eq = this._emitQueue.slice(0)
|
||||
this._emitQueue.length = 0
|
||||
for (var i = 0; i < eq.length; i ++) {
|
||||
var e = eq[i]
|
||||
this._emitMatch(e[0], e[1])
|
||||
}
|
||||
}
|
||||
if (this._processQueue.length) {
|
||||
var pq = this._processQueue.slice(0)
|
||||
this._processQueue.length = 0
|
||||
for (var i = 0; i < pq.length; i ++) {
|
||||
var p = pq[i]
|
||||
this._processing--
|
||||
this._process(p[0], p[1], p[2], p[3])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
|
||||
assert(this instanceof Glob)
|
||||
assert(typeof cb === 'function')
|
||||
|
||||
if (this.aborted)
|
||||
return
|
||||
|
||||
this._processing++
|
||||
if (this.paused) {
|
||||
this._processQueue.push([pattern, index, inGlobStar, cb])
|
||||
return
|
||||
}
|
||||
|
||||
//console.error('PROCESS %d', this._processing, pattern)
|
||||
|
||||
// Get the first [n] parts of pattern that are all strings.
|
||||
var n = 0
|
||||
while (typeof pattern[n] === 'string') {
|
||||
n ++
|
||||
}
|
||||
// now n is the index of the first one that is *not* a string.
|
||||
|
||||
// see if there's anything else
|
||||
var prefix
|
||||
switch (n) {
|
||||
// if not, then this is rather simple
|
||||
case pattern.length:
|
||||
this._processSimple(pattern.join('/'), index, cb)
|
||||
return
|
||||
|
||||
case 0:
|
||||
// pattern *starts* with some non-trivial item.
|
||||
// going to readdir(cwd), but not include the prefix in matches.
|
||||
prefix = null
|
||||
break
|
||||
|
||||
default:
|
||||
// pattern has some string bits in the front.
|
||||
// whatever it starts with, whether that's 'absolute' like /foo/bar,
|
||||
// or 'relative' like '../baz'
|
||||
prefix = pattern.slice(0, n).join('/')
|
||||
break
|
||||
}
|
||||
|
||||
var remain = pattern.slice(n)
|
||||
|
||||
// get the list of entries.
|
||||
var read
|
||||
if (prefix === null)
|
||||
read = '.'
|
||||
else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
|
||||
if (!prefix || !isAbsolute(prefix))
|
||||
prefix = '/' + prefix
|
||||
read = prefix
|
||||
} else
|
||||
read = prefix
|
||||
|
||||
var abs = this._makeAbs(read)
|
||||
|
||||
//if ignored, skip _processing
|
||||
if (childrenIgnored(this, read))
|
||||
return cb()
|
||||
|
||||
var isGlobStar = remain[0] === minimatch.GLOBSTAR
|
||||
if (isGlobStar)
|
||||
this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb)
|
||||
else
|
||||
this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb)
|
||||
}
|
||||
|
||||
Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) {
|
||||
var self = this
|
||||
this._readdir(abs, inGlobStar, function (er, entries) {
|
||||
return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
|
||||
})
|
||||
}
|
||||
|
||||
Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
|
||||
|
||||
// if the abs isn't a dir, then nothing can match!
|
||||
if (!entries)
|
||||
return cb()
|
||||
|
||||
// It will only match dot entries if it starts with a dot, or if
|
||||
// dot is set. Stuff like @(.foo|.bar) isn't allowed.
|
||||
var pn = remain[0]
|
||||
var negate = !!this.minimatch.negate
|
||||
var rawGlob = pn._glob
|
||||
var dotOk = this.dot || rawGlob.charAt(0) === '.'
|
||||
|
||||
var matchedEntries = []
|
||||
for (var i = 0; i < entries.length; i++) {
|
||||
var e = entries[i]
|
||||
if (e.charAt(0) !== '.' || dotOk) {
|
||||
var m
|
||||
if (negate && !prefix) {
|
||||
m = !e.match(pn)
|
||||
} else {
|
||||
m = e.match(pn)
|
||||
}
|
||||
if (m)
|
||||
matchedEntries.push(e)
|
||||
}
|
||||
}
|
||||
|
||||
//console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries)
|
||||
|
||||
var len = matchedEntries.length
|
||||
// If there are no matched entries, then nothing matches.
|
||||
if (len === 0)
|
||||
return cb()
|
||||
|
||||
// if this is the last remaining pattern bit, then no need for
|
||||
// an additional stat *unless* the user has specified mark or
|
||||
// stat explicitly. We know they exist, since readdir returned
|
||||
// them.
|
||||
|
||||
if (remain.length === 1 && !this.mark && !this.stat) {
|
||||
if (!this.matches[index])
|
||||
this.matches[index] = Object.create(null)
|
||||
|
||||
for (var i = 0; i < len; i ++) {
|
||||
var e = matchedEntries[i]
|
||||
if (prefix) {
|
||||
if (prefix !== '/')
|
||||
e = prefix + '/' + e
|
||||
else
|
||||
e = prefix + e
|
||||
}
|
||||
|
||||
if (e.charAt(0) === '/' && !this.nomount) {
|
||||
e = path.join(this.root, e)
|
||||
}
|
||||
this._emitMatch(index, e)
|
||||
}
|
||||
// This was the last one, and no stats were needed
|
||||
return cb()
|
||||
}
|
||||
|
||||
// now test all matched entries as stand-ins for that part
|
||||
// of the pattern.
|
||||
remain.shift()
|
||||
for (var i = 0; i < len; i ++) {
|
||||
var e = matchedEntries[i]
|
||||
var newPattern
|
||||
if (prefix) {
|
||||
if (prefix !== '/')
|
||||
e = prefix + '/' + e
|
||||
else
|
||||
e = prefix + e
|
||||
}
|
||||
this._process([e].concat(remain), index, inGlobStar, cb)
|
||||
}
|
||||
cb()
|
||||
}
|
||||
|
||||
Glob.prototype._emitMatch = function (index, e) {
|
||||
if (this.aborted)
|
||||
return
|
||||
|
||||
if (this.matches[index][e])
|
||||
return
|
||||
|
||||
if (isIgnored(this, e))
|
||||
return
|
||||
|
||||
if (this.paused) {
|
||||
this._emitQueue.push([index, e])
|
||||
return
|
||||
}
|
||||
|
||||
var abs = this._makeAbs(e)
|
||||
|
||||
if (this.nodir) {
|
||||
var c = this.cache[abs]
|
||||
if (c === 'DIR' || Array.isArray(c))
|
||||
return
|
||||
}
|
||||
|
||||
if (this.mark)
|
||||
e = this._mark(e)
|
||||
|
||||
this.matches[index][e] = true
|
||||
|
||||
var st = this.statCache[abs]
|
||||
if (st)
|
||||
this.emit('stat', e, st)
|
||||
|
||||
this.emit('match', e)
|
||||
}
|
||||
|
||||
Glob.prototype._readdirInGlobStar = function (abs, cb) {
|
||||
if (this.aborted)
|
||||
return
|
||||
|
||||
// follow all symlinked directories forever
|
||||
// just proceed as if this is a non-globstar situation
|
||||
if (this.follow)
|
||||
return this._readdir(abs, false, cb)
|
||||
|
||||
var lstatkey = 'lstat\0' + abs
|
||||
var self = this
|
||||
var lstatcb = inflight(lstatkey, lstatcb_)
|
||||
|
||||
if (lstatcb)
|
||||
fs.lstat(abs, lstatcb)
|
||||
|
||||
function lstatcb_ (er, lstat) {
|
||||
if (er)
|
||||
return cb()
|
||||
|
||||
var isSym = lstat.isSymbolicLink()
|
||||
self.symlinks[abs] = isSym
|
||||
|
||||
// If it's not a symlink or a dir, then it's definitely a regular file.
|
||||
// don't bother doing a readdir in that case.
|
||||
if (!isSym && !lstat.isDirectory()) {
|
||||
self.cache[abs] = 'FILE'
|
||||
cb()
|
||||
} else
|
||||
self._readdir(abs, false, cb)
|
||||
}
|
||||
}
|
||||
|
||||
Glob.prototype._readdir = function (abs, inGlobStar, cb) {
|
||||
if (this.aborted)
|
||||
return
|
||||
|
||||
cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb)
|
||||
if (!cb)
|
||||
return
|
||||
|
||||
//console.error('RD %j %j', +inGlobStar, abs)
|
||||
if (inGlobStar && !ownProp(this.symlinks, abs))
|
||||
return this._readdirInGlobStar(abs, cb)
|
||||
|
||||
if (ownProp(this.cache, abs)) {
|
||||
var c = this.cache[abs]
|
||||
if (!c || c === 'FILE')
|
||||
return cb()
|
||||
|
||||
if (Array.isArray(c))
|
||||
return cb(null, c)
|
||||
}
|
||||
|
||||
var self = this
|
||||
fs.readdir(abs, readdirCb(this, abs, cb))
|
||||
}
|
||||
|
||||
function readdirCb (self, abs, cb) {
|
||||
return function (er, entries) {
|
||||
if (er)
|
||||
self._readdirError(abs, er, cb)
|
||||
else
|
||||
self._readdirEntries(abs, entries, cb)
|
||||
}
|
||||
}
|
||||
|
||||
Glob.prototype._readdirEntries = function (abs, entries, cb) {
|
||||
if (this.aborted)
|
||||
return
|
||||
|
||||
// if we haven't asked to stat everything, then just
|
||||
// assume that everything in there exists, so we can avoid
|
||||
// having to stat it a second time.
|
||||
if (!this.mark && !this.stat) {
|
||||
for (var i = 0; i < entries.length; i ++) {
|
||||
var e = entries[i]
|
||||
if (abs === '/')
|
||||
e = abs + e
|
||||
else
|
||||
e = abs + '/' + e
|
||||
this.cache[e] = true
|
||||
}
|
||||
}
|
||||
|
||||
this.cache[abs] = entries
|
||||
return cb(null, entries)
|
||||
}
|
||||
|
||||
Glob.prototype._readdirError = function (f, er, cb) {
|
||||
if (this.aborted)
|
||||
return
|
||||
|
||||
// handle errors, and cache the information
|
||||
switch (er.code) {
|
||||
case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
|
||||
case 'ENOTDIR': // totally normal. means it *does* exist.
|
||||
this.cache[this._makeAbs(f)] = 'FILE'
|
||||
break
|
||||
|
||||
case 'ENOENT': // not terribly unusual
|
||||
case 'ELOOP':
|
||||
case 'ENAMETOOLONG':
|
||||
case 'UNKNOWN':
|
||||
this.cache[this._makeAbs(f)] = false
|
||||
break
|
||||
|
||||
default: // some unusual error. Treat as failure.
|
||||
this.cache[this._makeAbs(f)] = false
|
||||
if (this.strict) {
|
||||
this.emit('error', er)
|
||||
// If the error is handled, then we abort
|
||||
// if not, we threw out of here
|
||||
this.abort()
|
||||
}
|
||||
if (!this.silent)
|
||||
console.error('glob error', er)
|
||||
break
|
||||
}
|
||||
|
||||
return cb()
|
||||
}
|
||||
|
||||
Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) {
|
||||
var self = this
|
||||
this._readdir(abs, inGlobStar, function (er, entries) {
|
||||
self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
|
||||
//console.error('pgs2', prefix, remain[0], entries)
|
||||
|
||||
// no entries means not a dir, so it can never have matches
|
||||
// foo.txt/** doesn't match foo.txt
|
||||
if (!entries)
|
||||
return cb()
|
||||
|
||||
// test without the globstar, and with every child both below
|
||||
// and replacing the globstar.
|
||||
var remainWithoutGlobStar = remain.slice(1)
|
||||
var gspref = prefix ? [ prefix ] : []
|
||||
var noGlobStar = gspref.concat(remainWithoutGlobStar)
|
||||
|
||||
// the noGlobStar pattern exits the inGlobStar state
|
||||
this._process(noGlobStar, index, false, cb)
|
||||
|
||||
var isSym = this.symlinks[abs]
|
||||
var len = entries.length
|
||||
|
||||
// If it's a symlink, and we're in a globstar, then stop
|
||||
if (isSym && inGlobStar)
|
||||
return cb()
|
||||
|
||||
for (var i = 0; i < len; i++) {
|
||||
var e = entries[i]
|
||||
if (e.charAt(0) === '.' && !this.dot)
|
||||
continue
|
||||
|
||||
// these two cases enter the inGlobStar state
|
||||
var instead = gspref.concat(entries[i], remainWithoutGlobStar)
|
||||
this._process(instead, index, true, cb)
|
||||
|
||||
var below = gspref.concat(entries[i], remain)
|
||||
this._process(below, index, true, cb)
|
||||
}
|
||||
|
||||
cb()
|
||||
}
|
||||
|
||||
Glob.prototype._processSimple = function (prefix, index, cb) {
|
||||
// XXX review this. Shouldn't it be doing the mounting etc
|
||||
// before doing stat? kinda weird?
|
||||
var self = this
|
||||
this._stat(prefix, function (er, exists) {
|
||||
self._processSimple2(prefix, index, er, exists, cb)
|
||||
})
|
||||
}
|
||||
Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) {
|
||||
|
||||
//console.error('ps2', prefix, exists)
|
||||
|
||||
if (!this.matches[index])
|
||||
this.matches[index] = Object.create(null)
|
||||
|
||||
// If it doesn't exist, then just mark the lack of results
|
||||
if (!exists)
|
||||
return cb()
|
||||
|
||||
if (prefix && isAbsolute(prefix) && !this.nomount) {
|
||||
var trail = /[\/\\]$/.test(prefix)
|
||||
if (prefix.charAt(0) === '/') {
|
||||
prefix = path.join(this.root, prefix)
|
||||
} else {
|
||||
prefix = path.resolve(this.root, prefix)
|
||||
if (trail)
|
||||
prefix += '/'
|
||||
}
|
||||
}
|
||||
|
||||
if (process.platform === 'win32')
|
||||
prefix = prefix.replace(/\\/g, '/')
|
||||
|
||||
// Mark this as a match
|
||||
this._emitMatch(index, prefix)
|
||||
cb()
|
||||
}
|
||||
|
||||
// Returns either 'DIR', 'FILE', or false
|
||||
Glob.prototype._stat = function (f, cb) {
|
||||
var abs = this._makeAbs(f)
|
||||
var needDir = f.slice(-1) === '/'
|
||||
|
||||
if (f.length > this.maxLength)
|
||||
return cb()
|
||||
|
||||
if (!this.stat && ownProp(this.cache, abs)) {
|
||||
var c = this.cache[abs]
|
||||
|
||||
if (Array.isArray(c))
|
||||
c = 'DIR'
|
||||
|
||||
// It exists, but maybe not how we need it
|
||||
if (!needDir || c === 'DIR')
|
||||
return cb(null, c)
|
||||
|
||||
if (needDir && c === 'FILE')
|
||||
return cb()
|
||||
|
||||
// otherwise we have to stat, because maybe c=true
|
||||
// if we know it exists, but not what it is.
|
||||
}
|
||||
|
||||
var exists
|
||||
var stat = this.statCache[abs]
|
||||
if (stat !== undefined) {
|
||||
if (stat === false)
|
||||
return cb(null, stat)
|
||||
else {
|
||||
var type = stat.isDirectory() ? 'DIR' : 'FILE'
|
||||
if (needDir && type === 'FILE')
|
||||
return cb()
|
||||
else
|
||||
return cb(null, type, stat)
|
||||
}
|
||||
}
|
||||
|
||||
var self = this
|
||||
var statcb = inflight('stat\0' + abs, lstatcb_)
|
||||
if (statcb)
|
||||
fs.lstat(abs, statcb)
|
||||
|
||||
function lstatcb_ (er, lstat) {
|
||||
if (lstat && lstat.isSymbolicLink()) {
|
||||
// If it's a symlink, then treat it as the target, unless
|
||||
// the target does not exist, then treat it as a file.
|
||||
return fs.stat(abs, function (er, stat) {
|
||||
if (er)
|
||||
self._stat2(f, abs, null, lstat, cb)
|
||||
else
|
||||
self._stat2(f, abs, er, stat, cb)
|
||||
})
|
||||
} else {
|
||||
self._stat2(f, abs, er, lstat, cb)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
|
||||
if (er) {
|
||||
this.statCache[abs] = false
|
||||
return cb()
|
||||
}
|
||||
|
||||
var needDir = f.slice(-1) === '/'
|
||||
this.statCache[abs] = stat
|
||||
|
||||
if (abs.slice(-1) === '/' && !stat.isDirectory())
|
||||
return cb(null, false, stat)
|
||||
|
||||
var c = stat.isDirectory() ? 'DIR' : 'FILE'
|
||||
this.cache[abs] = this.cache[abs] || c
|
||||
|
||||
if (needDir && c !== 'DIR')
|
||||
return cb()
|
||||
|
||||
return cb(null, c, stat)
|
||||
}
|
||||
42
node_modules/decompress/node_modules/glob/package.json
generated
vendored
Normal file
42
node_modules/decompress/node_modules/glob/package.json
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
|
||||
"name": "glob",
|
||||
"description": "a little globber",
|
||||
"version": "5.0.15",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/isaacs/node-glob.git"
|
||||
},
|
||||
"main": "glob.js",
|
||||
"files": [
|
||||
"glob.js",
|
||||
"sync.js",
|
||||
"common.js"
|
||||
],
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "2 || 3",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mkdirp": "0",
|
||||
"rimraf": "^2.2.8",
|
||||
"tap": "^1.1.4",
|
||||
"tick": "0.0.6"
|
||||
},
|
||||
"scripts": {
|
||||
"prepublish": "npm run benchclean",
|
||||
"profclean": "rm -f v8.log profile.txt",
|
||||
"test": "tap test/*.js --cov",
|
||||
"test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js",
|
||||
"bench": "bash benchmark.sh",
|
||||
"prof": "bash prof.sh && cat profile.txt",
|
||||
"benchclean": "node benchclean.js"
|
||||
},
|
||||
"license": "ISC"
|
||||
}
|
||||
460
node_modules/decompress/node_modules/glob/sync.js
generated
vendored
Normal file
460
node_modules/decompress/node_modules/glob/sync.js
generated
vendored
Normal file
@@ -0,0 +1,460 @@
|
||||
module.exports = globSync
|
||||
globSync.GlobSync = GlobSync
|
||||
|
||||
var fs = require('fs')
|
||||
var minimatch = require('minimatch')
|
||||
var Minimatch = minimatch.Minimatch
|
||||
var Glob = require('./glob.js').Glob
|
||||
var util = require('util')
|
||||
var path = require('path')
|
||||
var assert = require('assert')
|
||||
var isAbsolute = require('path-is-absolute')
|
||||
var common = require('./common.js')
|
||||
var alphasort = common.alphasort
|
||||
var alphasorti = common.alphasorti
|
||||
var setopts = common.setopts
|
||||
var ownProp = common.ownProp
|
||||
var childrenIgnored = common.childrenIgnored
|
||||
|
||||
function globSync (pattern, options) {
|
||||
if (typeof options === 'function' || arguments.length === 3)
|
||||
throw new TypeError('callback provided to sync glob\n'+
|
||||
'See: https://github.com/isaacs/node-glob/issues/167')
|
||||
|
||||
return new GlobSync(pattern, options).found
|
||||
}
|
||||
|
||||
function GlobSync (pattern, options) {
|
||||
if (!pattern)
|
||||
throw new Error('must provide pattern')
|
||||
|
||||
if (typeof options === 'function' || arguments.length === 3)
|
||||
throw new TypeError('callback provided to sync glob\n'+
|
||||
'See: https://github.com/isaacs/node-glob/issues/167')
|
||||
|
||||
if (!(this instanceof GlobSync))
|
||||
return new GlobSync(pattern, options)
|
||||
|
||||
setopts(this, pattern, options)
|
||||
|
||||
if (this.noprocess)
|
||||
return this
|
||||
|
||||
var n = this.minimatch.set.length
|
||||
this.matches = new Array(n)
|
||||
for (var i = 0; i < n; i ++) {
|
||||
this._process(this.minimatch.set[i], i, false)
|
||||
}
|
||||
this._finish()
|
||||
}
|
||||
|
||||
GlobSync.prototype._finish = function () {
|
||||
assert(this instanceof GlobSync)
|
||||
if (this.realpath) {
|
||||
var self = this
|
||||
this.matches.forEach(function (matchset, index) {
|
||||
var set = self.matches[index] = Object.create(null)
|
||||
for (var p in matchset) {
|
||||
try {
|
||||
p = self._makeAbs(p)
|
||||
var real = fs.realpathSync(p, self.realpathCache)
|
||||
set[real] = true
|
||||
} catch (er) {
|
||||
if (er.syscall === 'stat')
|
||||
set[self._makeAbs(p)] = true
|
||||
else
|
||||
throw er
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
common.finish(this)
|
||||
}
|
||||
|
||||
|
||||
GlobSync.prototype._process = function (pattern, index, inGlobStar) {
|
||||
assert(this instanceof GlobSync)
|
||||
|
||||
// Get the first [n] parts of pattern that are all strings.
|
||||
var n = 0
|
||||
while (typeof pattern[n] === 'string') {
|
||||
n ++
|
||||
}
|
||||
// now n is the index of the first one that is *not* a string.
|
||||
|
||||
// See if there's anything else
|
||||
var prefix
|
||||
switch (n) {
|
||||
// if not, then this is rather simple
|
||||
case pattern.length:
|
||||
this._processSimple(pattern.join('/'), index)
|
||||
return
|
||||
|
||||
case 0:
|
||||
// pattern *starts* with some non-trivial item.
|
||||
// going to readdir(cwd), but not include the prefix in matches.
|
||||
prefix = null
|
||||
break
|
||||
|
||||
default:
|
||||
// pattern has some string bits in the front.
|
||||
// whatever it starts with, whether that's 'absolute' like /foo/bar,
|
||||
// or 'relative' like '../baz'
|
||||
prefix = pattern.slice(0, n).join('/')
|
||||
break
|
||||
}
|
||||
|
||||
var remain = pattern.slice(n)
|
||||
|
||||
// get the list of entries.
|
||||
var read
|
||||
if (prefix === null)
|
||||
read = '.'
|
||||
else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
|
||||
if (!prefix || !isAbsolute(prefix))
|
||||
prefix = '/' + prefix
|
||||
read = prefix
|
||||
} else
|
||||
read = prefix
|
||||
|
||||
var abs = this._makeAbs(read)
|
||||
|
||||
//if ignored, skip processing
|
||||
if (childrenIgnored(this, read))
|
||||
return
|
||||
|
||||
var isGlobStar = remain[0] === minimatch.GLOBSTAR
|
||||
if (isGlobStar)
|
||||
this._processGlobStar(prefix, read, abs, remain, index, inGlobStar)
|
||||
else
|
||||
this._processReaddir(prefix, read, abs, remain, index, inGlobStar)
|
||||
}
|
||||
|
||||
|
||||
GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {
|
||||
var entries = this._readdir(abs, inGlobStar)
|
||||
|
||||
// if the abs isn't a dir, then nothing can match!
|
||||
if (!entries)
|
||||
return
|
||||
|
||||
// It will only match dot entries if it starts with a dot, or if
|
||||
// dot is set. Stuff like @(.foo|.bar) isn't allowed.
|
||||
var pn = remain[0]
|
||||
var negate = !!this.minimatch.negate
|
||||
var rawGlob = pn._glob
|
||||
var dotOk = this.dot || rawGlob.charAt(0) === '.'
|
||||
|
||||
var matchedEntries = []
|
||||
for (var i = 0; i < entries.length; i++) {
|
||||
var e = entries[i]
|
||||
if (e.charAt(0) !== '.' || dotOk) {
|
||||
var m
|
||||
if (negate && !prefix) {
|
||||
m = !e.match(pn)
|
||||
} else {
|
||||
m = e.match(pn)
|
||||
}
|
||||
if (m)
|
||||
matchedEntries.push(e)
|
||||
}
|
||||
}
|
||||
|
||||
var len = matchedEntries.length
|
||||
// If there are no matched entries, then nothing matches.
|
||||
if (len === 0)
|
||||
return
|
||||
|
||||
// if this is the last remaining pattern bit, then no need for
|
||||
// an additional stat *unless* the user has specified mark or
|
||||
// stat explicitly. We know they exist, since readdir returned
|
||||
// them.
|
||||
|
||||
if (remain.length === 1 && !this.mark && !this.stat) {
|
||||
if (!this.matches[index])
|
||||
this.matches[index] = Object.create(null)
|
||||
|
||||
for (var i = 0; i < len; i ++) {
|
||||
var e = matchedEntries[i]
|
||||
if (prefix) {
|
||||
if (prefix.slice(-1) !== '/')
|
||||
e = prefix + '/' + e
|
||||
else
|
||||
e = prefix + e
|
||||
}
|
||||
|
||||
if (e.charAt(0) === '/' && !this.nomount) {
|
||||
e = path.join(this.root, e)
|
||||
}
|
||||
this.matches[index][e] = true
|
||||
}
|
||||
// This was the last one, and no stats were needed
|
||||
return
|
||||
}
|
||||
|
||||
// now test all matched entries as stand-ins for that part
|
||||
// of the pattern.
|
||||
remain.shift()
|
||||
for (var i = 0; i < len; i ++) {
|
||||
var e = matchedEntries[i]
|
||||
var newPattern
|
||||
if (prefix)
|
||||
newPattern = [prefix, e]
|
||||
else
|
||||
newPattern = [e]
|
||||
this._process(newPattern.concat(remain), index, inGlobStar)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GlobSync.prototype._emitMatch = function (index, e) {
|
||||
var abs = this._makeAbs(e)
|
||||
if (this.mark)
|
||||
e = this._mark(e)
|
||||
|
||||
if (this.matches[index][e])
|
||||
return
|
||||
|
||||
if (this.nodir) {
|
||||
var c = this.cache[this._makeAbs(e)]
|
||||
if (c === 'DIR' || Array.isArray(c))
|
||||
return
|
||||
}
|
||||
|
||||
this.matches[index][e] = true
|
||||
if (this.stat)
|
||||
this._stat(e)
|
||||
}
|
||||
|
||||
|
||||
GlobSync.prototype._readdirInGlobStar = function (abs) {
|
||||
// follow all symlinked directories forever
|
||||
// just proceed as if this is a non-globstar situation
|
||||
if (this.follow)
|
||||
return this._readdir(abs, false)
|
||||
|
||||
var entries
|
||||
var lstat
|
||||
var stat
|
||||
try {
|
||||
lstat = fs.lstatSync(abs)
|
||||
} catch (er) {
|
||||
// lstat failed, doesn't exist
|
||||
return null
|
||||
}
|
||||
|
||||
var isSym = lstat.isSymbolicLink()
|
||||
this.symlinks[abs] = isSym
|
||||
|
||||
// If it's not a symlink or a dir, then it's definitely a regular file.
|
||||
// don't bother doing a readdir in that case.
|
||||
if (!isSym && !lstat.isDirectory())
|
||||
this.cache[abs] = 'FILE'
|
||||
else
|
||||
entries = this._readdir(abs, false)
|
||||
|
||||
return entries
|
||||
}
|
||||
|
||||
GlobSync.prototype._readdir = function (abs, inGlobStar) {
|
||||
var entries
|
||||
|
||||
if (inGlobStar && !ownProp(this.symlinks, abs))
|
||||
return this._readdirInGlobStar(abs)
|
||||
|
||||
if (ownProp(this.cache, abs)) {
|
||||
var c = this.cache[abs]
|
||||
if (!c || c === 'FILE')
|
||||
return null
|
||||
|
||||
if (Array.isArray(c))
|
||||
return c
|
||||
}
|
||||
|
||||
try {
|
||||
return this._readdirEntries(abs, fs.readdirSync(abs))
|
||||
} catch (er) {
|
||||
this._readdirError(abs, er)
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
GlobSync.prototype._readdirEntries = function (abs, entries) {
|
||||
// if we haven't asked to stat everything, then just
|
||||
// assume that everything in there exists, so we can avoid
|
||||
// having to stat it a second time.
|
||||
if (!this.mark && !this.stat) {
|
||||
for (var i = 0; i < entries.length; i ++) {
|
||||
var e = entries[i]
|
||||
if (abs === '/')
|
||||
e = abs + e
|
||||
else
|
||||
e = abs + '/' + e
|
||||
this.cache[e] = true
|
||||
}
|
||||
}
|
||||
|
||||
this.cache[abs] = entries
|
||||
|
||||
// mark and cache dir-ness
|
||||
return entries
|
||||
}
|
||||
|
||||
GlobSync.prototype._readdirError = function (f, er) {
|
||||
// handle errors, and cache the information
|
||||
switch (er.code) {
|
||||
case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
|
||||
case 'ENOTDIR': // totally normal. means it *does* exist.
|
||||
this.cache[this._makeAbs(f)] = 'FILE'
|
||||
break
|
||||
|
||||
case 'ENOENT': // not terribly unusual
|
||||
case 'ELOOP':
|
||||
case 'ENAMETOOLONG':
|
||||
case 'UNKNOWN':
|
||||
this.cache[this._makeAbs(f)] = false
|
||||
break
|
||||
|
||||
default: // some unusual error. Treat as failure.
|
||||
this.cache[this._makeAbs(f)] = false
|
||||
if (this.strict)
|
||||
throw er
|
||||
if (!this.silent)
|
||||
console.error('glob error', er)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {
|
||||
|
||||
var entries = this._readdir(abs, inGlobStar)
|
||||
|
||||
// no entries means not a dir, so it can never have matches
|
||||
// foo.txt/** doesn't match foo.txt
|
||||
if (!entries)
|
||||
return
|
||||
|
||||
// test without the globstar, and with every child both below
|
||||
// and replacing the globstar.
|
||||
var remainWithoutGlobStar = remain.slice(1)
|
||||
var gspref = prefix ? [ prefix ] : []
|
||||
var noGlobStar = gspref.concat(remainWithoutGlobStar)
|
||||
|
||||
// the noGlobStar pattern exits the inGlobStar state
|
||||
this._process(noGlobStar, index, false)
|
||||
|
||||
var len = entries.length
|
||||
var isSym = this.symlinks[abs]
|
||||
|
||||
// If it's a symlink, and we're in a globstar, then stop
|
||||
if (isSym && inGlobStar)
|
||||
return
|
||||
|
||||
for (var i = 0; i < len; i++) {
|
||||
var e = entries[i]
|
||||
if (e.charAt(0) === '.' && !this.dot)
|
||||
continue
|
||||
|
||||
// these two cases enter the inGlobStar state
|
||||
var instead = gspref.concat(entries[i], remainWithoutGlobStar)
|
||||
this._process(instead, index, true)
|
||||
|
||||
var below = gspref.concat(entries[i], remain)
|
||||
this._process(below, index, true)
|
||||
}
|
||||
}
|
||||
|
||||
GlobSync.prototype._processSimple = function (prefix, index) {
|
||||
// XXX review this. Shouldn't it be doing the mounting etc
|
||||
// before doing stat? kinda weird?
|
||||
var exists = this._stat(prefix)
|
||||
|
||||
if (!this.matches[index])
|
||||
this.matches[index] = Object.create(null)
|
||||
|
||||
// If it doesn't exist, then just mark the lack of results
|
||||
if (!exists)
|
||||
return
|
||||
|
||||
if (prefix && isAbsolute(prefix) && !this.nomount) {
|
||||
var trail = /[\/\\]$/.test(prefix)
|
||||
if (prefix.charAt(0) === '/') {
|
||||
prefix = path.join(this.root, prefix)
|
||||
} else {
|
||||
prefix = path.resolve(this.root, prefix)
|
||||
if (trail)
|
||||
prefix += '/'
|
||||
}
|
||||
}
|
||||
|
||||
if (process.platform === 'win32')
|
||||
prefix = prefix.replace(/\\/g, '/')
|
||||
|
||||
// Mark this as a match
|
||||
this.matches[index][prefix] = true
|
||||
}
|
||||
|
||||
// Returns either 'DIR', 'FILE', or false
|
||||
GlobSync.prototype._stat = function (f) {
|
||||
var abs = this._makeAbs(f)
|
||||
var needDir = f.slice(-1) === '/'
|
||||
|
||||
if (f.length > this.maxLength)
|
||||
return false
|
||||
|
||||
if (!this.stat && ownProp(this.cache, abs)) {
|
||||
var c = this.cache[abs]
|
||||
|
||||
if (Array.isArray(c))
|
||||
c = 'DIR'
|
||||
|
||||
// It exists, but maybe not how we need it
|
||||
if (!needDir || c === 'DIR')
|
||||
return c
|
||||
|
||||
if (needDir && c === 'FILE')
|
||||
return false
|
||||
|
||||
// otherwise we have to stat, because maybe c=true
|
||||
// if we know it exists, but not what it is.
|
||||
}
|
||||
|
||||
var exists
|
||||
var stat = this.statCache[abs]
|
||||
if (!stat) {
|
||||
var lstat
|
||||
try {
|
||||
lstat = fs.lstatSync(abs)
|
||||
} catch (er) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (lstat.isSymbolicLink()) {
|
||||
try {
|
||||
stat = fs.statSync(abs)
|
||||
} catch (er) {
|
||||
stat = lstat
|
||||
}
|
||||
} else {
|
||||
stat = lstat
|
||||
}
|
||||
}
|
||||
|
||||
this.statCache[abs] = stat
|
||||
|
||||
var c = stat.isDirectory() ? 'DIR' : 'FILE'
|
||||
this.cache[abs] = this.cache[abs] || c
|
||||
|
||||
if (needDir && c !== 'DIR')
|
||||
return false
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
GlobSync.prototype._mark = function (p) {
|
||||
return common.mark(this, p)
|
||||
}
|
||||
|
||||
GlobSync.prototype._makeAbs = function (f) {
|
||||
return common.makeAbs(this, f)
|
||||
}
|
||||
13
node_modules/decompress/node_modules/gulp-sourcemaps/LICENSE.md
generated
vendored
Normal file
13
node_modules/decompress/node_modules/gulp-sourcemaps/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
Copyright (c) 2014, Florian Reiterer
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
252
node_modules/decompress/node_modules/gulp-sourcemaps/README.md
generated
vendored
Normal file
252
node_modules/decompress/node_modules/gulp-sourcemaps/README.md
generated
vendored
Normal file
@@ -0,0 +1,252 @@
|
||||
## gulp-sourcemaps [![NPM version][npm-image]][npm-url] [![build status][travis-image]][travis-url] [![Test coverage][coveralls-image]][coveralls-url]
|
||||
|
||||
### Usage
|
||||
|
||||
#### Write inline source maps
|
||||
Inline source maps are embedded in the source file.
|
||||
|
||||
Example:
|
||||
```javascript
|
||||
var gulp = require('gulp');
|
||||
var plugin1 = require('gulp-plugin1');
|
||||
var plugin2 = require('gulp-plugin2');
|
||||
var sourcemaps = require('gulp-sourcemaps');
|
||||
|
||||
gulp.task('javascript', function() {
|
||||
gulp.src('src/**/*.js')
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(plugin1())
|
||||
.pipe(plugin2())
|
||||
.pipe(sourcemaps.write())
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
```
|
||||
|
||||
All plugins between `sourcemaps.init()` and `sourcemaps.write()` need to have support for `gulp-sourcemaps`. You can find a list of such plugins in the [wiki](https://github.com/floridoo/gulp-sourcemaps/wiki/Plugins-with-gulp-sourcemaps-support).
|
||||
|
||||
|
||||
#### Write external source map files
|
||||
|
||||
To write external source map files, pass a path relative to the destination to `sourcemaps.write()`.
|
||||
|
||||
Example:
|
||||
```javascript
|
||||
var gulp = require('gulp');
|
||||
var plugin1 = require('gulp-plugin1');
|
||||
var plugin2 = require('gulp-plugin2');
|
||||
var sourcemaps = require('gulp-sourcemaps');
|
||||
|
||||
gulp.task('javascript', function() {
|
||||
gulp.src('src/**/*.js')
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(plugin1())
|
||||
.pipe(plugin2())
|
||||
.pipe(sourcemaps.write('../maps'))
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
```
|
||||
|
||||
#### Load existing source maps
|
||||
|
||||
To load existing source maps, pass the option `loadMaps: true` to `sourcemaps.init()`.
|
||||
|
||||
Example:
|
||||
```javascript
|
||||
var gulp = require('gulp');
|
||||
var plugin1 = require('gulp-plugin1');
|
||||
var plugin2 = require('gulp-plugin2');
|
||||
var sourcemaps = require('gulp-sourcemaps');
|
||||
|
||||
gulp.task('javascript', function() {
|
||||
gulp.src('src/**/*.js')
|
||||
.pipe(sourcemaps.init({loadMaps: true}))
|
||||
.pipe(plugin1())
|
||||
.pipe(plugin2())
|
||||
.pipe(sourcemaps.write())
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
```
|
||||
|
||||
#### Handle source files from different directories
|
||||
|
||||
Use the `base` option on `gulp.src` to make sure all files are relative to a common base directory.
|
||||
|
||||
Example:
|
||||
```javascript
|
||||
var gulp = require('gulp');
|
||||
var plugin1 = require('gulp-plugin1');
|
||||
var plugin2 = require('gulp-plugin2');
|
||||
var sourcemaps = require('gulp-sourcemaps');
|
||||
|
||||
gulp.task('javascript', function() {
|
||||
gulp.src(['src/test.js', 'src/testdir/test2.js'], { base: 'src' })
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(plugin1())
|
||||
.pipe(plugin2())
|
||||
.pipe(sourcemaps.write('../maps'))
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Init Options
|
||||
|
||||
- `loadMaps`
|
||||
Set to true to load existing maps for source files. Supports the following:
|
||||
- inline source maps
|
||||
- source map files referenced by a `sourceMappingURL=` comment
|
||||
- source map files with the same name (plus .map) in the same directory
|
||||
|
||||
- `debug`
|
||||
Set this to `true` to output debug messages (e.g. about missing source content).
|
||||
|
||||
### Write Options
|
||||
|
||||
- `addComment`
|
||||
|
||||
By default a comment containing / referencing the source map is added. Set this to `false` to disable the comment (e.g. if you want to load the source maps by header).
|
||||
|
||||
Example:
|
||||
```javascript
|
||||
gulp.task('javascript', function() {
|
||||
var stream = gulp.src('src/**/*.js')
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(plugin1())
|
||||
.pipe(plugin2())
|
||||
.pipe(sourcemaps.write('../maps', {addComment: false}))
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
```
|
||||
|
||||
- `includeContent`
|
||||
|
||||
By default the source maps include the source code. Pass `false` to use the original files.
|
||||
|
||||
Including the content is the recommended way, because it "just works". When setting this to `false` you have to host the source files and set the correct `sourceRoot`.
|
||||
|
||||
- `sourceRoot`
|
||||
|
||||
Set the path where the source files are hosted (use this when `includeContent` is set to `false`). This is an URL (or subpath) relative to the source map, not a local file system path. If you have sources in different subpaths, an absolute path (from the domain root) pointing to the source file root is recommended, or define it with a function.
|
||||
|
||||
Example:
|
||||
```javascript
|
||||
gulp.task('javascript', function() {
|
||||
var stream = gulp.src('src/**/*.js')
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(plugin1())
|
||||
.pipe(plugin2())
|
||||
.pipe(sourcemaps.write({includeContent: false, sourceRoot: '/src'}))
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
```
|
||||
|
||||
Example (using a function):
|
||||
```javascript
|
||||
gulp.task('javascript', function() {
|
||||
var stream = gulp.src('src/**/*.js')
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(plugin1())
|
||||
.pipe(plugin2())
|
||||
.pipe(sourcemaps.write({
|
||||
includeContent: false,
|
||||
sourceRoot: function(file) {
|
||||
return '/src';
|
||||
}
|
||||
}))
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
```
|
||||
|
||||
- `sourceMappingURLPrefix`
|
||||
|
||||
Specify a prefix to be prepended onto the source map URL when writing external source maps. Relative paths will have their leading dots stripped.
|
||||
|
||||
Example:
|
||||
```javascript
|
||||
gulp.task('javascript', function() {
|
||||
var stream = gulp.src('src/**/*.js')
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(plugin1())
|
||||
.pipe(plugin2())
|
||||
.pipe(sourcemaps.write('../maps', {
|
||||
sourceMappingURLPrefix: 'https://asset-host.example.com/assets'
|
||||
}))
|
||||
.pipe(gulp.dest('public/scripts'));
|
||||
});
|
||||
```
|
||||
|
||||
This will result in a source mapping URL comment like `sourceMappingURL=https://asset-host.example.com/assets/maps/helloworld.js.map`.
|
||||
|
||||
- `sourceMappingURL`
|
||||
|
||||
If you need full control over the source map URL you can pass a function to this option. The output of the function must be the full URL to the source map (in function of the output file).
|
||||
|
||||
Example:
|
||||
```javascript
|
||||
gulp.task('javascript', function() {
|
||||
var stream = gulp.src('src/**/*.js')
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(plugin1())
|
||||
.pipe(plugin2())
|
||||
.pipe(sourcemaps.write('../maps', {
|
||||
sourceMappingURL: function(file) {
|
||||
return 'https://asset-host.example.com/' + file.relative + '.map';
|
||||
}
|
||||
}))
|
||||
.pipe(gulp.dest('public/scripts'));
|
||||
});
|
||||
```
|
||||
|
||||
This will result in a source mapping URL comment like `sourceMappingURL=https://asset-host.example.com/helloworld.js.map`.
|
||||
|
||||
- `debug`
|
||||
|
||||
Set this to `true` to output debug messages (e.g. about missing source content).
|
||||
|
||||
### Plugin developers only: How to add source map support to plugins
|
||||
|
||||
- Generate a source map for the transformation the plugin is applying
|
||||
- **Important**: Make sure the paths in the generated source map (`file` and `sources`) are relative to `file.base` (e.g. use `file.relative`).
|
||||
- Apply this source map to the vinyl `file`. E.g. by using [vinyl-sourcemaps-apply](https://github.com/floridoo/vinyl-sourcemaps-apply).
|
||||
This combines the source map of this plugin with the source maps coming from plugins further up the chain.
|
||||
- Add your plugin to the [wiki page](https://github.com/floridoo/gulp-sourcemaps/wiki/Plugins-with-gulp-sourcemaps-support)
|
||||
|
||||
#### Example:
|
||||
|
||||
```javascript
|
||||
var through = require('through2');
|
||||
var applySourceMap = require('vinyl-sourcemaps-apply');
|
||||
var myTransform = require('myTransform');
|
||||
|
||||
module.exports = function(options) {
|
||||
|
||||
function transform(file, encoding, callback) {
|
||||
// generate source maps if plugin source-map present
|
||||
if (file.sourceMap) {
|
||||
options.makeSourceMaps = true;
|
||||
}
|
||||
|
||||
// do normal plugin logic
|
||||
var result = myTransform(file.contents, options);
|
||||
file.contents = new Buffer(result.code);
|
||||
|
||||
// apply source map to the chain
|
||||
if (file.sourceMap) {
|
||||
applySourceMap(file, result.map);
|
||||
}
|
||||
|
||||
this.push(file);
|
||||
callback();
|
||||
}
|
||||
|
||||
return through.obj(transform);
|
||||
};
|
||||
```
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/gulp-sourcemaps.svg
|
||||
[npm-url]: https://www.npmjs.com/package/gulp-sourcemaps
|
||||
[travis-image]: https://img.shields.io/travis/floridoo/gulp-sourcemaps.svg
|
||||
[travis-url]: https://travis-ci.org/floridoo/gulp-sourcemaps
|
||||
[coveralls-image]: https://img.shields.io/coveralls/floridoo/gulp-sourcemaps.svg
|
||||
[coveralls-url]: https://coveralls.io/r/floridoo/gulp-sourcemaps?branch=master
|
||||
269
node_modules/decompress/node_modules/gulp-sourcemaps/index.js
generated
vendored
Normal file
269
node_modules/decompress/node_modules/gulp-sourcemaps/index.js
generated
vendored
Normal file
@@ -0,0 +1,269 @@
|
||||
'use strict';
|
||||
var through = require('through2');
|
||||
var fs = require('graceful-fs');
|
||||
var path = require('path');
|
||||
var File = require('vinyl');
|
||||
var convert = require('convert-source-map');
|
||||
var stripBom = require('strip-bom');
|
||||
|
||||
var PLUGIN_NAME = 'gulp-sourcemap';
|
||||
var urlRegex = /^(https?|webpack(-[^:]+)?):\/\//;
|
||||
|
||||
/**
|
||||
* Initialize source mapping chain
|
||||
*/
|
||||
module.exports.init = function init(options) {
|
||||
function sourceMapInit(file, encoding, callback) {
|
||||
/*jshint validthis:true */
|
||||
|
||||
// pass through if file is null or already has a source map
|
||||
if (file.isNull() || file.sourceMap) {
|
||||
this.push(file);
|
||||
return callback();
|
||||
}
|
||||
|
||||
if (file.isStream()) {
|
||||
return callback(new Error(PLUGIN_NAME + '-init: Streaming not supported'));
|
||||
}
|
||||
|
||||
var fileContent = file.contents.toString();
|
||||
var sourceMap;
|
||||
|
||||
if (options && options.loadMaps) {
|
||||
var sourcePath = ''; //root path for the sources in the map
|
||||
|
||||
// Try to read inline source map
|
||||
sourceMap = convert.fromSource(fileContent);
|
||||
if (sourceMap) {
|
||||
sourceMap = sourceMap.toObject();
|
||||
// sources in map are relative to the source file
|
||||
sourcePath = path.dirname(file.path);
|
||||
fileContent = convert.removeComments(fileContent);
|
||||
} else {
|
||||
// look for source map comment referencing a source map file
|
||||
var mapComment = convert.mapFileCommentRegex.exec(fileContent);
|
||||
|
||||
var mapFile;
|
||||
if (mapComment) {
|
||||
mapFile = path.resolve(path.dirname(file.path), mapComment[1] || mapComment[2]);
|
||||
fileContent = convert.removeMapFileComments(fileContent);
|
||||
// if no comment try map file with same name as source file
|
||||
} else {
|
||||
mapFile = file.path + '.map';
|
||||
}
|
||||
|
||||
// sources in external map are relative to map file
|
||||
sourcePath = path.dirname(mapFile);
|
||||
|
||||
try {
|
||||
sourceMap = JSON.parse(stripBom(fs.readFileSync(mapFile, 'utf8')));
|
||||
} catch(e) {}
|
||||
}
|
||||
|
||||
// fix source paths and sourceContent for imported source map
|
||||
if (sourceMap) {
|
||||
sourceMap.sourcesContent = sourceMap.sourcesContent || [];
|
||||
sourceMap.sources.forEach(function(source, i) {
|
||||
if (source.match(urlRegex)) {
|
||||
sourceMap.sourcesContent[i] = sourceMap.sourcesContent[i] || null;
|
||||
return;
|
||||
}
|
||||
var absPath = path.resolve(sourcePath, source);
|
||||
sourceMap.sources[i] = unixStylePath(path.relative(file.base, absPath));
|
||||
|
||||
if (!sourceMap.sourcesContent[i]) {
|
||||
var sourceContent = null;
|
||||
if (sourceMap.sourceRoot) {
|
||||
if (sourceMap.sourceRoot.match(urlRegex)) {
|
||||
sourceMap.sourcesContent[i] = null;
|
||||
return;
|
||||
}
|
||||
absPath = path.resolve(sourcePath, sourceMap.sourceRoot, source);
|
||||
}
|
||||
|
||||
// if current file: use content
|
||||
if (absPath === file.path) {
|
||||
sourceContent = fileContent;
|
||||
|
||||
// else load content from file
|
||||
} else {
|
||||
try {
|
||||
if (options.debug)
|
||||
console.log(PLUGIN_NAME + '-init: No source content for "' + source + '". Loading from file.');
|
||||
sourceContent = stripBom(fs.readFileSync(absPath, 'utf8'));
|
||||
} catch (e) {
|
||||
if (options.debug)
|
||||
console.warn(PLUGIN_NAME + '-init: source file not found: ' + absPath);
|
||||
}
|
||||
}
|
||||
sourceMap.sourcesContent[i] = sourceContent;
|
||||
}
|
||||
});
|
||||
|
||||
// remove source map comment from source
|
||||
file.contents = new Buffer(fileContent, 'utf8');
|
||||
}
|
||||
}
|
||||
|
||||
if (!sourceMap) {
|
||||
// Make an empty source map
|
||||
sourceMap = {
|
||||
version : 3,
|
||||
names: [],
|
||||
mappings: '',
|
||||
sources: [unixStylePath(file.relative)],
|
||||
sourcesContent: [fileContent]
|
||||
};
|
||||
}
|
||||
|
||||
sourceMap.file = unixStylePath(file.relative);
|
||||
file.sourceMap = sourceMap;
|
||||
|
||||
this.push(file);
|
||||
callback();
|
||||
}
|
||||
|
||||
return through.obj(sourceMapInit);
|
||||
};
|
||||
|
||||
/**
|
||||
* Write the source map
|
||||
*
|
||||
* @param options options to change the way the source map is written
|
||||
*
|
||||
*/
|
||||
module.exports.write = function write(destPath, options) {
|
||||
if (options === undefined && Object.prototype.toString.call(destPath) === '[object Object]') {
|
||||
options = destPath;
|
||||
destPath = undefined;
|
||||
}
|
||||
options = options || {};
|
||||
|
||||
// set defaults for options if unset
|
||||
if (options.includeContent === undefined)
|
||||
options.includeContent = true;
|
||||
if (options.addComment === undefined)
|
||||
options.addComment = true;
|
||||
|
||||
function sourceMapWrite(file, encoding, callback) {
|
||||
/*jshint validthis:true */
|
||||
|
||||
if (file.isNull() || !file.sourceMap) {
|
||||
this.push(file);
|
||||
return callback();
|
||||
}
|
||||
|
||||
if (file.isStream()) {
|
||||
return callback(new Error(PLUGIN_NAME + '-write: Streaming not supported'));
|
||||
}
|
||||
|
||||
var sourceMap = file.sourceMap;
|
||||
// fix paths if Windows style paths
|
||||
sourceMap.file = unixStylePath(file.relative);
|
||||
sourceMap.sources = sourceMap.sources.map(function(filePath) {
|
||||
return unixStylePath(filePath);
|
||||
});
|
||||
|
||||
if (typeof options.sourceRoot === 'function') {
|
||||
sourceMap.sourceRoot = options.sourceRoot(file);
|
||||
} else {
|
||||
sourceMap.sourceRoot = options.sourceRoot;
|
||||
}
|
||||
|
||||
if (options.includeContent) {
|
||||
sourceMap.sourcesContent = sourceMap.sourcesContent || [];
|
||||
|
||||
// load missing source content
|
||||
for (var i = 0; i < file.sourceMap.sources.length; i++) {
|
||||
if (!sourceMap.sourcesContent[i]) {
|
||||
var sourcePath = path.resolve(sourceMap.sourceRoot || file.base, sourceMap.sources[i]);
|
||||
try {
|
||||
if (options.debug)
|
||||
console.log(PLUGIN_NAME + '-write: No source content for "' + sourceMap.sources[i] + '". Loading from file.');
|
||||
sourceMap.sourcesContent[i] = stripBom(fs.readFileSync(sourcePath, 'utf8'));
|
||||
} catch (e) {
|
||||
if (options.debug)
|
||||
console.warn(PLUGIN_NAME + '-write: source file not found: ' + sourcePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sourceMap.sourceRoot === undefined) {
|
||||
sourceMap.sourceRoot = '/source/';
|
||||
} else if (sourceMap.sourceRoot === null) {
|
||||
sourceMap.sourceRoot = undefined;
|
||||
}
|
||||
} else {
|
||||
delete sourceMap.sourcesContent;
|
||||
}
|
||||
|
||||
var extension = file.relative.split('.').pop();
|
||||
var commentFormatter;
|
||||
|
||||
switch (extension) {
|
||||
case 'css':
|
||||
commentFormatter = function(url) { return "\n/*# sourceMappingURL=" + url + " */\n"; };
|
||||
break;
|
||||
case 'js':
|
||||
commentFormatter = function(url) { return "\n//# sourceMappingURL=" + url + "\n"; };
|
||||
break;
|
||||
default:
|
||||
commentFormatter = function(url) { return ""; };
|
||||
}
|
||||
|
||||
var comment, sourceMappingURLPrefix;
|
||||
if (!destPath) {
|
||||
// encode source map into comment
|
||||
var base64Map = new Buffer(JSON.stringify(sourceMap)).toString('base64');
|
||||
comment = commentFormatter('data:application/json;base64,' + base64Map);
|
||||
} else {
|
||||
var sourceMapPath = path.join(file.base, destPath, file.relative) + '.map';
|
||||
// add new source map file to stream
|
||||
var sourceMapFile = new File({
|
||||
cwd: file.cwd,
|
||||
base: file.base,
|
||||
path: sourceMapPath,
|
||||
contents: new Buffer(JSON.stringify(sourceMap)),
|
||||
stat: {
|
||||
isFile: function () { return true; },
|
||||
isDirectory: function () { return false; },
|
||||
isBlockDevice: function () { return false; },
|
||||
isCharacterDevice: function () { return false; },
|
||||
isSymbolicLink: function () { return false; },
|
||||
isFIFO: function () { return false; },
|
||||
isSocket: function () { return false; }
|
||||
}
|
||||
});
|
||||
this.push(sourceMapFile);
|
||||
|
||||
var sourceMapPathRelative = path.relative(path.dirname(file.path), sourceMapPath);
|
||||
|
||||
if (options.sourceMappingURLPrefix) {
|
||||
var prefix = '';
|
||||
if (typeof options.sourceMappingURLPrefix === 'function') {
|
||||
prefix = options.sourceMappingURLPrefix(file);
|
||||
} else {
|
||||
prefix = options.sourceMappingURLPrefix;
|
||||
}
|
||||
sourceMapPathRelative = prefix+path.join('/', sourceMapPathRelative);
|
||||
}
|
||||
comment = commentFormatter(unixStylePath(sourceMapPathRelative));
|
||||
|
||||
if (options.sourceMappingURL && typeof options.sourceMappingURL === 'function') {
|
||||
comment = commentFormatter(options.sourceMappingURL(file));
|
||||
}
|
||||
}
|
||||
|
||||
// append source map comment
|
||||
if (options.addComment)
|
||||
file.contents = Buffer.concat([file.contents, new Buffer(comment)]);
|
||||
|
||||
this.push(file);
|
||||
callback();
|
||||
}
|
||||
|
||||
return through.obj(sourceMapWrite);
|
||||
};
|
||||
|
||||
function unixStylePath(filePath) {
|
||||
return filePath.split(path.sep).join('/');
|
||||
}
|
||||
42
node_modules/decompress/node_modules/gulp-sourcemaps/package.json
generated
vendored
Normal file
42
node_modules/decompress/node_modules/gulp-sourcemaps/package.json
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "gulp-sourcemaps",
|
||||
"version": "1.6.0",
|
||||
"description": "Source map support for Gulp.js",
|
||||
"homepage": "http://github.com/floridoo/gulp-sourcemaps",
|
||||
"repository": "git://github.com/floridoo/gulp-sourcemaps.git",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "jshint *.js test/*.js && faucet test/*.js",
|
||||
"tap": "tape test/*.js",
|
||||
"cover": "istanbul cover --dir reports/coverage tape \"test/*.js\"",
|
||||
"coveralls": "istanbul cover tape \"test/*.js\" --report lcovonly && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage"
|
||||
},
|
||||
"keywords": [
|
||||
"gulpplugin",
|
||||
"gulp",
|
||||
"source maps",
|
||||
"sourcemaps"
|
||||
],
|
||||
"author": "Florian Reiterer <me@florianreiterer.com>",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"convert-source-map": "^1.1.1",
|
||||
"graceful-fs": "^4.1.2",
|
||||
"strip-bom": "^2.0.0",
|
||||
"through2": "^2.0.0",
|
||||
"vinyl": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"jshint": "^2.8.0",
|
||||
"tape": "^4.2.0",
|
||||
"istanbul": "^0.3.21",
|
||||
"faucet": "0.0.1",
|
||||
"coveralls": "^2.11.4"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"package.json",
|
||||
"README.md",
|
||||
"LICENSE.md"
|
||||
]
|
||||
}
|
||||
21
node_modules/decompress/node_modules/is-extendable/LICENSE
generated
vendored
Normal file
21
node_modules/decompress/node_modules/is-extendable/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015, Jon Schlinkert.
|
||||
|
||||
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.
|
||||
72
node_modules/decompress/node_modules/is-extendable/README.md
generated
vendored
Normal file
72
node_modules/decompress/node_modules/is-extendable/README.md
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
# is-extendable [](http://badge.fury.io/js/is-extendable)
|
||||
|
||||
> Returns true if a value is any of the object types: array, regexp, plain object, function or date. This is useful for determining if a value can be extended, e.g. "can the value have keys?"
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/)
|
||||
|
||||
```sh
|
||||
$ npm i is-extendable --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var isExtendable = require('is-extendable');
|
||||
```
|
||||
|
||||
Returns true if the value is any of the following:
|
||||
|
||||
* `array`
|
||||
* `regexp`
|
||||
* `plain object`
|
||||
* `function`
|
||||
* `date`
|
||||
* `error`
|
||||
|
||||
## Notes
|
||||
|
||||
All objects in JavaScript can have keys, but it's a pain to check for this, since we ether need to verify that the value is not `null` or `undefined` and:
|
||||
|
||||
* the value is not a primitive, or
|
||||
* that the object is an `object`, `function`
|
||||
|
||||
Also note that an `extendable` object is not the same as an [extensible object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible), which is one that (in es6) is not sealed, frozen, or marked as non-extensible using `preventExtensions`.
|
||||
|
||||
## Related projects
|
||||
|
||||
* [assign-deep](https://github.com/jonschlinkert/assign-deep): Deeply assign the enumerable properties of source objects to a destination object.
|
||||
* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util.
|
||||
* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null.
|
||||
* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor.
|
||||
* [is-equal-shallow](https://github.com/jonschlinkert/is-equal-shallow): Does a shallow comparison of two objects, returning false if the keys or values differ.
|
||||
* [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value.
|
||||
|
||||
## Running tests
|
||||
|
||||
Install dev dependencies:
|
||||
|
||||
```sh
|
||||
$ npm i -d && npm test
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-extendable/issues/new)
|
||||
|
||||
## Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
+ [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
|
||||
|
||||
## License
|
||||
|
||||
Copyright © 2015 Jon Schlinkert
|
||||
Released under the MIT license.
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on July 04, 2015._
|
||||
13
node_modules/decompress/node_modules/is-extendable/index.js
generated
vendored
Normal file
13
node_modules/decompress/node_modules/is-extendable/index.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
/*!
|
||||
* is-extendable <https://github.com/jonschlinkert/is-extendable>
|
||||
*
|
||||
* Copyright (c) 2015, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = function isExtendable(val) {
|
||||
return typeof val !== 'undefined' && val !== null
|
||||
&& (typeof val === 'object' || typeof val === 'function');
|
||||
};
|
||||
51
node_modules/decompress/node_modules/is-extendable/package.json
generated
vendored
Normal file
51
node_modules/decompress/node_modules/is-extendable/package.json
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"name": "is-extendable",
|
||||
"description": "Returns true if a value is any of the object types: array, regexp, plain object, function or date. This is useful for determining if a value can be extended, e.g. \"can the value have keys?\"",
|
||||
"version": "0.1.1",
|
||||
"homepage": "https://github.com/jonschlinkert/is-extendable",
|
||||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
||||
"repository": "jonschlinkert/is-extendable",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/is-extendable/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"main": "index.js",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "*"
|
||||
},
|
||||
"keywords": [
|
||||
"array",
|
||||
"assign",
|
||||
"check",
|
||||
"date",
|
||||
"extend",
|
||||
"extensible",
|
||||
"function",
|
||||
"is",
|
||||
"object",
|
||||
"regex",
|
||||
"test"
|
||||
],
|
||||
"verbiage": {
|
||||
"related": {
|
||||
"list": [
|
||||
"isobject",
|
||||
"is-plain-object",
|
||||
"kind-of",
|
||||
"is-extendable",
|
||||
"is-equal-shallow",
|
||||
"extend-shallow",
|
||||
"assign-deep"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
21
node_modules/decompress/node_modules/is-glob/LICENSE
generated
vendored
Normal file
21
node_modules/decompress/node_modules/is-glob/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2016, Jon Schlinkert.
|
||||
|
||||
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.
|
||||
142
node_modules/decompress/node_modules/is-glob/README.md
generated
vendored
Normal file
142
node_modules/decompress/node_modules/is-glob/README.md
generated
vendored
Normal file
@@ -0,0 +1,142 @@
|
||||
# is-glob [](https://www.npmjs.com/package/is-glob) [](https://npmjs.org/package/is-glob) [](https://travis-ci.org/jonschlinkert/is-glob)
|
||||
|
||||
> Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/):
|
||||
|
||||
```sh
|
||||
$ npm install --save is-glob
|
||||
```
|
||||
|
||||
You might also be interested in [is-valid-glob](https://github.com/jonschlinkert/is-valid-glob) and [has-glob](https://github.com/jonschlinkert/has-glob).
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var isGlob = require('is-glob');
|
||||
```
|
||||
|
||||
**True**
|
||||
|
||||
Patterns that have glob characters or regex patterns will return `true`:
|
||||
|
||||
```js
|
||||
isGlob('!foo.js');
|
||||
isGlob('*.js');
|
||||
isGlob('**/abc.js');
|
||||
isGlob('abc/*.js');
|
||||
isGlob('abc/(aaa|bbb).js');
|
||||
isGlob('abc/[a-z].js');
|
||||
isGlob('abc/{a,b}.js');
|
||||
isGlob('abc/?.js');
|
||||
//=> true
|
||||
```
|
||||
|
||||
Extglobs
|
||||
|
||||
```js
|
||||
isGlob('abc/@(a).js');
|
||||
isGlob('abc/!(a).js');
|
||||
isGlob('abc/+(a).js');
|
||||
isGlob('abc/*(a).js');
|
||||
isGlob('abc/?(a).js');
|
||||
//=> true
|
||||
```
|
||||
|
||||
**False**
|
||||
|
||||
Escaped globs or extglobs return `false`:
|
||||
|
||||
```js
|
||||
isGlob('abc/\\@(a).js');
|
||||
isGlob('abc/\\!(a).js');
|
||||
isGlob('abc/\\+(a).js');
|
||||
isGlob('abc/\\*(a).js');
|
||||
isGlob('abc/\\?(a).js');
|
||||
isGlob('\\!foo.js');
|
||||
isGlob('\\*.js');
|
||||
isGlob('\\*\\*/abc.js');
|
||||
isGlob('abc/\\*.js');
|
||||
isGlob('abc/\\(aaa|bbb).js');
|
||||
isGlob('abc/\\[a-z].js');
|
||||
isGlob('abc/\\{a,b}.js');
|
||||
isGlob('abc/\\?.js');
|
||||
//=> false
|
||||
```
|
||||
|
||||
Patterns that do not have glob patterns return `false`:
|
||||
|
||||
```js
|
||||
isGlob('abc.js');
|
||||
isGlob('abc/def/ghi.js');
|
||||
isGlob('foo.js');
|
||||
isGlob('abc/@.js');
|
||||
isGlob('abc/+.js');
|
||||
isGlob();
|
||||
isGlob(null);
|
||||
//=> false
|
||||
```
|
||||
|
||||
Arrays are also `false` (If you want to check if an array has a glob pattern, use [has-glob](https://github.com/jonschlinkert/has-glob)):
|
||||
|
||||
```js
|
||||
isGlob(['**/*.js']);
|
||||
isGlob(['foo.js']);
|
||||
//=> false
|
||||
```
|
||||
|
||||
## About
|
||||
|
||||
### Related projects
|
||||
|
||||
* [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble "Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit")
|
||||
* [base](https://www.npmjs.com/package/base): base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… [more](https://github.com/node-base/base) | [homepage](https://github.com/node-base/base "base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting with a handful of common methods, like `set`, `get`, `del` and `use`.")
|
||||
* [update](https://www.npmjs.com/package/update): Be scalable! Update is a new, open source developer framework and CLI for automating updates… [more](https://github.com/update/update) | [homepage](https://github.com/update/update "Be scalable! Update is a new, open source developer framework and CLI for automating updates of any kind in code projects.")
|
||||
* [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb "Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.")
|
||||
|
||||
### Contributing
|
||||
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
|
||||
|
||||
### Contributors
|
||||
|
||||
| **Commits** | **Contributor**<br/> |
|
||||
| --- | --- |
|
||||
| 40 | [jonschlinkert](https://github.com/jonschlinkert) |
|
||||
| 1 | [tuvistavie](https://github.com/tuvistavie) |
|
||||
|
||||
### Building docs
|
||||
|
||||
_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_
|
||||
|
||||
To generate the readme and API documentation with [verb](https://github.com/verbose/verb):
|
||||
|
||||
```sh
|
||||
$ npm install -g verb verb-generate-readme && verb
|
||||
```
|
||||
|
||||
### Running tests
|
||||
|
||||
Install dev dependencies:
|
||||
|
||||
```sh
|
||||
$ npm install -d && npm test
|
||||
```
|
||||
|
||||
### Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
* [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
|
||||
|
||||
### License
|
||||
|
||||
Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
|
||||
Released under the [MIT license](https://github.com/jonschlinkert/is-glob/blob/master/LICENSE).
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on October 12, 2016._
|
||||
25
node_modules/decompress/node_modules/is-glob/index.js
generated
vendored
Normal file
25
node_modules/decompress/node_modules/is-glob/index.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
/*!
|
||||
* is-glob <https://github.com/jonschlinkert/is-glob>
|
||||
*
|
||||
* Copyright (c) 2014-2016, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
|
||||
var isExtglob = require('is-extglob');
|
||||
|
||||
module.exports = function isGlob(str) {
|
||||
if (typeof str !== 'string' || str === '') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isExtglob(str)) return true;
|
||||
|
||||
var regex = /(\\).|([*?]|\[.*\]|\{.*\}|\(.*\|.*\)|^!)/;
|
||||
var match;
|
||||
|
||||
while ((match = regex.exec(str))) {
|
||||
if (match[2]) return true;
|
||||
str = str.slice(match.index + match[0].length);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
80
node_modules/decompress/node_modules/is-glob/package.json
generated
vendored
Normal file
80
node_modules/decompress/node_modules/is-glob/package.json
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
{
|
||||
"name": "is-glob",
|
||||
"description": "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.",
|
||||
"version": "3.1.0",
|
||||
"homepage": "https://github.com/jonschlinkert/is-glob",
|
||||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
||||
"contributors": [
|
||||
"Daniel Perez <daniel@claudetech.com> (http://tuvistavie.com)",
|
||||
"Jon Schlinkert <jon.schlinkert@sellside.com> (http://twitter.com/jonschlinkert)"
|
||||
],
|
||||
"repository": "jonschlinkert/is-glob",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/is-glob/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"main": "index.js",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"dependencies": {
|
||||
"is-extglob": "^2.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"gulp-format-md": "^0.1.10",
|
||||
"mocha": "^3.0.2"
|
||||
},
|
||||
"keywords": [
|
||||
"bash",
|
||||
"braces",
|
||||
"check",
|
||||
"exec",
|
||||
"expression",
|
||||
"extglob",
|
||||
"glob",
|
||||
"globbing",
|
||||
"globstar",
|
||||
"is",
|
||||
"match",
|
||||
"matches",
|
||||
"pattern",
|
||||
"regex",
|
||||
"regular",
|
||||
"string",
|
||||
"test"
|
||||
],
|
||||
"verb": {
|
||||
"layout": "default",
|
||||
"plugins": [
|
||||
"gulp-format-md"
|
||||
],
|
||||
"related": {
|
||||
"list": [
|
||||
"assemble",
|
||||
"base",
|
||||
"update",
|
||||
"verb"
|
||||
]
|
||||
},
|
||||
"reflinks": [
|
||||
"assemble",
|
||||
"bach",
|
||||
"base",
|
||||
"composer",
|
||||
"gulp",
|
||||
"has-glob",
|
||||
"is-valid-glob",
|
||||
"micromatch",
|
||||
"npm",
|
||||
"scaffold",
|
||||
"verb",
|
||||
"vinyl"
|
||||
]
|
||||
}
|
||||
}
|
||||
21
node_modules/decompress/node_modules/is-valid-glob/LICENSE
generated
vendored
Normal file
21
node_modules/decompress/node_modules/is-valid-glob/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015, Jon Schlinkert.
|
||||
|
||||
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.
|
||||
88
node_modules/decompress/node_modules/is-valid-glob/README.md
generated
vendored
Normal file
88
node_modules/decompress/node_modules/is-valid-glob/README.md
generated
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
# is-valid-glob [](http://badge.fury.io/js/is-valid-glob)
|
||||
|
||||
> Return true if a value is a valid glob pattern or patterns.
|
||||
|
||||
This really just checks to make sure that a pattern is either a string or array, and if it's an array it's either empty or consists of only strings.
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/)
|
||||
|
||||
```sh
|
||||
$ npm i is-valid-glob --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var isValidGlob = require('is-valid-glob');
|
||||
|
||||
isValidGlob('foo/*.js');
|
||||
//=> true
|
||||
```
|
||||
|
||||
**Valid patterns**
|
||||
|
||||
```js
|
||||
isValidGlob('a');
|
||||
isValidGlob('a.js');
|
||||
isValidGlob('*.js');
|
||||
isValidGlob(['a', 'b']);
|
||||
//=> all true
|
||||
```
|
||||
|
||||
**Invalid patterns**
|
||||
|
||||
```js
|
||||
isValidGlob();
|
||||
isValidGlob('');
|
||||
isValidGlob(null);
|
||||
isValidGlob(undefined);
|
||||
isValidGlob(new Buffer('foo'));
|
||||
isValidGlob(['foo', [[]]]);
|
||||
isValidGlob(['foo', [['bar']]]);
|
||||
isValidGlob(['foo', {}]);
|
||||
isValidGlob({});
|
||||
isValidGlob([]);
|
||||
isValidGlob(['']);
|
||||
//=> all false
|
||||
```
|
||||
|
||||
## Related projects
|
||||
|
||||
* [braces](https://github.com/jonschlinkert/braces): Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces… [more](https://github.com/jonschlinkert/braces)
|
||||
* [expand-range](https://github.com/jonschlinkert/expand-range): Fast, bash-like range expansion. Expand a range of numbers or letters, uppercase or lowercase. See… [more](https://github.com/jonschlinkert/expand-range)
|
||||
* [fill-range](https://github.com/jonschlinkert/fill-range): Fill in a range of numbers or letters, optionally passing an increment or multiplier to… [more](https://github.com/jonschlinkert/fill-range)
|
||||
* [gulp](http://gulpjs.com): The streaming build system
|
||||
* [glob-fs](https://github.com/jonschlinkert/glob-fs): file globbing for node.js. speedy and powerful alternative to node-glob.
|
||||
* [is-glob](https://github.com/jonschlinkert/is-glob): Returns `true` if the given string looks like a glob pattern.
|
||||
* [micromatch](https://github.com/jonschlinkert/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. Just… [more](https://github.com/jonschlinkert/micromatch)
|
||||
* [vinyl-fs](http://github.com/wearefractal/vinyl-fs): Vinyl adapter for the file system
|
||||
|
||||
## Running tests
|
||||
|
||||
Install dev dependencies:
|
||||
|
||||
```sh
|
||||
$ npm i -d && npm test
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-valid-glob/issues/new)
|
||||
|
||||
## Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
+ [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
|
||||
|
||||
## License
|
||||
|
||||
Copyright © 2015 Jon Schlinkert
|
||||
Released under the MIT license.
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on July 11, 2015._
|
||||
21
node_modules/decompress/node_modules/is-valid-glob/index.js
generated
vendored
Normal file
21
node_modules/decompress/node_modules/is-valid-glob/index.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function isValidGlob(glob) {
|
||||
if (typeof glob === 'string' && glob.length > 0) {
|
||||
return true;
|
||||
}
|
||||
if (Array.isArray(glob)) {
|
||||
return glob.length !== 0 && every(glob);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
function every(arr) {
|
||||
var len = arr.length;
|
||||
while (len--) {
|
||||
if (typeof arr[len] !== 'string' || arr[len].length <= 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
51
node_modules/decompress/node_modules/is-valid-glob/package.json
generated
vendored
Normal file
51
node_modules/decompress/node_modules/is-valid-glob/package.json
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"name": "is-valid-glob",
|
||||
"description": "Return true if a value is a valid glob pattern or patterns.",
|
||||
"version": "0.3.0",
|
||||
"homepage": "https://github.com/jonschlinkert/is-valid-glob",
|
||||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
||||
"repository": "jonschlinkert/is-valid-glob",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/is-valid-glob/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"main": "index.js",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "*"
|
||||
},
|
||||
"keywords": [
|
||||
"array",
|
||||
"check",
|
||||
"glob",
|
||||
"match",
|
||||
"pattern",
|
||||
"patterns",
|
||||
"read",
|
||||
"test",
|
||||
"valid",
|
||||
"validate"
|
||||
],
|
||||
"verb": {
|
||||
"related": {
|
||||
"list": [
|
||||
"gulp",
|
||||
"vinyl-fs",
|
||||
"is-glob",
|
||||
"micromatch",
|
||||
"braces",
|
||||
"fill-range",
|
||||
"expand-range",
|
||||
"glob-fs"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
54
node_modules/decompress/node_modules/isarray/README.md
generated
vendored
Normal file
54
node_modules/decompress/node_modules/isarray/README.md
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
|
||||
# isarray
|
||||
|
||||
`Array#isArray` for older browsers.
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var isArray = require('isarray');
|
||||
|
||||
console.log(isArray([])); // => true
|
||||
console.log(isArray({})); // => false
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
With [npm](http://npmjs.org) do
|
||||
|
||||
```bash
|
||||
$ npm install isarray
|
||||
```
|
||||
|
||||
Then bundle for the browser with
|
||||
[browserify](https://github.com/substack/browserify).
|
||||
|
||||
With [component](http://component.io) do
|
||||
|
||||
```bash
|
||||
$ component install juliangruber/isarray
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
(MIT)
|
||||
|
||||
Copyright (c) 2013 Julian Gruber <julian@juliangruber.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.
|
||||
209
node_modules/decompress/node_modules/isarray/build/build.js
generated
vendored
Normal file
209
node_modules/decompress/node_modules/isarray/build/build.js
generated
vendored
Normal file
@@ -0,0 +1,209 @@
|
||||
|
||||
/**
|
||||
* Require the given path.
|
||||
*
|
||||
* @param {String} path
|
||||
* @return {Object} exports
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function require(path, parent, orig) {
|
||||
var resolved = require.resolve(path);
|
||||
|
||||
// lookup failed
|
||||
if (null == resolved) {
|
||||
orig = orig || path;
|
||||
parent = parent || 'root';
|
||||
var err = new Error('Failed to require "' + orig + '" from "' + parent + '"');
|
||||
err.path = orig;
|
||||
err.parent = parent;
|
||||
err.require = true;
|
||||
throw err;
|
||||
}
|
||||
|
||||
var module = require.modules[resolved];
|
||||
|
||||
// perform real require()
|
||||
// by invoking the module's
|
||||
// registered function
|
||||
if (!module.exports) {
|
||||
module.exports = {};
|
||||
module.client = module.component = true;
|
||||
module.call(this, module.exports, require.relative(resolved), module);
|
||||
}
|
||||
|
||||
return module.exports;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registered modules.
|
||||
*/
|
||||
|
||||
require.modules = {};
|
||||
|
||||
/**
|
||||
* Registered aliases.
|
||||
*/
|
||||
|
||||
require.aliases = {};
|
||||
|
||||
/**
|
||||
* Resolve `path`.
|
||||
*
|
||||
* Lookup:
|
||||
*
|
||||
* - PATH/index.js
|
||||
* - PATH.js
|
||||
* - PATH
|
||||
*
|
||||
* @param {String} path
|
||||
* @return {String} path or null
|
||||
* @api private
|
||||
*/
|
||||
|
||||
require.resolve = function(path) {
|
||||
if (path.charAt(0) === '/') path = path.slice(1);
|
||||
var index = path + '/index.js';
|
||||
|
||||
var paths = [
|
||||
path,
|
||||
path + '.js',
|
||||
path + '.json',
|
||||
path + '/index.js',
|
||||
path + '/index.json'
|
||||
];
|
||||
|
||||
for (var i = 0; i < paths.length; i++) {
|
||||
var path = paths[i];
|
||||
if (require.modules.hasOwnProperty(path)) return path;
|
||||
}
|
||||
|
||||
if (require.aliases.hasOwnProperty(index)) {
|
||||
return require.aliases[index];
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Normalize `path` relative to the current path.
|
||||
*
|
||||
* @param {String} curr
|
||||
* @param {String} path
|
||||
* @return {String}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
require.normalize = function(curr, path) {
|
||||
var segs = [];
|
||||
|
||||
if ('.' != path.charAt(0)) return path;
|
||||
|
||||
curr = curr.split('/');
|
||||
path = path.split('/');
|
||||
|
||||
for (var i = 0; i < path.length; ++i) {
|
||||
if ('..' == path[i]) {
|
||||
curr.pop();
|
||||
} else if ('.' != path[i] && '' != path[i]) {
|
||||
segs.push(path[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return curr.concat(segs).join('/');
|
||||
};
|
||||
|
||||
/**
|
||||
* Register module at `path` with callback `definition`.
|
||||
*
|
||||
* @param {String} path
|
||||
* @param {Function} definition
|
||||
* @api private
|
||||
*/
|
||||
|
||||
require.register = function(path, definition) {
|
||||
require.modules[path] = definition;
|
||||
};
|
||||
|
||||
/**
|
||||
* Alias a module definition.
|
||||
*
|
||||
* @param {String} from
|
||||
* @param {String} to
|
||||
* @api private
|
||||
*/
|
||||
|
||||
require.alias = function(from, to) {
|
||||
if (!require.modules.hasOwnProperty(from)) {
|
||||
throw new Error('Failed to alias "' + from + '", it does not exist');
|
||||
}
|
||||
require.aliases[to] = from;
|
||||
};
|
||||
|
||||
/**
|
||||
* Return a require function relative to the `parent` path.
|
||||
*
|
||||
* @param {String} parent
|
||||
* @return {Function}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
require.relative = function(parent) {
|
||||
var p = require.normalize(parent, '..');
|
||||
|
||||
/**
|
||||
* lastIndexOf helper.
|
||||
*/
|
||||
|
||||
function lastIndexOf(arr, obj) {
|
||||
var i = arr.length;
|
||||
while (i--) {
|
||||
if (arr[i] === obj) return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* The relative require() itself.
|
||||
*/
|
||||
|
||||
function localRequire(path) {
|
||||
var resolved = localRequire.resolve(path);
|
||||
return require(resolved, parent, path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve relative to the parent.
|
||||
*/
|
||||
|
||||
localRequire.resolve = function(path) {
|
||||
var c = path.charAt(0);
|
||||
if ('/' == c) return path.slice(1);
|
||||
if ('.' == c) return require.normalize(p, path);
|
||||
|
||||
// resolve deps by returning
|
||||
// the dep in the nearest "deps"
|
||||
// directory
|
||||
var segs = parent.split('/');
|
||||
var i = lastIndexOf(segs, 'deps') + 1;
|
||||
if (!i) i = 0;
|
||||
path = segs.slice(0, i + 1).join('/') + '/deps/' + path;
|
||||
return path;
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if module is defined at `path`.
|
||||
*/
|
||||
|
||||
localRequire.exists = function(path) {
|
||||
return require.modules.hasOwnProperty(localRequire.resolve(path));
|
||||
};
|
||||
|
||||
return localRequire;
|
||||
};
|
||||
require.register("isarray/index.js", function(exports, require, module){
|
||||
module.exports = Array.isArray || function (arr) {
|
||||
return Object.prototype.toString.call(arr) == '[object Array]';
|
||||
};
|
||||
|
||||
});
|
||||
require.alias("isarray/index.js", "isarray/index.js");
|
||||
|
||||
19
node_modules/decompress/node_modules/isarray/component.json
generated
vendored
Normal file
19
node_modules/decompress/node_modules/isarray/component.json
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name" : "isarray",
|
||||
"description" : "Array#isArray for older browsers",
|
||||
"version" : "0.0.1",
|
||||
"repository" : "juliangruber/isarray",
|
||||
"homepage": "https://github.com/juliangruber/isarray",
|
||||
"main" : "index.js",
|
||||
"scripts" : [
|
||||
"index.js"
|
||||
],
|
||||
"dependencies" : {},
|
||||
"keywords": ["browser","isarray","array"],
|
||||
"author": {
|
||||
"name": "Julian Gruber",
|
||||
"email": "mail@juliangruber.com",
|
||||
"url": "http://juliangruber.com"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
3
node_modules/decompress/node_modules/isarray/index.js
generated
vendored
Normal file
3
node_modules/decompress/node_modules/isarray/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
module.exports = Array.isArray || function (arr) {
|
||||
return Object.prototype.toString.call(arr) == '[object Array]';
|
||||
};
|
||||
25
node_modules/decompress/node_modules/isarray/package.json
generated
vendored
Normal file
25
node_modules/decompress/node_modules/isarray/package.json
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name" : "isarray",
|
||||
"description" : "Array#isArray for older browsers",
|
||||
"version" : "0.0.1",
|
||||
"repository" : {
|
||||
"type" : "git",
|
||||
"url" : "git://github.com/juliangruber/isarray.git"
|
||||
},
|
||||
"homepage": "https://github.com/juliangruber/isarray",
|
||||
"main" : "index.js",
|
||||
"scripts" : {
|
||||
"test" : "tap test/*.js"
|
||||
},
|
||||
"dependencies" : {},
|
||||
"devDependencies" : {
|
||||
"tap" : "*"
|
||||
},
|
||||
"keywords": ["browser","isarray","array"],
|
||||
"author": {
|
||||
"name": "Julian Gruber",
|
||||
"email": "mail@juliangruber.com",
|
||||
"url": "http://juliangruber.com"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
21
node_modules/decompress/node_modules/kind-of/LICENSE
generated
vendored
Normal file
21
node_modules/decompress/node_modules/kind-of/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2017, Jon Schlinkert
|
||||
|
||||
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.
|
||||
261
node_modules/decompress/node_modules/kind-of/README.md
generated
vendored
Normal file
261
node_modules/decompress/node_modules/kind-of/README.md
generated
vendored
Normal file
@@ -0,0 +1,261 @@
|
||||
# kind-of [](https://www.npmjs.com/package/kind-of) [](https://npmjs.org/package/kind-of) [](https://npmjs.org/package/kind-of) [](https://travis-ci.org/jonschlinkert/kind-of)
|
||||
|
||||
> Get the native type of a value.
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/):
|
||||
|
||||
```sh
|
||||
$ npm install --save kind-of
|
||||
```
|
||||
|
||||
## Install
|
||||
|
||||
Install with [bower](https://bower.io/)
|
||||
|
||||
```sh
|
||||
$ bower install kind-of --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
> es5, browser and es6 ready
|
||||
|
||||
```js
|
||||
var kindOf = require('kind-of');
|
||||
|
||||
kindOf(undefined);
|
||||
//=> 'undefined'
|
||||
|
||||
kindOf(null);
|
||||
//=> 'null'
|
||||
|
||||
kindOf(true);
|
||||
//=> 'boolean'
|
||||
|
||||
kindOf(false);
|
||||
//=> 'boolean'
|
||||
|
||||
kindOf(new Boolean(true));
|
||||
//=> 'boolean'
|
||||
|
||||
kindOf(new Buffer(''));
|
||||
//=> 'buffer'
|
||||
|
||||
kindOf(42);
|
||||
//=> 'number'
|
||||
|
||||
kindOf(new Number(42));
|
||||
//=> 'number'
|
||||
|
||||
kindOf('str');
|
||||
//=> 'string'
|
||||
|
||||
kindOf(new String('str'));
|
||||
//=> 'string'
|
||||
|
||||
kindOf(arguments);
|
||||
//=> 'arguments'
|
||||
|
||||
kindOf({});
|
||||
//=> 'object'
|
||||
|
||||
kindOf(Object.create(null));
|
||||
//=> 'object'
|
||||
|
||||
kindOf(new Test());
|
||||
//=> 'object'
|
||||
|
||||
kindOf(new Date());
|
||||
//=> 'date'
|
||||
|
||||
kindOf([]);
|
||||
//=> 'array'
|
||||
|
||||
kindOf([1, 2, 3]);
|
||||
//=> 'array'
|
||||
|
||||
kindOf(new Array());
|
||||
//=> 'array'
|
||||
|
||||
kindOf(/foo/);
|
||||
//=> 'regexp'
|
||||
|
||||
kindOf(new RegExp('foo'));
|
||||
//=> 'regexp'
|
||||
|
||||
kindOf(function () {});
|
||||
//=> 'function'
|
||||
|
||||
kindOf(function * () {});
|
||||
//=> 'function'
|
||||
|
||||
kindOf(new Function());
|
||||
//=> 'function'
|
||||
|
||||
kindOf(new Map());
|
||||
//=> 'map'
|
||||
|
||||
kindOf(new WeakMap());
|
||||
//=> 'weakmap'
|
||||
|
||||
kindOf(new Set());
|
||||
//=> 'set'
|
||||
|
||||
kindOf(new WeakSet());
|
||||
//=> 'weakset'
|
||||
|
||||
kindOf(Symbol('str'));
|
||||
//=> 'symbol'
|
||||
|
||||
kindOf(new Int8Array());
|
||||
//=> 'int8array'
|
||||
|
||||
kindOf(new Uint8Array());
|
||||
//=> 'uint8array'
|
||||
|
||||
kindOf(new Uint8ClampedArray());
|
||||
//=> 'uint8clampedarray'
|
||||
|
||||
kindOf(new Int16Array());
|
||||
//=> 'int16array'
|
||||
|
||||
kindOf(new Uint16Array());
|
||||
//=> 'uint16array'
|
||||
|
||||
kindOf(new Int32Array());
|
||||
//=> 'int32array'
|
||||
|
||||
kindOf(new Uint32Array());
|
||||
//=> 'uint32array'
|
||||
|
||||
kindOf(new Float32Array());
|
||||
//=> 'float32array'
|
||||
|
||||
kindOf(new Float64Array());
|
||||
//=> 'float64array'
|
||||
```
|
||||
|
||||
## Benchmarks
|
||||
|
||||
Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of).
|
||||
Note that performaces is slower for es6 features `Map`, `WeakMap`, `Set` and `WeakSet`.
|
||||
|
||||
```bash
|
||||
#1: array
|
||||
current x 23,329,397 ops/sec ±0.82% (94 runs sampled)
|
||||
lib-type-of x 4,170,273 ops/sec ±0.55% (94 runs sampled)
|
||||
lib-typeof x 9,686,935 ops/sec ±0.59% (98 runs sampled)
|
||||
|
||||
#2: boolean
|
||||
current x 27,197,115 ops/sec ±0.85% (94 runs sampled)
|
||||
lib-type-of x 3,145,791 ops/sec ±0.73% (97 runs sampled)
|
||||
lib-typeof x 9,199,562 ops/sec ±0.44% (99 runs sampled)
|
||||
|
||||
#3: date
|
||||
current x 20,190,117 ops/sec ±0.86% (92 runs sampled)
|
||||
lib-type-of x 5,166,970 ops/sec ±0.74% (94 runs sampled)
|
||||
lib-typeof x 9,610,821 ops/sec ±0.50% (96 runs sampled)
|
||||
|
||||
#4: function
|
||||
current x 23,855,460 ops/sec ±0.60% (97 runs sampled)
|
||||
lib-type-of x 5,667,740 ops/sec ±0.54% (100 runs sampled)
|
||||
lib-typeof x 10,010,644 ops/sec ±0.44% (100 runs sampled)
|
||||
|
||||
#5: null
|
||||
current x 27,061,047 ops/sec ±0.97% (96 runs sampled)
|
||||
lib-type-of x 13,965,573 ops/sec ±0.62% (97 runs sampled)
|
||||
lib-typeof x 8,460,194 ops/sec ±0.61% (97 runs sampled)
|
||||
|
||||
#6: number
|
||||
current x 25,075,682 ops/sec ±0.53% (99 runs sampled)
|
||||
lib-type-of x 2,266,405 ops/sec ±0.41% (98 runs sampled)
|
||||
lib-typeof x 9,821,481 ops/sec ±0.45% (99 runs sampled)
|
||||
|
||||
#7: object
|
||||
current x 3,348,980 ops/sec ±0.49% (99 runs sampled)
|
||||
lib-type-of x 3,245,138 ops/sec ±0.60% (94 runs sampled)
|
||||
lib-typeof x 9,262,952 ops/sec ±0.59% (99 runs sampled)
|
||||
|
||||
#8: regex
|
||||
current x 21,284,827 ops/sec ±0.72% (96 runs sampled)
|
||||
lib-type-of x 4,689,241 ops/sec ±0.43% (100 runs sampled)
|
||||
lib-typeof x 8,957,593 ops/sec ±0.62% (98 runs sampled)
|
||||
|
||||
#9: string
|
||||
current x 25,379,234 ops/sec ±0.58% (96 runs sampled)
|
||||
lib-type-of x 3,635,148 ops/sec ±0.76% (93 runs sampled)
|
||||
lib-typeof x 9,494,134 ops/sec ±0.49% (98 runs sampled)
|
||||
|
||||
#10: undef
|
||||
current x 27,459,221 ops/sec ±1.01% (93 runs sampled)
|
||||
lib-type-of x 14,360,433 ops/sec ±0.52% (99 runs sampled)
|
||||
lib-typeof x 23,202,868 ops/sec ±0.59% (94 runs sampled)
|
||||
|
||||
```
|
||||
|
||||
## Optimizations
|
||||
|
||||
In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library:
|
||||
|
||||
1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot.
|
||||
2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it.
|
||||
3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'`
|
||||
|
||||
## About
|
||||
|
||||
### Related projects
|
||||
|
||||
* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet")
|
||||
* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.")
|
||||
* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ")
|
||||
|
||||
### Contributing
|
||||
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
|
||||
|
||||
### Contributors
|
||||
|
||||
| **Commits** | **Contributor** |
|
||||
| --- | --- |
|
||||
| 59 | [jonschlinkert](https://github.com/jonschlinkert) |
|
||||
| 2 | [miguelmota](https://github.com/miguelmota) |
|
||||
| 1 | [dtothefp](https://github.com/dtothefp) |
|
||||
| 1 | [ksheedlo](https://github.com/ksheedlo) |
|
||||
| 1 | [pdehaan](https://github.com/pdehaan) |
|
||||
| 1 | [laggingreflex](https://github.com/laggingreflex) |
|
||||
|
||||
### Building docs
|
||||
|
||||
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
|
||||
|
||||
To generate the readme, run the following command:
|
||||
|
||||
```sh
|
||||
$ npm install -g verbose/verb#dev verb-generate-readme && verb
|
||||
```
|
||||
|
||||
### Running tests
|
||||
|
||||
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
|
||||
|
||||
```sh
|
||||
$ npm install && npm test
|
||||
```
|
||||
|
||||
### Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
* [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
|
||||
|
||||
### License
|
||||
|
||||
Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
|
||||
Released under the [MIT License](LICENSE).
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 16, 2017._
|
||||
116
node_modules/decompress/node_modules/kind-of/index.js
generated
vendored
Normal file
116
node_modules/decompress/node_modules/kind-of/index.js
generated
vendored
Normal file
@@ -0,0 +1,116 @@
|
||||
var isBuffer = require('is-buffer');
|
||||
var toString = Object.prototype.toString;
|
||||
|
||||
/**
|
||||
* Get the native `typeof` a value.
|
||||
*
|
||||
* @param {*} `val`
|
||||
* @return {*} Native javascript type
|
||||
*/
|
||||
|
||||
module.exports = function kindOf(val) {
|
||||
// primitivies
|
||||
if (typeof val === 'undefined') {
|
||||
return 'undefined';
|
||||
}
|
||||
if (val === null) {
|
||||
return 'null';
|
||||
}
|
||||
if (val === true || val === false || val instanceof Boolean) {
|
||||
return 'boolean';
|
||||
}
|
||||
if (typeof val === 'string' || val instanceof String) {
|
||||
return 'string';
|
||||
}
|
||||
if (typeof val === 'number' || val instanceof Number) {
|
||||
return 'number';
|
||||
}
|
||||
|
||||
// functions
|
||||
if (typeof val === 'function' || val instanceof Function) {
|
||||
return 'function';
|
||||
}
|
||||
|
||||
// array
|
||||
if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) {
|
||||
return 'array';
|
||||
}
|
||||
|
||||
// check for instances of RegExp and Date before calling `toString`
|
||||
if (val instanceof RegExp) {
|
||||
return 'regexp';
|
||||
}
|
||||
if (val instanceof Date) {
|
||||
return 'date';
|
||||
}
|
||||
|
||||
// other objects
|
||||
var type = toString.call(val);
|
||||
|
||||
if (type === '[object RegExp]') {
|
||||
return 'regexp';
|
||||
}
|
||||
if (type === '[object Date]') {
|
||||
return 'date';
|
||||
}
|
||||
if (type === '[object Arguments]') {
|
||||
return 'arguments';
|
||||
}
|
||||
if (type === '[object Error]') {
|
||||
return 'error';
|
||||
}
|
||||
|
||||
// buffer
|
||||
if (isBuffer(val)) {
|
||||
return 'buffer';
|
||||
}
|
||||
|
||||
// es6: Map, WeakMap, Set, WeakSet
|
||||
if (type === '[object Set]') {
|
||||
return 'set';
|
||||
}
|
||||
if (type === '[object WeakSet]') {
|
||||
return 'weakset';
|
||||
}
|
||||
if (type === '[object Map]') {
|
||||
return 'map';
|
||||
}
|
||||
if (type === '[object WeakMap]') {
|
||||
return 'weakmap';
|
||||
}
|
||||
if (type === '[object Symbol]') {
|
||||
return 'symbol';
|
||||
}
|
||||
|
||||
// typed arrays
|
||||
if (type === '[object Int8Array]') {
|
||||
return 'int8array';
|
||||
}
|
||||
if (type === '[object Uint8Array]') {
|
||||
return 'uint8array';
|
||||
}
|
||||
if (type === '[object Uint8ClampedArray]') {
|
||||
return 'uint8clampedarray';
|
||||
}
|
||||
if (type === '[object Int16Array]') {
|
||||
return 'int16array';
|
||||
}
|
||||
if (type === '[object Uint16Array]') {
|
||||
return 'uint16array';
|
||||
}
|
||||
if (type === '[object Int32Array]') {
|
||||
return 'int32array';
|
||||
}
|
||||
if (type === '[object Uint32Array]') {
|
||||
return 'uint32array';
|
||||
}
|
||||
if (type === '[object Float32Array]') {
|
||||
return 'float32array';
|
||||
}
|
||||
if (type === '[object Float64Array]') {
|
||||
return 'float64array';
|
||||
}
|
||||
|
||||
// must be a plain object
|
||||
return 'object';
|
||||
};
|
||||
90
node_modules/decompress/node_modules/kind-of/package.json
generated
vendored
Normal file
90
node_modules/decompress/node_modules/kind-of/package.json
generated
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"name": "kind-of",
|
||||
"description": "Get the native type of a value.",
|
||||
"version": "3.2.2",
|
||||
"homepage": "https://github.com/jonschlinkert/kind-of",
|
||||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
||||
"contributors": [
|
||||
"David Fox-Powell (https://dtothefp.github.io/me)",
|
||||
"Jon Schlinkert (http://twitter.com/jonschlinkert)",
|
||||
"Ken Sheedlo (kensheedlo.com)",
|
||||
"laggingreflex (https://github.com/laggingreflex)",
|
||||
"Miguel Mota (https://miguelmota.com)",
|
||||
"Peter deHaan (http://about.me/peterdehaan)"
|
||||
],
|
||||
"repository": "jonschlinkert/kind-of",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/kind-of/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"main": "index.js",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha",
|
||||
"prepublish": "browserify -o browser.js -e index.js -s index --bare"
|
||||
},
|
||||
"dependencies": {
|
||||
"is-buffer": "^1.1.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ansi-bold": "^0.1.1",
|
||||
"benchmarked": "^1.0.0",
|
||||
"browserify": "^14.3.0",
|
||||
"glob": "^7.1.1",
|
||||
"gulp-format-md": "^0.1.12",
|
||||
"mocha": "^3.3.0",
|
||||
"type-of": "^2.0.1",
|
||||
"typeof": "^1.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
"arguments",
|
||||
"array",
|
||||
"boolean",
|
||||
"check",
|
||||
"date",
|
||||
"function",
|
||||
"is",
|
||||
"is-type",
|
||||
"is-type-of",
|
||||
"kind",
|
||||
"kind-of",
|
||||
"number",
|
||||
"object",
|
||||
"of",
|
||||
"regexp",
|
||||
"string",
|
||||
"test",
|
||||
"type",
|
||||
"type-of",
|
||||
"typeof",
|
||||
"types"
|
||||
],
|
||||
"verb": {
|
||||
"related": {
|
||||
"list": [
|
||||
"is-glob",
|
||||
"is-number",
|
||||
"is-primitive"
|
||||
]
|
||||
},
|
||||
"toc": false,
|
||||
"layout": "default",
|
||||
"tasks": [
|
||||
"readme"
|
||||
],
|
||||
"plugins": [
|
||||
"gulp-format-md"
|
||||
],
|
||||
"lint": {
|
||||
"reflinks": true
|
||||
},
|
||||
"reflinks": [
|
||||
"verb"
|
||||
]
|
||||
}
|
||||
}
|
||||
85
node_modules/decompress/node_modules/make-dir/index.js
generated
vendored
85
node_modules/decompress/node_modules/make-dir/index.js
generated
vendored
@@ -1,85 +0,0 @@
|
||||
'use strict';
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const pify = require('pify');
|
||||
|
||||
const defaults = {
|
||||
mode: 0o777 & (~process.umask()),
|
||||
fs
|
||||
};
|
||||
|
||||
// https://github.com/nodejs/node/issues/8987
|
||||
// https://github.com/libuv/libuv/pull/1088
|
||||
const checkPath = pth => {
|
||||
if (process.platform === 'win32') {
|
||||
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ''));
|
||||
|
||||
if (pathHasInvalidWinCharacters) {
|
||||
const err = new Error(`Path contains invalid characters: ${pth}`);
|
||||
err.code = 'EINVAL';
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = (input, opts) => Promise.resolve().then(() => {
|
||||
checkPath(input);
|
||||
opts = Object.assign({}, defaults, opts);
|
||||
|
||||
const mkdir = pify(opts.fs.mkdir);
|
||||
const stat = pify(opts.fs.stat);
|
||||
|
||||
const make = pth => {
|
||||
return mkdir(pth, opts.mode)
|
||||
.then(() => pth)
|
||||
.catch(err => {
|
||||
if (err.code === 'ENOENT') {
|
||||
if (err.message.includes('null bytes') || path.dirname(pth) === pth) {
|
||||
throw err;
|
||||
}
|
||||
|
||||
return make(path.dirname(pth)).then(() => make(pth));
|
||||
}
|
||||
|
||||
return stat(pth)
|
||||
.then(stats => stats.isDirectory() ? pth : Promise.reject())
|
||||
.catch(() => {
|
||||
throw err;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
return make(path.resolve(input));
|
||||
});
|
||||
|
||||
module.exports.sync = (input, opts) => {
|
||||
checkPath(input);
|
||||
opts = Object.assign({}, defaults, opts);
|
||||
|
||||
const make = pth => {
|
||||
try {
|
||||
opts.fs.mkdirSync(pth, opts.mode);
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT') {
|
||||
if (err.message.includes('null bytes') || path.dirname(pth) === pth) {
|
||||
throw err;
|
||||
}
|
||||
|
||||
make(path.dirname(pth));
|
||||
return make(pth);
|
||||
}
|
||||
|
||||
try {
|
||||
if (!opts.fs.statSync(pth).isDirectory()) {
|
||||
throw new Error('The path is not a directory');
|
||||
}
|
||||
} catch (_) {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
return pth;
|
||||
};
|
||||
|
||||
return make(path.resolve(input));
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user