'
- */
- function wrap(value, wrapper) {
- return createWrapper(wrapper, 16, [value]);
- }
-
- /*--------------------------------------------------------------------------*/
-
- /**
- * Creates a function that returns `value`.
- *
- * @static
- * @memberOf _
- * @category Utilities
- * @param {*} value The value to return from the new function.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var object = { 'name': 'fred' };
- * var getter = _.constant(object);
- * getter() === object;
- * // => true
- */
- function constant(value) {
- return function() {
- return value;
- };
- }
-
- /**
- * Produces a callback bound to an optional `thisArg`. If `func` is a property
- * name the created callback will return the property value for a given element.
- * If `func` is an object the created callback will return `true` for elements
- * that contain the equivalent object properties, otherwise it will return `false`.
- *
- * @static
- * @memberOf _
- * @category Utilities
- * @param {*} [func=identity] The value to convert to a callback.
- * @param {*} [thisArg] The `this` binding of the created callback.
- * @param {number} [argCount] The number of arguments the callback accepts.
- * @returns {Function} Returns a callback function.
- * @example
- *
- * var characters = [
- * { 'name': 'barney', 'age': 36 },
- * { 'name': 'fred', 'age': 40 }
- * ];
- *
- * // wrap to create custom callback shorthands
- * _.createCallback = _.wrap(_.createCallback, function(func, callback, thisArg) {
- * var match = /^(.+?)__([gl]t)(.+)$/.exec(callback);
- * return !match ? func(callback, thisArg) : function(object) {
- * return match[2] == 'gt' ? object[match[1]] > match[3] : object[match[1]] < match[3];
- * };
- * });
- *
- * _.filter(characters, 'age__gt38');
- * // => [{ 'name': 'fred', 'age': 40 }]
- */
- function createCallback(func, thisArg, argCount) {
- var type = typeof func;
- if (func == null || type == 'function') {
- return baseCreateCallback(func, thisArg, argCount);
- }
- // handle "_.pluck" style callback shorthands
- if (type != 'object') {
- return property(func);
- }
- var props = keys(func),
- key = props[0],
- a = func[key];
-
- // handle "_.where" style callback shorthands
- if (props.length == 1 && a === a && !isObject(a)) {
- // fast path the common case of providing an object with a single
- // property containing a primitive value
- return function(object) {
- var b = object[key];
- return a === b && (a !== 0 || (1 / a == 1 / b));
- };
- }
- return function(object) {
- var length = props.length,
- result = false;
-
- while (length--) {
- if (!(result = baseIsEqual(object[props[length]], func[props[length]], null, true))) {
- break;
- }
- }
- return result;
- };
- }
-
- /**
- * Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their
- * corresponding HTML entities.
- *
- * @static
- * @memberOf _
- * @category Utilities
- * @param {string} string The string to escape.
- * @returns {string} Returns the escaped string.
- * @example
- *
- * _.escape('Fred, Wilma, & Pebbles');
- * // => 'Fred, Wilma, & Pebbles'
- */
- function escape(string) {
- return string == null ? '' : String(string).replace(reUnescapedHtml, escapeHtmlChar);
- }
-
- /**
- * This method returns the first argument provided to it.
- *
- * @static
- * @memberOf _
- * @category Utilities
- * @param {*} value Any value.
- * @returns {*} Returns `value`.
- * @example
- *
- * var object = { 'name': 'fred' };
- * _.identity(object) === object;
- * // => true
- */
- function identity(value) {
- return value;
- }
-
- /**
- * Adds function properties of a source object to the destination object.
- * If `object` is a function methods will be added to its prototype as well.
- *
- * @static
- * @memberOf _
- * @category Utilities
- * @param {Function|Object} [object=lodash] object The destination object.
- * @param {Object} source The object of functions to add.
- * @param {Object} [options] The options object.
- * @param {boolean} [options.chain=true] Specify whether the functions added are chainable.
- * @example
- *
- * function capitalize(string) {
- * return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
- * }
- *
- * _.mixin({ 'capitalize': capitalize });
- * _.capitalize('fred');
- * // => 'Fred'
- *
- * _('fred').capitalize().value();
- * // => 'Fred'
- *
- * _.mixin({ 'capitalize': capitalize }, { 'chain': false });
- * _('fred').capitalize();
- * // => 'Fred'
- */
- function mixin(object, source, options) {
- var chain = true,
- methodNames = source && functions(source);
-
- if (!source || (!options && !methodNames.length)) {
- if (options == null) {
- options = source;
- }
- ctor = lodashWrapper;
- source = object;
- object = lodash;
- methodNames = functions(source);
- }
- if (options === false) {
- chain = false;
- } else if (isObject(options) && 'chain' in options) {
- chain = options.chain;
- }
- var ctor = object,
- isFunc = isFunction(ctor);
-
- forEach(methodNames, function(methodName) {
- var func = object[methodName] = source[methodName];
- if (isFunc) {
- ctor.prototype[methodName] = function() {
- var chainAll = this.__chain__,
- value = this.__wrapped__,
- args = [value];
-
- push.apply(args, arguments);
- var result = func.apply(object, args);
- if (chain || chainAll) {
- if (value === result && isObject(result)) {
- return this;
- }
- result = new ctor(result);
- result.__chain__ = chainAll;
- }
- return result;
- };
- }
- });
- }
-
- /**
- * Reverts the '_' variable to its previous value and returns a reference to
- * the `lodash` function.
- *
- * @static
- * @memberOf _
- * @category Utilities
- * @returns {Function} Returns the `lodash` function.
- * @example
- *
- * var lodash = _.noConflict();
- */
- function noConflict() {
- context._ = oldDash;
- return this;
- }
-
- /**
- * A no-operation function.
- *
- * @static
- * @memberOf _
- * @category Utilities
- * @example
- *
- * var object = { 'name': 'fred' };
- * _.noop(object) === undefined;
- * // => true
- */
- function noop() {
- // no operation performed
- }
-
- /**
- * Gets the number of milliseconds that have elapsed since the Unix epoch
- * (1 January 1970 00:00:00 UTC).
- *
- * @static
- * @memberOf _
- * @category Utilities
- * @example
- *
- * var stamp = _.now();
- * _.defer(function() { console.log(_.now() - stamp); });
- * // => logs the number of milliseconds it took for the deferred function to be called
- */
- var now = isNative(now = Date.now) && now || function() {
- return new Date().getTime();
- };
-
- /**
- * Converts the given value into an integer of the specified radix.
- * If `radix` is `undefined` or `0` a `radix` of `10` is used unless the
- * `value` is a hexadecimal, in which case a `radix` of `16` is used.
- *
- * Note: This method avoids differences in native ES3 and ES5 `parseInt`
- * implementations. See http://es5.github.io/#E.
- *
- * @static
- * @memberOf _
- * @category Utilities
- * @param {string} value The value to parse.
- * @param {number} [radix] The radix used to interpret the value to parse.
- * @returns {number} Returns the new integer value.
- * @example
- *
- * _.parseInt('08');
- * // => 8
- */
- var parseInt = nativeParseInt(whitespace + '08') == 8 ? nativeParseInt : function(value, radix) {
- // Firefox < 21 and Opera < 15 follow the ES3 specified implementation of `parseInt`
- return nativeParseInt(isString(value) ? value.replace(reLeadingSpacesAndZeros, '') : value, radix || 0);
- };
-
- /**
- * Creates a "_.pluck" style function, which returns the `key` value of a
- * given object.
- *
- * @static
- * @memberOf _
- * @category Utilities
- * @param {string} key The name of the property to retrieve.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var characters = [
- * { 'name': 'fred', 'age': 40 },
- * { 'name': 'barney', 'age': 36 }
- * ];
- *
- * var getName = _.property('name');
- *
- * _.map(characters, getName);
- * // => ['barney', 'fred']
- *
- * _.sortBy(characters, getName);
- * // => [{ 'name': 'barney', 'age': 36 }, { 'name': 'fred', 'age': 40 }]
- */
- function property(key) {
- return function(object) {
- return object[key];
- };
- }
-
- /**
- * Produces a random number between `min` and `max` (inclusive). If only one
- * argument is provided a number between `0` and the given number will be
- * returned. If `floating` is truey or either `min` or `max` are floats a
- * floating-point number will be returned instead of an integer.
- *
- * @static
- * @memberOf _
- * @category Utilities
- * @param {number} [min=0] The minimum possible value.
- * @param {number} [max=1] The maximum possible value.
- * @param {boolean} [floating=false] Specify returning a floating-point number.
- * @returns {number} Returns a random number.
- * @example
- *
- * _.random(0, 5);
- * // => an integer between 0 and 5
- *
- * _.random(5);
- * // => also an integer between 0 and 5
- *
- * _.random(5, true);
- * // => a floating-point number between 0 and 5
- *
- * _.random(1.2, 5.2);
- * // => a floating-point number between 1.2 and 5.2
- */
- function random(min, max, floating) {
- var noMin = min == null,
- noMax = max == null;
-
- if (floating == null) {
- if (typeof min == 'boolean' && noMax) {
- floating = min;
- min = 1;
- }
- else if (!noMax && typeof max == 'boolean') {
- floating = max;
- noMax = true;
- }
- }
- if (noMin && noMax) {
- max = 1;
- }
- min = +min || 0;
- if (noMax) {
- max = min;
- min = 0;
- } else {
- max = +max || 0;
- }
- if (floating || min % 1 || max % 1) {
- var rand = nativeRandom();
- return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand +'').length - 1)))), max);
- }
- return baseRandom(min, max);
- }
-
- /**
- * Resolves the value of property `key` on `object`. If `key` is a function
- * it will be invoked with the `this` binding of `object` and its result returned,
- * else the property value is returned. If `object` is falsey then `undefined`
- * is returned.
- *
- * @static
- * @memberOf _
- * @category Utilities
- * @param {Object} object The object to inspect.
- * @param {string} key The name of the property to resolve.
- * @returns {*} Returns the resolved value.
- * @example
- *
- * var object = {
- * 'cheese': 'crumpets',
- * 'stuff': function() {
- * return 'nonsense';
- * }
- * };
- *
- * _.result(object, 'cheese');
- * // => 'crumpets'
- *
- * _.result(object, 'stuff');
- * // => 'nonsense'
- */
- function result(object, key) {
- if (object) {
- var value = object[key];
- return isFunction(value) ? object[key]() : value;
- }
- }
-
- /**
- * A micro-templating method that handles arbitrary delimiters, preserves
- * whitespace, and correctly escapes quotes within interpolated code.
- *
- * Note: In the development build, `_.template` utilizes sourceURLs for easier
- * debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl
- *
- * For more information on precompiling templates see:
- * http://lodash.com/custom-builds
- *
- * For more information on Chrome extension sandboxes see:
- * http://developer.chrome.com/stable/extensions/sandboxingEval.html
- *
- * @static
- * @memberOf _
- * @category Utilities
- * @param {string} text The template text.
- * @param {Object} data The data object used to populate the text.
- * @param {Object} [options] The options object.
- * @param {RegExp} [options.escape] The "escape" delimiter.
- * @param {RegExp} [options.evaluate] The "evaluate" delimiter.
- * @param {Object} [options.imports] An object to import into the template as local variables.
- * @param {RegExp} [options.interpolate] The "interpolate" delimiter.
- * @param {string} [sourceURL] The sourceURL of the template's compiled source.
- * @param {string} [variable] The data object variable name.
- * @returns {Function|string} Returns a compiled function when no `data` object
- * is given, else it returns the interpolated text.
- * @example
- *
- * // using the "interpolate" delimiter to create a compiled template
- * var compiled = _.template('hello <%= name %>');
- * compiled({ 'name': 'fred' });
- * // => 'hello fred'
- *
- * // using the "escape" delimiter to escape HTML in data property values
- * _.template('<%- value %>', { 'value': '\n```\n\nUsing [`npm`](http://npmjs.org/):\n\n```bash\nnpm i --save lodash\n\n{sudo} npm i -g lodash\nnpm ln lodash\n```\n\nIn [Node.js](http://nodejs.org/) & [Ringo](http://ringojs.org/):\n\n```js\nvar _ = require('lodash');\n// or as Underscore\nvar _ = require('lodash/dist/lodash.underscore');\n```\n\n**Notes:**\n * Don’t assign values to [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL\n * If Lo-Dash is installed globally, run [`npm ln lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your project’s root directory *before* requiring it\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('lodash.js');\n```\n\nIn an AMD loader:\n\n```js\nrequire({\n 'packages': [\n { 'name': 'lodash', 'location': 'path/to/lodash', 'main': 'lodash' }\n ]\n},\n['lodash'], function(_) {\n console.log(_.VERSION);\n});\n```\n\n## Author\n\n| [](https://twitter.com/jdalton \"Follow @jdalton on Twitter\") |\n|---|\n| [John-David Dalton](http://allyoucanleet.com/) |\n\n## Contributors\n\n| [](https://twitter.com/blainebublitz \"Follow @BlaineBublitz on Twitter\") | [](https://twitter.com/kitcambridge \"Follow @kitcambridge on Twitter\") | [](https://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|---|---|\n| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) |\n\n[](https://bitdeli.com/free \"Bitdeli Badge\")\n",
- "readmeFilename": "README.md",
- "_id": "lodash@2.4.1",
- "_from": "lodash@~2.4.1"
-}
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/.npmignore b/builder/node_modules/archiver/node_modules/readable-stream/.npmignore
deleted file mode 100644
index 38344f87..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/.npmignore
+++ /dev/null
@@ -1,5 +0,0 @@
-build/
-test/
-examples/
-fs.js
-zlib.js
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/LICENSE b/builder/node_modules/archiver/node_modules/readable-stream/LICENSE
deleted file mode 100644
index 0c44ae71..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/LICENSE
+++ /dev/null
@@ -1,27 +0,0 @@
-Copyright (c) Isaac Z. Schlueter ("Author")
-All rights reserved.
-
-The BSD License
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
-BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/README.md b/builder/node_modules/archiver/node_modules/readable-stream/README.md
deleted file mode 100644
index 34c11897..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/README.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# 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"`
-
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/duplex.js b/builder/node_modules/archiver/node_modules/readable-stream/duplex.js
deleted file mode 100644
index ca807af8..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/duplex.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require("./lib/_stream_duplex.js")
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/lib/_stream_duplex.js b/builder/node_modules/archiver/node_modules/readable-stream/lib/_stream_duplex.js
deleted file mode 100644
index b513d61a..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/lib/_stream_duplex.js
+++ /dev/null
@@ -1,89 +0,0 @@
-// 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;
-
-/**/
-var objectKeys = Object.keys || function (obj) {
- var keys = [];
- for (var key in obj) keys.push(key);
- return keys;
-}
-/**/
-
-
-/**/
-var util = require('core-util-is');
-util.inherits = require('inherits');
-/**/
-
-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);
- }
-}
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/lib/_stream_passthrough.js b/builder/node_modules/archiver/node_modules/readable-stream/lib/_stream_passthrough.js
deleted file mode 100644
index 895ca50a..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/lib/_stream_passthrough.js
+++ /dev/null
@@ -1,46 +0,0 @@
-// 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');
-
-/**/
-var util = require('core-util-is');
-util.inherits = require('inherits');
-/**/
-
-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);
-};
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/lib/_stream_readable.js b/builder/node_modules/archiver/node_modules/readable-stream/lib/_stream_readable.js
deleted file mode 100644
index 0ca77052..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/lib/_stream_readable.js
+++ /dev/null
@@ -1,959 +0,0 @@
-// 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;
-
-/**/
-var isArray = require('isarray');
-/**/
-
-
-/**/
-var Buffer = require('buffer').Buffer;
-/**/
-
-Readable.ReadableState = ReadableState;
-
-var EE = require('events').EventEmitter;
-
-/**/
-if (!EE.listenerCount) EE.listenerCount = function(emitter, type) {
- return emitter.listeners(type).length;
-};
-/**/
-
-var Stream = require('stream');
-
-/**/
-var util = require('core-util-is');
-util.inherits = require('inherits');
-/**/
-
-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 (isNaN(n) || n === null) {
- // 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;
-
- 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) {
- if (state.length === 0)
- endReadable(this);
- return null;
- }
-
- // 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);
-
- var ret;
- 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) {
- 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);
- if (!chunk || !state.objectMode && !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;
-}
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/lib/_stream_transform.js b/builder/node_modules/archiver/node_modules/readable-stream/lib/_stream_transform.js
deleted file mode 100644
index eb188df3..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/lib/_stream_transform.js
+++ /dev/null
@@ -1,210 +0,0 @@
-// 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');
-
-/**/
-var util = require('core-util-is');
-util.inherits = require('inherits');
-/**/
-
-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);
-}
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/lib/_stream_writable.js b/builder/node_modules/archiver/node_modules/readable-stream/lib/_stream_writable.js
deleted file mode 100644
index d0254d5a..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/lib/_stream_writable.js
+++ /dev/null
@@ -1,387 +0,0 @@
-// 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;
-
-/**/
-var Buffer = require('buffer').Buffer;
-/**/
-
-Writable.WritableState = WritableState;
-
-
-/**/
-var util = require('core-util-is');
-util.inherits = require('inherits');
-/**/
-
-
-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;
-}
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/core-util-is/README.md b/builder/node_modules/archiver/node_modules/readable-stream/node_modules/core-util-is/README.md
deleted file mode 100644
index 5a76b414..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/core-util-is/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# core-util-is
-
-The `util.is*` functions introduced in Node v0.12.
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/core-util-is/float.patch b/builder/node_modules/archiver/node_modules/readable-stream/node_modules/core-util-is/float.patch
deleted file mode 100644
index a06d5c05..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/core-util-is/float.patch
+++ /dev/null
@@ -1,604 +0,0 @@
-diff --git a/lib/util.js b/lib/util.js
-index a03e874..9074e8e 100644
---- a/lib/util.js
-+++ b/lib/util.js
-@@ -19,430 +19,6 @@
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
-
--var formatRegExp = /%[sdj%]/g;
--exports.format = function(f) {
-- if (!isString(f)) {
-- var objects = [];
-- for (var i = 0; i < arguments.length; i++) {
-- objects.push(inspect(arguments[i]));
-- }
-- return objects.join(' ');
-- }
--
-- var i = 1;
-- var args = arguments;
-- var len = args.length;
-- var str = String(f).replace(formatRegExp, function(x) {
-- if (x === '%%') return '%';
-- if (i >= len) return x;
-- switch (x) {
-- case '%s': return String(args[i++]);
-- case '%d': return Number(args[i++]);
-- case '%j':
-- try {
-- return JSON.stringify(args[i++]);
-- } catch (_) {
-- return '[Circular]';
-- }
-- default:
-- return x;
-- }
-- });
-- for (var x = args[i]; i < len; x = args[++i]) {
-- if (isNull(x) || !isObject(x)) {
-- str += ' ' + x;
-- } else {
-- str += ' ' + inspect(x);
-- }
-- }
-- return str;
--};
--
--
--// Mark that a method should not be used.
--// Returns a modified function which warns once by default.
--// If --no-deprecation is set, then it is a no-op.
--exports.deprecate = function(fn, msg) {
-- // Allow for deprecating things in the process of starting up.
-- if (isUndefined(global.process)) {
-- return function() {
-- return exports.deprecate(fn, msg).apply(this, arguments);
-- };
-- }
--
-- if (process.noDeprecation === true) {
-- return fn;
-- }
--
-- var warned = false;
-- function deprecated() {
-- if (!warned) {
-- if (process.throwDeprecation) {
-- throw new Error(msg);
-- } else if (process.traceDeprecation) {
-- console.trace(msg);
-- } else {
-- console.error(msg);
-- }
-- warned = true;
-- }
-- return fn.apply(this, arguments);
-- }
--
-- return deprecated;
--};
--
--
--var debugs = {};
--var debugEnviron;
--exports.debuglog = function(set) {
-- if (isUndefined(debugEnviron))
-- debugEnviron = process.env.NODE_DEBUG || '';
-- set = set.toUpperCase();
-- if (!debugs[set]) {
-- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
-- var pid = process.pid;
-- debugs[set] = function() {
-- var msg = exports.format.apply(exports, arguments);
-- console.error('%s %d: %s', set, pid, msg);
-- };
-- } else {
-- debugs[set] = function() {};
-- }
-- }
-- return debugs[set];
--};
--
--
--/**
-- * Echos the value of a value. Trys to print the value out
-- * in the best way possible given the different types.
-- *
-- * @param {Object} obj The object to print out.
-- * @param {Object} opts Optional options object that alters the output.
-- */
--/* legacy: obj, showHidden, depth, colors*/
--function inspect(obj, opts) {
-- // default options
-- var ctx = {
-- seen: [],
-- stylize: stylizeNoColor
-- };
-- // legacy...
-- if (arguments.length >= 3) ctx.depth = arguments[2];
-- if (arguments.length >= 4) ctx.colors = arguments[3];
-- if (isBoolean(opts)) {
-- // legacy...
-- ctx.showHidden = opts;
-- } else if (opts) {
-- // got an "options" object
-- exports._extend(ctx, opts);
-- }
-- // set default options
-- if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
-- if (isUndefined(ctx.depth)) ctx.depth = 2;
-- if (isUndefined(ctx.colors)) ctx.colors = false;
-- if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
-- if (ctx.colors) ctx.stylize = stylizeWithColor;
-- return formatValue(ctx, obj, ctx.depth);
--}
--exports.inspect = inspect;
--
--
--// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
--inspect.colors = {
-- 'bold' : [1, 22],
-- 'italic' : [3, 23],
-- 'underline' : [4, 24],
-- 'inverse' : [7, 27],
-- 'white' : [37, 39],
-- 'grey' : [90, 39],
-- 'black' : [30, 39],
-- 'blue' : [34, 39],
-- 'cyan' : [36, 39],
-- 'green' : [32, 39],
-- 'magenta' : [35, 39],
-- 'red' : [31, 39],
-- 'yellow' : [33, 39]
--};
--
--// Don't use 'blue' not visible on cmd.exe
--inspect.styles = {
-- 'special': 'cyan',
-- 'number': 'yellow',
-- 'boolean': 'yellow',
-- 'undefined': 'grey',
-- 'null': 'bold',
-- 'string': 'green',
-- 'date': 'magenta',
-- // "name": intentionally not styling
-- 'regexp': 'red'
--};
--
--
--function stylizeWithColor(str, styleType) {
-- var style = inspect.styles[styleType];
--
-- if (style) {
-- return '\u001b[' + inspect.colors[style][0] + 'm' + str +
-- '\u001b[' + inspect.colors[style][1] + 'm';
-- } else {
-- return str;
-- }
--}
--
--
--function stylizeNoColor(str, styleType) {
-- return str;
--}
--
--
--function arrayToHash(array) {
-- var hash = {};
--
-- array.forEach(function(val, idx) {
-- hash[val] = true;
-- });
--
-- return hash;
--}
--
--
--function formatValue(ctx, value, recurseTimes) {
-- // Provide a hook for user-specified inspect functions.
-- // Check that value is an object with an inspect function on it
-- if (ctx.customInspect &&
-- value &&
-- isFunction(value.inspect) &&
-- // Filter out the util module, it's inspect function is special
-- value.inspect !== exports.inspect &&
-- // Also filter out any prototype objects using the circular check.
-- !(value.constructor && value.constructor.prototype === value)) {
-- var ret = value.inspect(recurseTimes, ctx);
-- if (!isString(ret)) {
-- ret = formatValue(ctx, ret, recurseTimes);
-- }
-- return ret;
-- }
--
-- // Primitive types cannot have properties
-- var primitive = formatPrimitive(ctx, value);
-- if (primitive) {
-- return primitive;
-- }
--
-- // Look up the keys of the object.
-- var keys = Object.keys(value);
-- var visibleKeys = arrayToHash(keys);
--
-- if (ctx.showHidden) {
-- keys = Object.getOwnPropertyNames(value);
-- }
--
-- // Some type of object without properties can be shortcutted.
-- if (keys.length === 0) {
-- if (isFunction(value)) {
-- var name = value.name ? ': ' + value.name : '';
-- return ctx.stylize('[Function' + name + ']', 'special');
-- }
-- if (isRegExp(value)) {
-- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
-- }
-- if (isDate(value)) {
-- return ctx.stylize(Date.prototype.toString.call(value), 'date');
-- }
-- if (isError(value)) {
-- return formatError(value);
-- }
-- }
--
-- var base = '', array = false, braces = ['{', '}'];
--
-- // Make Array say that they are Array
-- if (isArray(value)) {
-- array = true;
-- braces = ['[', ']'];
-- }
--
-- // Make functions say that they are functions
-- if (isFunction(value)) {
-- var n = value.name ? ': ' + value.name : '';
-- base = ' [Function' + n + ']';
-- }
--
-- // Make RegExps say that they are RegExps
-- if (isRegExp(value)) {
-- base = ' ' + RegExp.prototype.toString.call(value);
-- }
--
-- // Make dates with properties first say the date
-- if (isDate(value)) {
-- base = ' ' + Date.prototype.toUTCString.call(value);
-- }
--
-- // Make error with message first say the error
-- if (isError(value)) {
-- base = ' ' + formatError(value);
-- }
--
-- if (keys.length === 0 && (!array || value.length == 0)) {
-- return braces[0] + base + braces[1];
-- }
--
-- if (recurseTimes < 0) {
-- if (isRegExp(value)) {
-- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
-- } else {
-- return ctx.stylize('[Object]', 'special');
-- }
-- }
--
-- ctx.seen.push(value);
--
-- var output;
-- if (array) {
-- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
-- } else {
-- output = keys.map(function(key) {
-- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
-- });
-- }
--
-- ctx.seen.pop();
--
-- return reduceToSingleString(output, base, braces);
--}
--
--
--function formatPrimitive(ctx, value) {
-- if (isUndefined(value))
-- return ctx.stylize('undefined', 'undefined');
-- if (isString(value)) {
-- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
-- .replace(/'/g, "\\'")
-- .replace(/\\"/g, '"') + '\'';
-- return ctx.stylize(simple, 'string');
-- }
-- if (isNumber(value)) {
-- // Format -0 as '-0'. Strict equality won't distinguish 0 from -0,
-- // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 .
-- if (value === 0 && 1 / value < 0)
-- return ctx.stylize('-0', 'number');
-- return ctx.stylize('' + value, 'number');
-- }
-- if (isBoolean(value))
-- return ctx.stylize('' + value, 'boolean');
-- // For some reason typeof null is "object", so special case here.
-- if (isNull(value))
-- return ctx.stylize('null', 'null');
--}
--
--
--function formatError(value) {
-- return '[' + Error.prototype.toString.call(value) + ']';
--}
--
--
--function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
-- var output = [];
-- for (var i = 0, l = value.length; i < l; ++i) {
-- if (hasOwnProperty(value, String(i))) {
-- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
-- String(i), true));
-- } else {
-- output.push('');
-- }
-- }
-- keys.forEach(function(key) {
-- if (!key.match(/^\d+$/)) {
-- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
-- key, true));
-- }
-- });
-- return output;
--}
--
--
--function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
-- var name, str, desc;
-- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
-- if (desc.get) {
-- if (desc.set) {
-- str = ctx.stylize('[Getter/Setter]', 'special');
-- } else {
-- str = ctx.stylize('[Getter]', 'special');
-- }
-- } else {
-- if (desc.set) {
-- str = ctx.stylize('[Setter]', 'special');
-- }
-- }
-- if (!hasOwnProperty(visibleKeys, key)) {
-- name = '[' + key + ']';
-- }
-- if (!str) {
-- if (ctx.seen.indexOf(desc.value) < 0) {
-- if (isNull(recurseTimes)) {
-- str = formatValue(ctx, desc.value, null);
-- } else {
-- str = formatValue(ctx, desc.value, recurseTimes - 1);
-- }
-- if (str.indexOf('\n') > -1) {
-- if (array) {
-- str = str.split('\n').map(function(line) {
-- return ' ' + line;
-- }).join('\n').substr(2);
-- } else {
-- str = '\n' + str.split('\n').map(function(line) {
-- return ' ' + line;
-- }).join('\n');
-- }
-- }
-- } else {
-- str = ctx.stylize('[Circular]', 'special');
-- }
-- }
-- if (isUndefined(name)) {
-- if (array && key.match(/^\d+$/)) {
-- return str;
-- }
-- name = JSON.stringify('' + key);
-- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
-- name = name.substr(1, name.length - 2);
-- name = ctx.stylize(name, 'name');
-- } else {
-- name = name.replace(/'/g, "\\'")
-- .replace(/\\"/g, '"')
-- .replace(/(^"|"$)/g, "'");
-- name = ctx.stylize(name, 'string');
-- }
-- }
--
-- return name + ': ' + str;
--}
--
--
--function reduceToSingleString(output, base, braces) {
-- var numLinesEst = 0;
-- var length = output.reduce(function(prev, cur) {
-- numLinesEst++;
-- if (cur.indexOf('\n') >= 0) numLinesEst++;
-- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
-- }, 0);
--
-- if (length > 60) {
-- return braces[0] +
-- (base === '' ? '' : base + '\n ') +
-- ' ' +
-- output.join(',\n ') +
-- ' ' +
-- braces[1];
-- }
--
-- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
--}
--
--
- // NOTE: These type checking functions intentionally don't use `instanceof`
- // because it is fragile and can be easily faked with `Object.create()`.
- function isArray(ar) {
-@@ -522,166 +98,10 @@ function isPrimitive(arg) {
- exports.isPrimitive = isPrimitive;
-
- function isBuffer(arg) {
-- return arg instanceof Buffer;
-+ return Buffer.isBuffer(arg);
- }
- exports.isBuffer = isBuffer;
-
- function objectToString(o) {
- return Object.prototype.toString.call(o);
--}
--
--
--function pad(n) {
-- return n < 10 ? '0' + n.toString(10) : n.toString(10);
--}
--
--
--var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
-- 'Oct', 'Nov', 'Dec'];
--
--// 26 Feb 16:19:34
--function timestamp() {
-- var d = new Date();
-- var time = [pad(d.getHours()),
-- pad(d.getMinutes()),
-- pad(d.getSeconds())].join(':');
-- return [d.getDate(), months[d.getMonth()], time].join(' ');
--}
--
--
--// log is just a thin wrapper to console.log that prepends a timestamp
--exports.log = function() {
-- console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
--};
--
--
--/**
-- * Inherit the prototype methods from one constructor into another.
-- *
-- * The Function.prototype.inherits from lang.js rewritten as a standalone
-- * function (not on Function.prototype). NOTE: If this file is to be loaded
-- * during bootstrapping this function needs to be rewritten using some native
-- * functions as prototype setup using normal JavaScript does not work as
-- * expected during bootstrapping (see mirror.js in r114903).
-- *
-- * @param {function} ctor Constructor function which needs to inherit the
-- * prototype.
-- * @param {function} superCtor Constructor function to inherit prototype from.
-- */
--exports.inherits = function(ctor, superCtor) {
-- ctor.super_ = superCtor;
-- ctor.prototype = Object.create(superCtor.prototype, {
-- constructor: {
-- value: ctor,
-- enumerable: false,
-- writable: true,
-- configurable: true
-- }
-- });
--};
--
--exports._extend = function(origin, add) {
-- // Don't do anything if add isn't an object
-- if (!add || !isObject(add)) return origin;
--
-- var keys = Object.keys(add);
-- var i = keys.length;
-- while (i--) {
-- origin[keys[i]] = add[keys[i]];
-- }
-- return origin;
--};
--
--function hasOwnProperty(obj, prop) {
-- return Object.prototype.hasOwnProperty.call(obj, prop);
--}
--
--
--// Deprecated old stuff.
--
--exports.p = exports.deprecate(function() {
-- for (var i = 0, len = arguments.length; i < len; ++i) {
-- console.error(exports.inspect(arguments[i]));
-- }
--}, 'util.p: Use console.error() instead');
--
--
--exports.exec = exports.deprecate(function() {
-- return require('child_process').exec.apply(this, arguments);
--}, 'util.exec is now called `child_process.exec`.');
--
--
--exports.print = exports.deprecate(function() {
-- for (var i = 0, len = arguments.length; i < len; ++i) {
-- process.stdout.write(String(arguments[i]));
-- }
--}, 'util.print: Use console.log instead');
--
--
--exports.puts = exports.deprecate(function() {
-- for (var i = 0, len = arguments.length; i < len; ++i) {
-- process.stdout.write(arguments[i] + '\n');
-- }
--}, 'util.puts: Use console.log instead');
--
--
--exports.debug = exports.deprecate(function(x) {
-- process.stderr.write('DEBUG: ' + x + '\n');
--}, 'util.debug: Use console.error instead');
--
--
--exports.error = exports.deprecate(function(x) {
-- for (var i = 0, len = arguments.length; i < len; ++i) {
-- process.stderr.write(arguments[i] + '\n');
-- }
--}, 'util.error: Use console.error instead');
--
--
--exports.pump = exports.deprecate(function(readStream, writeStream, callback) {
-- var callbackCalled = false;
--
-- function call(a, b, c) {
-- if (callback && !callbackCalled) {
-- callback(a, b, c);
-- callbackCalled = true;
-- }
-- }
--
-- readStream.addListener('data', function(chunk) {
-- if (writeStream.write(chunk) === false) readStream.pause();
-- });
--
-- writeStream.addListener('drain', function() {
-- readStream.resume();
-- });
--
-- readStream.addListener('end', function() {
-- writeStream.end();
-- });
--
-- readStream.addListener('close', function() {
-- call();
-- });
--
-- readStream.addListener('error', function(err) {
-- writeStream.end();
-- call(err);
-- });
--
-- writeStream.addListener('error', function(err) {
-- readStream.destroy();
-- call(err);
-- });
--}, 'util.pump(): Use readableStream.pipe() instead');
--
--
--var uv;
--exports._errnoException = function(err, syscall) {
-- if (isUndefined(uv)) uv = process.binding('uv');
-- var errname = uv.errname(err);
-- var e = new Error(syscall + ' ' + errname);
-- e.code = errname;
-- e.errno = errname;
-- e.syscall = syscall;
-- return e;
--};
-+}
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/builder/node_modules/archiver/node_modules/readable-stream/node_modules/core-util-is/lib/util.js
deleted file mode 100644
index 9074e8eb..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/core-util-is/lib/util.js
+++ /dev/null
@@ -1,107 +0,0 @@
-// 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.
-
-// NOTE: These type checking functions intentionally don't use `instanceof`
-// because it is fragile and can be easily faked with `Object.create()`.
-function isArray(ar) {
- return Array.isArray(ar);
-}
-exports.isArray = isArray;
-
-function isBoolean(arg) {
- return typeof arg === 'boolean';
-}
-exports.isBoolean = isBoolean;
-
-function isNull(arg) {
- return arg === null;
-}
-exports.isNull = isNull;
-
-function isNullOrUndefined(arg) {
- return arg == null;
-}
-exports.isNullOrUndefined = isNullOrUndefined;
-
-function isNumber(arg) {
- return typeof arg === 'number';
-}
-exports.isNumber = isNumber;
-
-function isString(arg) {
- return typeof arg === 'string';
-}
-exports.isString = isString;
-
-function isSymbol(arg) {
- return typeof arg === 'symbol';
-}
-exports.isSymbol = isSymbol;
-
-function isUndefined(arg) {
- return arg === void 0;
-}
-exports.isUndefined = isUndefined;
-
-function isRegExp(re) {
- return isObject(re) && objectToString(re) === '[object RegExp]';
-}
-exports.isRegExp = isRegExp;
-
-function isObject(arg) {
- return typeof arg === 'object' && arg !== null;
-}
-exports.isObject = isObject;
-
-function isDate(d) {
- return isObject(d) && objectToString(d) === '[object Date]';
-}
-exports.isDate = isDate;
-
-function isError(e) {
- return isObject(e) &&
- (objectToString(e) === '[object Error]' || e instanceof Error);
-}
-exports.isError = isError;
-
-function isFunction(arg) {
- return typeof arg === 'function';
-}
-exports.isFunction = isFunction;
-
-function isPrimitive(arg) {
- return arg === null ||
- typeof arg === 'boolean' ||
- typeof arg === 'number' ||
- typeof arg === 'string' ||
- typeof arg === 'symbol' || // ES6 symbol
- typeof arg === 'undefined';
-}
-exports.isPrimitive = isPrimitive;
-
-function isBuffer(arg) {
- return Buffer.isBuffer(arg);
-}
-exports.isBuffer = isBuffer;
-
-function objectToString(o) {
- return Object.prototype.toString.call(o);
-}
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/core-util-is/package.json b/builder/node_modules/archiver/node_modules/readable-stream/node_modules/core-util-is/package.json
deleted file mode 100644
index cb9aa927..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/core-util-is/package.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "name": "core-util-is",
- "version": "1.0.1",
- "description": "The `util.is*` functions introduced in Node v0.12.",
- "main": "lib/util.js",
- "repository": {
- "type": "git",
- "url": "git://github.com/isaacs/core-util-is"
- },
- "keywords": [
- "util",
- "isBuffer",
- "isArray",
- "isNumber",
- "isString",
- "isRegExp",
- "isThis",
- "isThat",
- "polyfill"
- ],
- "author": {
- "name": "Isaac Z. Schlueter",
- "email": "i@izs.me",
- "url": "http://blog.izs.me/"
- },
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/isaacs/core-util-is/issues"
- },
- "readme": "# core-util-is\n\nThe `util.is*` functions introduced in Node v0.12.\n",
- "readmeFilename": "README.md",
- "homepage": "https://github.com/isaacs/core-util-is",
- "_id": "core-util-is@1.0.1",
- "_from": "core-util-is@~1.0.0"
-}
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/core-util-is/util.js b/builder/node_modules/archiver/node_modules/readable-stream/node_modules/core-util-is/util.js
deleted file mode 100644
index 007fa105..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/core-util-is/util.js
+++ /dev/null
@@ -1,106 +0,0 @@
-// 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.
-
-// NOTE: These type checking functions intentionally don't use `instanceof`
-// because it is fragile and can be easily faked with `Object.create()`.
-function isArray(ar) {
- return Array.isArray(ar);
-}
-exports.isArray = isArray;
-
-function isBoolean(arg) {
- return typeof arg === 'boolean';
-}
-exports.isBoolean = isBoolean;
-
-function isNull(arg) {
- return arg === null;
-}
-exports.isNull = isNull;
-
-function isNullOrUndefined(arg) {
- return arg == null;
-}
-exports.isNullOrUndefined = isNullOrUndefined;
-
-function isNumber(arg) {
- return typeof arg === 'number';
-}
-exports.isNumber = isNumber;
-
-function isString(arg) {
- return typeof arg === 'string';
-}
-exports.isString = isString;
-
-function isSymbol(arg) {
- return typeof arg === 'symbol';
-}
-exports.isSymbol = isSymbol;
-
-function isUndefined(arg) {
- return arg === void 0;
-}
-exports.isUndefined = isUndefined;
-
-function isRegExp(re) {
- return isObject(re) && objectToString(re) === '[object RegExp]';
-}
-exports.isRegExp = isRegExp;
-
-function isObject(arg) {
- return typeof arg === 'object' && arg !== null;
-}
-exports.isObject = isObject;
-
-function isDate(d) {
- return isObject(d) && objectToString(d) === '[object Date]';
-}
-exports.isDate = isDate;
-
-function isError(e) {
- return isObject(e) && objectToString(e) === '[object Error]';
-}
-exports.isError = isError;
-
-function isFunction(arg) {
- return typeof arg === 'function';
-}
-exports.isFunction = isFunction;
-
-function isPrimitive(arg) {
- return arg === null ||
- typeof arg === 'boolean' ||
- typeof arg === 'number' ||
- typeof arg === 'string' ||
- typeof arg === 'symbol' || // ES6 symbol
- typeof arg === 'undefined';
-}
-exports.isPrimitive = isPrimitive;
-
-function isBuffer(arg) {
- return arg instanceof Buffer;
-}
-exports.isBuffer = isBuffer;
-
-function objectToString(o) {
- return Object.prototype.toString.call(o);
-}
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/inherits/LICENSE b/builder/node_modules/archiver/node_modules/readable-stream/node_modules/inherits/LICENSE
deleted file mode 100644
index dea3013d..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/inherits/LICENSE
+++ /dev/null
@@ -1,16 +0,0 @@
-The ISC License
-
-Copyright (c) Isaac Z. Schlueter
-
-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.
-
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/inherits/README.md b/builder/node_modules/archiver/node_modules/readable-stream/node_modules/inherits/README.md
deleted file mode 100644
index b1c56658..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/inherits/README.md
+++ /dev/null
@@ -1,42 +0,0 @@
-Browser-friendly inheritance fully compatible with standard node.js
-[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).
-
-This package exports standard `inherits` from node.js `util` module in
-node environment, but also provides alternative browser-friendly
-implementation through [browser
-field](https://gist.github.com/shtylman/4339901). Alternative
-implementation is a literal copy of standard one located in standalone
-module to avoid requiring of `util`. It also has a shim for old
-browsers with no `Object.create` support.
-
-While keeping you sure you are using standard `inherits`
-implementation in node.js environment, it allows bundlers such as
-[browserify](https://github.com/substack/node-browserify) to not
-include full `util` package to your client code if all you need is
-just `inherits` function. It worth, because browser shim for `util`
-package is large and `inherits` is often the single function you need
-from it.
-
-It's recommended to use this package instead of
-`require('util').inherits` for any code that has chances to be used
-not only in node.js but in browser too.
-
-## usage
-
-```js
-var inherits = require('inherits');
-// then use exactly as the standard one
-```
-
-## note on version ~1.0
-
-Version ~1.0 had completely different motivation and is not compatible
-neither with 2.0 nor with standard node.js `inherits`.
-
-If you are using version ~1.0 and planning to switch to ~2.0, be
-careful:
-
-* new version uses `super_` instead of `super` for referencing
- superclass
-* new version overwrites current prototype while old one preserves any
- existing fields on it
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/inherits/inherits.js b/builder/node_modules/archiver/node_modules/readable-stream/node_modules/inherits/inherits.js
deleted file mode 100644
index 29f5e24f..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/inherits/inherits.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('util').inherits
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/inherits/inherits_browser.js b/builder/node_modules/archiver/node_modules/readable-stream/node_modules/inherits/inherits_browser.js
deleted file mode 100644
index c1e78a75..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/inherits/inherits_browser.js
+++ /dev/null
@@ -1,23 +0,0 @@
-if (typeof Object.create === 'function') {
- // implementation from standard node.js 'util' module
- module.exports = function inherits(ctor, superCtor) {
- ctor.super_ = superCtor
- ctor.prototype = Object.create(superCtor.prototype, {
- constructor: {
- value: ctor,
- enumerable: false,
- writable: true,
- configurable: true
- }
- });
- };
-} else {
- // old school shim for old browsers
- module.exports = function inherits(ctor, superCtor) {
- ctor.super_ = superCtor
- var TempCtor = function () {}
- TempCtor.prototype = superCtor.prototype
- ctor.prototype = new TempCtor()
- ctor.prototype.constructor = ctor
- }
-}
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/inherits/package.json b/builder/node_modules/archiver/node_modules/readable-stream/node_modules/inherits/package.json
deleted file mode 100644
index c532ca6d..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/inherits/package.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "name": "inherits",
- "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()",
- "version": "2.0.1",
- "keywords": [
- "inheritance",
- "class",
- "klass",
- "oop",
- "object-oriented",
- "inherits",
- "browser",
- "browserify"
- ],
- "main": "./inherits.js",
- "browser": "./inherits_browser.js",
- "repository": {
- "type": "git",
- "url": "git://github.com/isaacs/inherits"
- },
- "license": "ISC",
- "scripts": {
- "test": "node test"
- },
- "readme": "Browser-friendly inheritance fully compatible with standard node.js\n[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).\n\nThis package exports standard `inherits` from node.js `util` module in\nnode environment, but also provides alternative browser-friendly\nimplementation through [browser\nfield](https://gist.github.com/shtylman/4339901). Alternative\nimplementation is a literal copy of standard one located in standalone\nmodule to avoid requiring of `util`. It also has a shim for old\nbrowsers with no `Object.create` support.\n\nWhile keeping you sure you are using standard `inherits`\nimplementation in node.js environment, it allows bundlers such as\n[browserify](https://github.com/substack/node-browserify) to not\ninclude full `util` package to your client code if all you need is\njust `inherits` function. It worth, because browser shim for `util`\npackage is large and `inherits` is often the single function you need\nfrom it.\n\nIt's recommended to use this package instead of\n`require('util').inherits` for any code that has chances to be used\nnot only in node.js but in browser too.\n\n## usage\n\n```js\nvar inherits = require('inherits');\n// then use exactly as the standard one\n```\n\n## note on version ~1.0\n\nVersion ~1.0 had completely different motivation and is not compatible\nneither with 2.0 nor with standard node.js `inherits`.\n\nIf you are using version ~1.0 and planning to switch to ~2.0, be\ncareful:\n\n* new version uses `super_` instead of `super` for referencing\n superclass\n* new version overwrites current prototype while old one preserves any\n existing fields on it\n",
- "readmeFilename": "README.md",
- "bugs": {
- "url": "https://github.com/isaacs/inherits/issues"
- },
- "homepage": "https://github.com/isaacs/inherits",
- "_id": "inherits@2.0.1",
- "_from": "inherits@~2.0.1"
-}
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/inherits/test.js b/builder/node_modules/archiver/node_modules/readable-stream/node_modules/inherits/test.js
deleted file mode 100644
index fc53012d..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/inherits/test.js
+++ /dev/null
@@ -1,25 +0,0 @@
-var inherits = require('./inherits.js')
-var assert = require('assert')
-
-function test(c) {
- assert(c.constructor === Child)
- assert(c.constructor.super_ === Parent)
- assert(Object.getPrototypeOf(c) === Child.prototype)
- assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype)
- assert(c instanceof Child)
- assert(c instanceof Parent)
-}
-
-function Child() {
- Parent.call(this)
- test(this)
-}
-
-function Parent() {}
-
-inherits(Child, Parent)
-
-var c = new Child
-test(c)
-
-console.log('ok')
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/isarray/README.md b/builder/node_modules/archiver/node_modules/readable-stream/node_modules/isarray/README.md
deleted file mode 100644
index 052a62b8..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/isarray/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-# 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.
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/isarray/build/build.js b/builder/node_modules/archiver/node_modules/readable-stream/node_modules/isarray/build/build.js
deleted file mode 100644
index ec58596a..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/isarray/build/build.js
+++ /dev/null
@@ -1,209 +0,0 @@
-
-/**
- * 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");
-
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/isarray/component.json b/builder/node_modules/archiver/node_modules/readable-stream/node_modules/isarray/component.json
deleted file mode 100644
index 9e31b683..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/isarray/component.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "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"
-}
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/isarray/index.js b/builder/node_modules/archiver/node_modules/readable-stream/node_modules/isarray/index.js
deleted file mode 100644
index 5f5ad45d..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/isarray/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-module.exports = Array.isArray || function (arr) {
- return Object.prototype.toString.call(arr) == '[object Array]';
-};
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/isarray/package.json b/builder/node_modules/archiver/node_modules/readable-stream/node_modules/isarray/package.json
deleted file mode 100644
index 5cc2a254..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/isarray/package.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "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",
- "readme": "\n# isarray\n\n`Array#isArray` for older browsers.\n\n## Usage\n\n```js\nvar isArray = require('isarray');\n\nconsole.log(isArray([])); // => true\nconsole.log(isArray({})); // => false\n```\n\n## Installation\n\nWith [npm](http://npmjs.org) do\n\n```bash\n$ npm install isarray\n```\n\nThen bundle for the browser with\n[browserify](https://github.com/substack/browserify).\n\nWith [component](http://component.io) do\n\n```bash\n$ component install juliangruber/isarray\n```\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber <julian@juliangruber.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
- "readmeFilename": "README.md",
- "bugs": {
- "url": "https://github.com/juliangruber/isarray/issues"
- },
- "_id": "isarray@0.0.1",
- "dist": {
- "shasum": "1f45259b41ac97ba8b4ca2c9ef5940e8fb7496ff"
- },
- "_from": "isarray@0.0.1",
- "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
-}
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/.npmignore b/builder/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/.npmignore
deleted file mode 100644
index 206320cc..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/.npmignore
+++ /dev/null
@@ -1,2 +0,0 @@
-build
-test
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/LICENSE b/builder/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/LICENSE
deleted file mode 100644
index 6de584a4..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-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.
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/README.md b/builder/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/README.md
deleted file mode 100644
index 4d2aa001..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-**string_decoder.js** (`require('string_decoder')`) from Node.js core
-
-Copyright Joyent, Inc. and other Node contributors. See LICENCE file for details.
-
-Version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.**
-
-The *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version.
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/index.js b/builder/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/index.js
deleted file mode 100644
index 2e44a03e..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/index.js
+++ /dev/null
@@ -1,200 +0,0 @@
-// 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.
-
-var Buffer = require('buffer').Buffer;
-
-var isBufferEncoding = Buffer.isEncoding
- || function(encoding) {
- switch (encoding && encoding.toLowerCase()) {
- case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true;
- default: return false;
- }
- }
-
-
-function assertEncoding(encoding) {
- if (encoding && !isBufferEncoding(encoding)) {
- throw new Error('Unknown encoding: ' + encoding);
- }
-}
-
-var StringDecoder = exports.StringDecoder = function(encoding) {
- this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');
- assertEncoding(encoding);
- switch (this.encoding) {
- case 'utf8':
- // CESU-8 represents each of Surrogate Pair by 3-bytes
- this.surrogateSize = 3;
- break;
- case 'ucs2':
- case 'utf16le':
- // UTF-16 represents each of Surrogate Pair by 2-bytes
- this.surrogateSize = 2;
- this.detectIncompleteChar = utf16DetectIncompleteChar;
- break;
- case 'base64':
- // Base-64 stores 3 bytes in 4 chars, and pads the remainder.
- this.surrogateSize = 3;
- this.detectIncompleteChar = base64DetectIncompleteChar;
- break;
- default:
- this.write = passThroughWrite;
- return;
- }
-
- this.charBuffer = new Buffer(6);
- this.charReceived = 0;
- this.charLength = 0;
-};
-
-
-StringDecoder.prototype.write = function(buffer) {
- var charStr = '';
- var offset = 0;
-
- // if our last write ended with an incomplete multibyte character
- while (this.charLength) {
- // determine how many remaining bytes this buffer has to offer for this char
- var i = (buffer.length >= this.charLength - this.charReceived) ?
- this.charLength - this.charReceived :
- buffer.length;
-
- // add the new bytes to the char buffer
- buffer.copy(this.charBuffer, this.charReceived, offset, i);
- this.charReceived += (i - offset);
- offset = i;
-
- if (this.charReceived < this.charLength) {
- // still not enough chars in this buffer? wait for more ...
- return '';
- }
-
- // get the character that was split
- charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);
-
- // lead surrogate (D800-DBFF) is also the incomplete character
- var charCode = charStr.charCodeAt(charStr.length - 1);
- if (charCode >= 0xD800 && charCode <= 0xDBFF) {
- this.charLength += this.surrogateSize;
- charStr = '';
- continue;
- }
- this.charReceived = this.charLength = 0;
-
- // if there are no more bytes in this buffer, just emit our char
- if (i == buffer.length) return charStr;
-
- // otherwise cut off the characters end from the beginning of this buffer
- buffer = buffer.slice(i, buffer.length);
- break;
- }
-
- var lenIncomplete = this.detectIncompleteChar(buffer);
-
- var end = buffer.length;
- if (this.charLength) {
- // buffer the incomplete character bytes we got
- buffer.copy(this.charBuffer, 0, buffer.length - lenIncomplete, end);
- this.charReceived = lenIncomplete;
- end -= lenIncomplete;
- }
-
- charStr += buffer.toString(this.encoding, 0, end);
-
- var end = charStr.length - 1;
- var charCode = charStr.charCodeAt(end);
- // lead surrogate (D800-DBFF) is also the incomplete character
- if (charCode >= 0xD800 && charCode <= 0xDBFF) {
- var size = this.surrogateSize;
- this.charLength += size;
- this.charReceived += size;
- this.charBuffer.copy(this.charBuffer, size, 0, size);
- this.charBuffer.write(charStr.charAt(charStr.length - 1), this.encoding);
- return charStr.substring(0, end);
- }
-
- // or just emit the charStr
- return charStr;
-};
-
-StringDecoder.prototype.detectIncompleteChar = function(buffer) {
- // determine how many bytes we have to check at the end of this buffer
- var i = (buffer.length >= 3) ? 3 : buffer.length;
-
- // Figure out if one of the last i bytes of our buffer announces an
- // incomplete char.
- for (; i > 0; i--) {
- var c = buffer[buffer.length - i];
-
- // See http://en.wikipedia.org/wiki/UTF-8#Description
-
- // 110XXXXX
- if (i == 1 && c >> 5 == 0x06) {
- this.charLength = 2;
- break;
- }
-
- // 1110XXXX
- if (i <= 2 && c >> 4 == 0x0E) {
- this.charLength = 3;
- break;
- }
-
- // 11110XXX
- if (i <= 3 && c >> 3 == 0x1E) {
- this.charLength = 4;
- break;
- }
- }
-
- return i;
-};
-
-StringDecoder.prototype.end = function(buffer) {
- var res = '';
- if (buffer && buffer.length)
- res = this.write(buffer);
-
- if (this.charReceived) {
- var cr = this.charReceived;
- var buf = this.charBuffer;
- var enc = this.encoding;
- res += buf.slice(0, cr).toString(enc);
- }
-
- return res;
-};
-
-function passThroughWrite(buffer) {
- return buffer.toString(this.encoding);
-}
-
-function utf16DetectIncompleteChar(buffer) {
- var incomplete = this.charReceived = buffer.length % 2;
- this.charLength = incomplete ? 2 : 0;
- return incomplete;
-}
-
-function base64DetectIncompleteChar(buffer) {
- var incomplete = this.charReceived = buffer.length % 3;
- this.charLength = incomplete ? 3 : 0;
- return incomplete;
-}
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/package.json b/builder/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/package.json
deleted file mode 100644
index 7f5d0011..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/node_modules/string_decoder/package.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "name": "string_decoder",
- "version": "0.10.25-1",
- "description": "The string_decoder module from Node core",
- "main": "index.js",
- "dependencies": {},
- "devDependencies": {
- "tap": "~0.4.8"
- },
- "scripts": {
- "test": "tap test/simple/*.js"
- },
- "repository": {
- "type": "git",
- "url": "git://github.com/rvagg/string_decoder.git"
- },
- "homepage": "https://github.com/rvagg/string_decoder",
- "keywords": [
- "string",
- "decoder",
- "browser",
- "browserify"
- ],
- "license": "MIT",
- "readme": "**string_decoder.js** (`require('string_decoder')`) from Node.js core\n\nCopyright Joyent, Inc. and other Node contributors. See LICENCE file for details.\n\nVersion numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.**\n\nThe *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version.",
- "readmeFilename": "README.md",
- "bugs": {
- "url": "https://github.com/rvagg/string_decoder/issues"
- },
- "_id": "string_decoder@0.10.25-1",
- "_from": "string_decoder@~0.10.x"
-}
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/package.json b/builder/node_modules/archiver/node_modules/readable-stream/package.json
deleted file mode 100644
index 1767ee12..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/package.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "name": "readable-stream",
- "version": "1.0.27-1",
- "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": {
- "name": "Isaac Z. Schlueter",
- "email": "i@izs.me",
- "url": "http://blog.izs.me/"
- },
- "license": "MIT",
- "readme": "# readable-stream\n\n***Node-core streams for userland***\n\n[](https://nodei.co/npm/readable-stream/)\n[](https://nodei.co/npm/readable-stream/)\n\nThis package is a mirror of the Streams2 and Streams3 implementations in Node-core.\n\nIf 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.\n\n**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.\n\n**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\"`\n\n",
- "readmeFilename": "README.md",
- "bugs": {
- "url": "https://github.com/isaacs/readable-stream/issues"
- },
- "homepage": "https://github.com/isaacs/readable-stream",
- "_id": "readable-stream@1.0.27-1",
- "_from": "readable-stream@~1.0.26"
-}
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/passthrough.js b/builder/node_modules/archiver/node_modules/readable-stream/passthrough.js
deleted file mode 100644
index 27e8d8a5..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/passthrough.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require("./lib/_stream_passthrough.js")
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/readable.js b/builder/node_modules/archiver/node_modules/readable-stream/readable.js
deleted file mode 100644
index 4d1ddfc7..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/readable.js
+++ /dev/null
@@ -1,6 +0,0 @@
-exports = module.exports = require('./lib/_stream_readable.js');
-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');
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/transform.js b/builder/node_modules/archiver/node_modules/readable-stream/transform.js
deleted file mode 100644
index 5d482f07..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/transform.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require("./lib/_stream_transform.js")
diff --git a/builder/node_modules/archiver/node_modules/readable-stream/writable.js b/builder/node_modules/archiver/node_modules/readable-stream/writable.js
deleted file mode 100644
index e1e9efdf..00000000
--- a/builder/node_modules/archiver/node_modules/readable-stream/writable.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require("./lib/_stream_writable.js")
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/.npmignore b/builder/node_modules/archiver/node_modules/tar-stream/.npmignore
deleted file mode 100644
index 7938f33a..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/.npmignore
+++ /dev/null
@@ -1,2 +0,0 @@
-node_modules
-sandbox.js
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/.travis.yml b/builder/node_modules/archiver/node_modules/tar-stream/.travis.yml
deleted file mode 100644
index 9672e129..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/.travis.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-language: node_js
-node_js:
- - "0.8"
- - "0.10"
-before_install:
- - npm install -g npm@~1.4.6
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/README.md b/builder/node_modules/archiver/node_modules/tar-stream/README.md
deleted file mode 100644
index 7ae980ae..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/README.md
+++ /dev/null
@@ -1,119 +0,0 @@
-# tar-stream
-
-tar-stream is a streaming tar parser and generator and nothing else. It is streams2 and operates purely using streams which means you can easily extract/parse tarballs without ever hitting the file system.
-
- npm install tar-stream
-
-[](http://travis-ci.org/mafintosh/tar-stream)
-
-# Usage
-
-tar-stream exposes two streams, [pack](https://github.com/mafintosh/tar-stream#packing) which creates tarballs and [extract](https://github.com/mafintosh/tar-stream#extracting) which extracts tarballs. To [modify an existing tarball](https://github.com/mafintosh/tar-stream#modifying-existing-tarballs) use both.
-
-## Packing
-
-To create a pack stream use `tar.pack()` and call `pack.entry(header, [callback])` to add tar entries.
-
-``` js
-var tar = require('tar-stream');
-var pack = tar.pack(); // p is a streams2 stream
-
-// add a file called my-test.txt with the content "Hello World!"
-pack.entry({ name: 'my-test.txt' }, 'Hello World!');
-
-// add a file called my-stream-test.txt from a stream
-var entry = pack.entry({ name: 'my-stream-test.txt' }, function(err) {
- // the stream was added
- // no more entries
- pack.finalize();
-});
-myStream.pipe(entry);
-
-// pipe the pack stream somewhere
-pack.pipe(process.stdout);
-```
-
-## Extracting
-
-To extract a stream use `tar.extract()` and listen for `extract.on('entry', header, stream, callback)`
-
-``` js
-var extract = tar.extract();
-
-extract.on('entry', function(header, stream, callback) {
- // header is the tar header
- // stream is the content body (might be an empty stream)
- // call next when you are done with this entry
-
- stream.resume(); // just auto drain the stream
- stream.on('end', function() {
- callback(); // ready for next entry
- });
-});
-
-extract.on('finish', function() {
- // all entries read
-});
-
-pack.pipe(extract);
-```
-
-## Headers
-
-The header object using in `entry` should contain the following properties.
-Most of these values can be found by stating a file.
-
-``` js
-{
- name: 'path/to/this/entry.txt',
- size: 1314, // entry size. defaults to 0
- mode: 0644, // entry mode. defaults to to 0755 for dirs and 0644 otherwise
- mtime: new Date(), // last modified date for entry. defaults to now.
- type: 'file', // type of entry. defaults to file. can be:
- // file | link | symlink | directory | block-device
- // character-device | fifo | contigious-file
- linkname: 'path', // linked file name
- uid: 0, // uid of entry owner. defaults to 0
- gid: 0, // gid of entry owner. defaults to 0
- uname: 'maf', // uname of entry owner. defaults to null
- gname: 'staff', // gname of entry owner. defaults to null
- devmajor: 0, // device major version. defaults to 0
- devminor: 0 // device minor version. defaults to 0
-}
-```
-
-## Modifying existing tarballs
-
-Using tar-stream it is easy to rewrite paths / change modes etc in an existing tarball.
-
-``` js
-var extract = tar.extract();
-var pack = tar.pack();
-var path = require('path');
-
-extract.on('entry', function(header, stream, callback) {
- // let's prefix all names with 'tmp'
- header.name = path.join('tmp', header.name);
- // write the new entry to the pack stream
- stream.pipe(pack.entry(header, callback));
-});
-
-extract.on('finish', function() {
- // all entries done - lets finalize it
- pack.finalize();
-});
-
-// pipe the old tarball to the extractor
-oldTarball.pipe(extract);
-
-// pipe the new tarball the another stream
-pack.pipe(newTarball);
-```
-
-## Performance
-
-[See tar-fs for a performance comparison with node-tar](https://github.com/mafintosh/tar-fs/blob/master/README.md#performance)
-
-# License
-
-MIT
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/extract.js b/builder/node_modules/archiver/node_modules/tar-stream/extract.js
deleted file mode 100644
index c5954ebd..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/extract.js
+++ /dev/null
@@ -1,194 +0,0 @@
-var util = require('util');
-var bl = require('bl');
-var xtend = require('xtend');
-var headers = require('./headers');
-
-var Writable = require('readable-stream').Writable;
-var PassThrough = require('readable-stream').PassThrough;
-
-var noop = function() {};
-
-var overflow = function(size) {
- size &= 511;
- return size && 512 - size;
-};
-
-var emptyStream = function() {
- var s = new PassThrough();
- s.end();
- return s;
-};
-
-var mixinPax = function(header, pax) {
- if (pax.path) header.name = pax.path;
- if (pax.linkpath) header.linkname = pax.linkpath;
- return header;
-};
-
-var Extract = function(opts) {
- if (!(this instanceof Extract)) return new Extract(opts);
- Writable.call(this, opts);
-
- this._buffer = bl();
- this._missing = 0;
- this._onparse = noop;
- this._header = null;
- this._stream = null;
- this._overflow = null;
- this._cb = null;
- this._locked = false;
- this._destroyed = false;
- this._pax = null;
- this._paxGlobal = null;
-
- var self = this;
- var b = self._buffer;
-
- var oncontinue = function() {
- self._continue();
- };
-
- var onunlock = function(err) {
- self._locked = false;
- if (err) return self.destroy(err);
- if (!self._stream) oncontinue();
- };
-
- var onstreamend = function() {
- self._stream = null;
- var drain = overflow(self._header.size);
- if (drain) self._parse(drain, ondrain);
- else self._parse(512, onheader);
- if (!self._locked) oncontinue();
- };
-
- var ondrain = function() {
- self._buffer.consume(overflow(self._header.size));
- self._parse(512, onheader);
- oncontinue();
- };
-
- var onpaxglobalheader = function() {
- var size = self._header.size;
- self._paxGlobal = headers.decodePax(b.slice(0, size));
- b.consume(size);
- onstreamend();
- }
-
- var onpaxheader = function() {
- var size = self._header.size;
- self._pax = headers.decodePax(b.slice(0, size));
- if (self._paxGlobal) self._pax = xtend(self._paxGlobal, self._pax);
- b.consume(size);
- onstreamend();
- };
-
- var onheader = function() {
- var header
- try {
- header = self._header = headers.decode(b.slice(0, 512));
- } catch (err) {
- self.emit('error', err);
- }
- b.consume(512);
-
- if (!header) {
- self._parse(512, onheader);
- oncontinue();
- return;
- }
- if (header.type === 'pax-global-header') {
- self._parse(header.size, onpaxglobalheader);
- oncontinue();
- return;
- }
- if (header.type === 'pax-header') {
- self._parse(header.size, onpaxheader);
- oncontinue();
- return;
- }
-
- if (self._pax) {
- self._header = header = mixinPax(header, self._pax);
- self._pax = null;
- }
-
- self._locked = true;
-
- if (!header.size) {
- self._parse(512, onheader);
- self.emit('entry', header, emptyStream(), onunlock);
- return;
- }
-
- self._stream = new PassThrough();
-
- self.emit('entry', header, self._stream, onunlock);
- self._parse(header.size, onstreamend);
- oncontinue();
- };
-
- this._parse(512, onheader);
-};
-
-util.inherits(Extract, Writable);
-
-Extract.prototype.destroy = function(err) {
- if (this._destroyed) return;
- this._destroyed = true;
-
- if (err) this.emit('error', err);
- this.emit('close');
- if (this._stream) this._stream.emit('close');
-};
-
-Extract.prototype._parse = function(size, onparse) {
- if (this._destroyed) return;
- this._missing = size;
- this._onparse = onparse;
-};
-
-Extract.prototype._continue = function(err) {
- if (this._destroyed) return;
- var cb = this._cb;
- this._cb = noop;
- if (this._overflow) this._write(this._overflow, undefined, cb);
- else cb();
-};
-
-Extract.prototype._write = function(data, enc, cb) {
- if (this._destroyed) return;
-
- var s = this._stream;
- var b = this._buffer;
- var missing = this._missing;
-
- // we do not reach end-of-chunk now. just forward it
-
- if (data.length < missing) {
- this._missing -= data.length;
- this._overflow = null;
- if (s) return s.write(data, cb);
- b.append(data);
- return cb();
- }
-
- // end-of-chunk. the parser should call cb.
-
- this._cb = cb;
- this._missing = 0;
-
- var overflow = null;
- if (data.length > missing) {
- overflow = data.slice(missing);
- data = data.slice(0, missing);
- }
-
- if (s) s.end(data);
- else b.append(data);
-
- this._overflow = overflow;
- this._onparse();
-};
-
-module.exports = Extract;
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/headers.js b/builder/node_modules/archiver/node_modules/tar-stream/headers.js
deleted file mode 100644
index 5ea43331..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/headers.js
+++ /dev/null
@@ -1,218 +0,0 @@
-var ZEROS = '0000000000000000000';
-var ZERO_OFFSET = '0'.charCodeAt(0);
-var USTAR = 'ustar\x0000';
-
-var clamp = function(index, len, defaultValue) {
- if (typeof index !== 'number') return defaultValue;
- index = ~~index; // Coerce to integer.
- if (index >= len) return len;
- if (index >= 0) return index;
- index += len;
- if (index >= 0) return index;
- return 0;
-};
-
-var toType = function(flag) {
- switch (flag) {
- case 0:
- return 'file';
- case 1:
- return 'link';
- case 2:
- return 'symlink';
- case 3:
- return 'character-device';
- case 4:
- return 'block-device';
- case 5:
- return 'directory';
- case 6:
- return 'fifo';
- case 7:
- return 'contiguous-file';
- case 72:
- return 'pax-header';
- case 55:
- return 'pax-global-header'
- }
-
- return null;
-};
-
-var toTypeflag = function(flag) {
- switch (flag) {
- case 'file':
- return 0;
- case 'link':
- return 1;
- case 'symlink':
- return 2;
- case 'character-device':
- return 3;
- case 'block-device':
- return 4;
- case 'directory':
- return 5;
- case 'fifo':
- return 6;
- case 'contiguous-file':
- return 7;
- case 'pax-header':
- return 72;
- }
-
- return 0;
-};
-
-var alloc = function(size) {
- var buf = new Buffer(size);
- buf.fill(0);
- return buf;
-};
-
-var indexOf = function(block, num, offset, end) {
- for (; offset < end; offset++) {
- if (block[offset] === num) return offset;
- }
- return end;
-};
-
-var cksum = function(block) {
- var sum = 8 * 32;
- for (var i = 0; i < 148; i++) sum += block[i];
- for (var i = 156; i < 512; i++) sum += block[i];
- return sum;
-};
-
-var encodeOct = function(val, n) {
- val = val.toString(8);
- return ZEROS.slice(0, n-val.length)+val+' ';
-};
-
-var decodeOct = function(val, offset) {
- return parseInt(val.slice(offset, clamp(indexOf(val, 32, offset, val.length), val.length, val.length)).toString(), 8);
-};
-
-var decodeStr = function(val, offset, length) {
- return val.slice(offset, indexOf(val, 0, offset, offset+length)).toString();
-};
-
-var addLength = function(str) {
- var len = Buffer.byteLength(str);
- var digits = Math.floor(Math.log(len) / Math.log(10)) + 1;
- if (len + digits > Math.pow(10, digits)) digits++;
-
- return (len+digits)+str;
-};
-
-exports.encodePax = function(opts) { // TODO: encode more stuff in pax
- var result = '';
- if (opts.name) result += addLength(' path='+opts.name+'\n');
- if (opts.linkname) result += addLength(' linkpath='+opts.linkname+'\n');
- return new Buffer(result);
-};
-
-exports.decodePax = function(buf) {
- var result = {};
-
- while (buf.length) {
- var i = 0;
- for (; i < buf.length && buf[i] !== 32; i++);
- var len = parseInt(buf.slice(0, i).toString());
- if (!len) return result;
-
- var b = buf.slice(i+1, len-1).toString();
- var keyIndex = b.indexOf('=');
- if (keyIndex === -1) return result;
- result[b.slice(0, keyIndex)] = b.slice(keyIndex+1);
-
- buf = buf.slice(len);
- }
-
- return result;
-};
-
-exports.encode = function(opts) {
- var buf = alloc(512);
- var name = opts.name;
- var prefix = '';
-
- if (opts.typeflag === 5 && name[name.length-1] !== '/') name += '/';
- if (Buffer.byteLength(name) !== name.length) return null; // utf-8
-
- while (Buffer.byteLength(name) > 100) {
- var i = name.indexOf('/');
- if (i === -1) return null;
- prefix += prefix ? '/' + name.slice(0, i) : name.slice(0, i);
- name = name.slice(i+1);
- }
-
- if (Buffer.byteLength(name) > 100 || Buffer.byteLength(prefix) > 155) return null;
- if (opts.linkname && Buffer.byteLength(opts.linkname) > 100) return null;
-
- buf.write(name);
- buf.write(encodeOct(opts.mode & 07777, 6), 100);
- buf.write(encodeOct(opts.uid, 6), 108);
- buf.write(encodeOct(opts.gid, 6), 116);
- buf.write(encodeOct(opts.size, 11), 124);
- buf.write(encodeOct((opts.mtime.getTime() / 1000) | 0, 11), 136);
-
- buf[156] = ZERO_OFFSET + toTypeflag(opts.type);
-
- if (opts.linkname) buf.write(opts.linkname, 157);
-
- buf.write(USTAR, 257);
- if (opts.uname) buf.write(opts.uname, 265);
- if (opts.gname) buf.write(opts.gname, 297);
- buf.write(encodeOct(opts.devmajor || 0, 6), 329);
- buf.write(encodeOct(opts.devminor || 0, 6), 337);
-
- if (prefix) buf.write(prefix, 345);
-
- buf.write(encodeOct(cksum(buf), 6), 148);
-
- return buf;
-};
-
-exports.decode = function(buf) {
- var typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET;
- var type = toType(typeflag);
-
- var name = decodeStr(buf, 0, 100);
- var mode = decodeOct(buf, 100);
- var uid = decodeOct(buf, 108);
- var gid = decodeOct(buf, 116);
- var size = decodeOct(buf, 124);
- var mtime = decodeOct(buf, 136);
- var linkname = buf[157] === 0 ? null : decodeStr(buf, 157, 100);
- var uname = decodeStr(buf, 265, 32);
- var gname = decodeStr(buf, 297, 32);
- var devmajor = decodeOct(buf, 329);
- var devminor = decodeOct(buf, 337);
-
- if (buf[345]) name = decodeStr(buf, 345, 155)+'/'+name;
-
- var c = cksum(buf)
-
- //checksum is still initial value if header was null.
- if (c === 8*32) return null;
-
- //valid checksum
- if (c !== decodeOct(buf, 148)) throw new Error('invalid header');
-
- return {
- name: name,
- mode: mode,
- uid: uid,
- gid: gid,
- size: size,
- mtime: new Date(1000 * mtime),
- type: toType(typeflag),
- linkname: linkname,
- uname: uname,
- gname: gname,
- devmajor: devmajor,
- devminor: devminor
- };
-};
-
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/index.js b/builder/node_modules/archiver/node_modules/tar-stream/index.js
deleted file mode 100644
index dbd60edf..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/index.js
+++ /dev/null
@@ -1,2 +0,0 @@
-exports.extract = require('./extract');
-exports.pack = require('./pack');
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/.jshintrc b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/.jshintrc
deleted file mode 100644
index c8ef3ca4..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/.jshintrc
+++ /dev/null
@@ -1,59 +0,0 @@
-{
- "predef": [ ]
- , "bitwise": false
- , "camelcase": false
- , "curly": false
- , "eqeqeq": false
- , "forin": false
- , "immed": false
- , "latedef": false
- , "noarg": true
- , "noempty": true
- , "nonew": true
- , "plusplus": false
- , "quotmark": true
- , "regexp": false
- , "undef": true
- , "unused": true
- , "strict": false
- , "trailing": true
- , "maxlen": 120
- , "asi": true
- , "boss": true
- , "debug": true
- , "eqnull": true
- , "esnext": true
- , "evil": true
- , "expr": true
- , "funcscope": false
- , "globalstrict": false
- , "iterator": false
- , "lastsemic": true
- , "laxbreak": true
- , "laxcomma": true
- , "loopfunc": true
- , "multistr": false
- , "onecase": false
- , "proto": false
- , "regexdash": false
- , "scripturl": true
- , "smarttabs": false
- , "shadow": false
- , "sub": true
- , "supernew": false
- , "validthis": true
- , "browser": true
- , "couch": false
- , "devel": false
- , "dojo": false
- , "mootools": false
- , "node": true
- , "nonstandard": true
- , "prototypejs": false
- , "rhino": false
- , "worker": true
- , "wsh": false
- , "nomen": false
- , "onevar": false
- , "passfail": false
-}
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/.npmignore b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/.npmignore
deleted file mode 100644
index 40b878db..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/.npmignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules/
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/.travis.yml b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/.travis.yml
deleted file mode 100644
index 7ddb9c97..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/.travis.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-language: node_js
-node_js:
- - 0.8
- - "0.10"
-branches:
- only:
- - master
-notifications:
- email:
- - rod@vagg.org
-script: npm test
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/LICENSE b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/LICENSE
deleted file mode 100644
index f6a0029d..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/LICENSE
+++ /dev/null
@@ -1,39 +0,0 @@
-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.
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/README.md b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/README.md
deleted file mode 100644
index 8e77009c..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/README.md
+++ /dev/null
@@ -1,196 +0,0 @@
-# bl *(BufferList)*
-
-[](http://travis-ci.org/rvagg/bl)
-
-**A Node.js Buffer list collector, reader and streamer thingy.**
-
-[](https://nodei.co/npm/bl/)
-[](https://nodei.co/npm/bl/)
-
-**bl** is a storage object for collections of Node Buffers, exposing them with the main Buffer readable API. Also works as a duplex stream so you can collect buffers from a stream that emits them and emit buffers to a stream that consumes them!
-
-The original buffers are kept intact and copies are only done as necessary. Any reads that require the use of a single original buffer will return a slice of that buffer only (which references the same memory as the original buffer). Reads that span buffers perform concatenation as required and return the results transparently.
-
-```js
-const BufferList = require('bl')
-
-var bl = new BufferList()
-bl.append(new Buffer('abcd'))
-bl.append(new Buffer('efg'))
-bl.append('hi') // bl will also accept & convert Strings
-bl.append(new Buffer('j'))
-bl.append(new Buffer([ 0x3, 0x4 ]))
-
-console.log(bl.length) // 12
-
-console.log(bl.slice(0, 10).toString('ascii')) // 'abcdefghij'
-console.log(bl.slice(3, 10).toString('ascii')) // 'defghij'
-console.log(bl.slice(3, 6).toString('ascii')) // 'def'
-console.log(bl.slice(3, 8).toString('ascii')) // 'defgh'
-console.log(bl.slice(5, 10).toString('ascii')) // 'fghij'
-
-// or just use toString!
-console.log(bl.toString()) // 'abcdefghij\u0003\u0004'
-console.log(bl.toString('ascii', 3, 8)) // 'defgh'
-console.log(bl.toString('ascii', 5, 10)) // 'fghij'
-
-// other standard Buffer readables
-console.log(bl.readUInt16BE(10)) // 0x0304
-console.log(bl.readUInt16LE(10)) // 0x0403
-```
-
-Give it a callback in the constructor and use it just like **[concat-stream](https://github.com/maxogden/node-concat-stream)**:
-
-```js
-const bl = require('bl')
- , fs = require('fs')
-
-fs.createReadStream('README.md')
- .pipe(bl(function (err, data) { // note 'new' isn't strictly required
- // `data` is a complete Buffer object containing the full data
- console.log(data.toString())
- }))
-```
-
-Note that when you use the *callback* method like this, the resulting `data` parameter is a concatenation of all `Buffer` objects in the list. If you want to avoid the overhead of this concatenation (in cases of extreme performance consciousness), then avoid the *callback* method and just listen to `'end'` instead, like a standard Stream.
-
-Or to fetch a URL using [hyperquest](https://github.com/substack/hyperquest) (should work with [request](http://github.com/mikeal/request) and even plain Node http too!):
-```js
-const hyperquest = require('hyperquest')
- , bl = require('bl')
- , url = 'https://raw.github.com/rvagg/bl/master/README.md'
-
-hyperquest(url).pipe(bl(function (err, data) {
- console.log(data.toString())
-}))
-```
-
-Or, use it as a readable stream to recompose a list of Buffers to an output source:
-
-```js
-const BufferList = require('bl')
- , fs = require('fs')
-
-var bl = new BufferList()
-bl.append(new Buffer('abcd'))
-bl.append(new Buffer('efg'))
-bl.append(new Buffer('hi'))
-bl.append(new Buffer('j'))
-
-bl.pipe(fs.createWriteStream('gibberish.txt'))
-```
-
-## API
-
- * new BufferList([ callback ])
- * bl.length
- * bl.append(buffer)
- * bl.get(index)
- * bl.slice([ start[, end ] ])
- * bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ])
- * bl.duplicate()
- * bl.consume(bytes)
- * bl.toString([encoding, [ start, [ end ]]])
- * bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8()
- * Streams
-
---------------------------------------------------------
-
-### new BufferList([ callback | buffer | buffer array ])
-The constructor takes an optional callback, if supplied, the callback will be called with an error argument followed by a reference to the **bl** instance, when `bl.end()` is called (i.e. from a piped stream). This is a convenient method of collecting the entire contents of a stream, particularly when the stream is *chunky*, such as a network stream.
-
-Normally, no arguments are required for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` object.
-
-`new` is not strictly required, if you don't instantiate a new object, it will be done automatically for you so you can create a new instance simply with:
-
-```js
-var bl = require('bl')
-var myinstance = bl()
-
-// equivilant to:
-
-var BufferList = require('bl')
-var myinstance = new BufferList()
-```
-
---------------------------------------------------------
-
-### bl.length
-Get the length of the list in bytes. This is the sum of the lengths of all of the buffers contained in the list, minus any initial offset for a semi-consumed buffer at the beginning. Should accurately represent the total number of bytes that can be read from the list.
-
---------------------------------------------------------
-
-### bl.append(buffer)
-`append(buffer)` adds an additional buffer to the internal list.
-
---------------------------------------------------------
-
-### bl.get(index)
-`get()` will return the byte at the specified index.
-
---------------------------------------------------------
-
-### bl.slice([ start, [ end ] ])
-`slice()` returns a new `Buffer` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively.
-
-If the requested range spans a single internal buffer then a slice of that buffer will be returned which shares the original memory range of that Buffer. If the range spans multiple buffers then copy operations will likely occur to give you a uniform Buffer.
-
---------------------------------------------------------
-
-### bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ])
-`copy()` copies the content of the list in the `dest` buffer, starting from `destStart` and containing the bytes within the range specified with `srcStart` to `srcEnd`. `destStart`, `start` and `end` are optional and will default to the beginning of the `dest` buffer, and the beginning and end of the list respectively.
-
---------------------------------------------------------
-
-### bl.duplicate()
-`duplicate()` performs a **shallow-copy** of the list. The internal Buffers remains the same, so if you change the underlying Buffers, the change will be reflected in both the original and the duplicate. This method is needed if you want to call `consume()` or `pipe()` and still keep the original list.Example:
-
-```js
-var bl = new BufferList()
-
-bl.append('hello')
-bl.append(' world')
-bl.append('\n')
-
-bl.duplicate().pipe(process.stdout, { end: false })
-
-console.log(bl.toString())
-```
-
---------------------------------------------------------
-
-### bl.consume(bytes)
-`consume()` will shift bytes *off the start of the list*. The number of bytes consumed don't need to line up with the sizes of the internal Buffers—initial offsets will be calculated accordingly in order to give you a consistent view of the data.
-
---------------------------------------------------------
-
-### bl.toString([encoding, [ start, [ end ]]])
-`toString()` will return a string representation of the buffer. The optional `start` and `end` arguments are passed on to `slice()`, while the `encoding` is passed on to `toString()` of the resulting Buffer. See the [Buffer#toString()](http://nodejs.org/docs/latest/api/buffer.html#buffer_buf_tostring_encoding_start_end) documentation for more information.
-
---------------------------------------------------------
-
-### bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8()
-
-All of the standard byte-reading methods of the `Buffer` interface are implemented and will operate across internal Buffer boundaries transparently.
-
-See the [Buffer](http://nodejs.org/docs/latest/api/buffer.html) documentation for how these work.
-
---------------------------------------------------------
-
-### Streams
-**bl** is a Node **[Duplex Stream](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_duplex)**, so it can be read from and written to like a standard Node stream. You can also `pipe()` to and from a **bl** instance.
-
---------------------------------------------------------
-
-## Contributors
-
-**bl** is brought to you by the following hackers:
-
- * [Rod Vagg](https://github.com/rvagg)
- * [Matteo Collina](https://github.com/mcollina)
-
-=======
-
-## License
-
-**bl** 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.
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/bl.js b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/bl.js
deleted file mode 100644
index 36c98168..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/bl.js
+++ /dev/null
@@ -1,213 +0,0 @@
-var DuplexStream = require('readable-stream').Duplex
- , util = require('util')
-
-function BufferList (callback) {
- if (!(this instanceof BufferList))
- return new BufferList(callback)
-
- this._bufs = []
- this.length = 0
-
- if (typeof callback == 'function') {
- this._callback = callback
-
- var piper = function (err) {
- if (this._callback) {
- this._callback(err)
- this._callback = null
- }
- }.bind(this)
-
- this.on('pipe', function (src) {
- src.on('error', piper)
- })
- this.on('unpipe', function (src) {
- src.removeListener('error', piper)
- })
- }
- else if (Buffer.isBuffer(callback))
- this.append(callback)
- else if (Array.isArray(callback)) {
- callback.forEach(function (b) {
- Buffer.isBuffer(b) && this.append(b)
- }.bind(this))
- }
-
- DuplexStream.call(this)
-}
-
-util.inherits(BufferList, DuplexStream)
-
-BufferList.prototype._offset = function (offset) {
- var tot = 0, i = 0, _t
- for (; i < this._bufs.length; i++) {
- _t = tot + this._bufs[i].length
- if (offset < _t)
- return [ i, offset - tot ]
- tot = _t
- }
-}
-
-BufferList.prototype.append = function (buf) {
- this._bufs.push(Buffer.isBuffer(buf) ? buf : new Buffer(buf))
- this.length += buf.length
- return this
-}
-
-BufferList.prototype._write = function (buf, encoding, callback) {
- this.append(buf)
- if (callback)
- callback()
-}
-
-BufferList.prototype._read = function (size) {
- if (!this.length)
- return this.push(null)
- size = Math.min(size, this.length)
- this.push(this.slice(0, size))
- this.consume(size)
-}
-
-BufferList.prototype.end = function (chunk) {
- DuplexStream.prototype.end.call(this, chunk)
-
- if (this._callback) {
- this._callback(null, this.slice())
- this._callback = null
- }
-}
-
-BufferList.prototype.get = function (index) {
- return this.slice(index, index + 1)[0]
-}
-
-BufferList.prototype.slice = function (start, end) {
- return this.copy(null, 0, start, end)
-}
-
-BufferList.prototype.copy = function (dst, dstStart, srcStart, srcEnd) {
- if (typeof srcStart != 'number' || srcStart < 0)
- srcStart = 0
- if (typeof srcEnd != 'number' || srcEnd > this.length)
- srcEnd = this.length
- if (srcStart >= this.length)
- return dst || new Buffer(0)
- if (srcEnd <= 0)
- return dst || new Buffer(0)
-
- var copy = !!dst
- , off = this._offset(srcStart)
- , len = srcEnd - srcStart
- , bytes = len
- , bufoff = (copy && dstStart) || 0
- , start = off[1]
- , l
- , i
-
- // copy/slice everything
- if (srcStart === 0 && srcEnd == this.length) {
- if (!copy) // slice, just return a full concat
- return Buffer.concat(this._bufs)
-
- // copy, need to copy individual buffers
- for (i = 0; i < this._bufs.length; i++) {
- this._bufs[i].copy(dst, bufoff)
- bufoff += this._bufs[i].length
- }
-
- return dst
- }
-
- // easy, cheap case where it's a subset of one of the buffers
- if (bytes <= this._bufs[off[0]].length - start) {
- return copy
- ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes)
- : this._bufs[off[0]].slice(start, start + bytes)
- }
-
- if (!copy) // a slice, we need something to copy in to
- dst = new Buffer(len)
-
- for (i = off[0]; i < this._bufs.length; i++) {
- l = this._bufs[i].length - start
-
- if (bytes > l) {
- this._bufs[i].copy(dst, bufoff, start)
- } else {
- this._bufs[i].copy(dst, bufoff, start, start + bytes)
- break
- }
-
- bufoff += l
- bytes -= l
-
- if (start)
- start = 0
- }
-
- return dst
-}
-
-BufferList.prototype.toString = function (encoding, start, end) {
- return this.slice(start, end).toString(encoding)
-}
-
-BufferList.prototype.consume = function (bytes) {
- while (this._bufs.length) {
- if (bytes > this._bufs[0].length) {
- bytes -= this._bufs[0].length
- this.length -= this._bufs[0].length
- this._bufs.shift()
- } else {
- this._bufs[0] = this._bufs[0].slice(bytes)
- this.length -= bytes
- break
- }
- }
- return this
-}
-
-BufferList.prototype.duplicate = function () {
- var i = 0
- , copy = new BufferList()
-
- for (; i < this._bufs.length; i++)
- copy.append(this._bufs[i])
-
- return copy
-}
-
-BufferList.prototype.destroy = function () {
- this._bufs.length = 0;
- this.length = 0;
- this.push(null);
-}
-
-;(function () {
- var methods = {
- 'readDoubleBE' : 8
- , 'readDoubleLE' : 8
- , 'readFloatBE' : 4
- , 'readFloatLE' : 4
- , 'readInt32BE' : 4
- , 'readInt32LE' : 4
- , 'readUInt32BE' : 4
- , 'readUInt32LE' : 4
- , 'readInt16BE' : 2
- , 'readInt16LE' : 2
- , 'readUInt16BE' : 2
- , 'readUInt16LE' : 2
- , 'readInt8' : 1
- , 'readUInt8' : 1
- }
-
- for (var m in methods) {
- (function (m) {
- BufferList.prototype[m] = function (offset) {
- return this.slice(offset, offset + methods[m])[m](0)
- }
- }(m))
- }
-}())
-
-module.exports = BufferList
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/package.json b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/package.json
deleted file mode 100644
index cefa3964..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/package.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "name": "bl",
- "version": "0.8.2",
- "description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!",
- "main": "bl.js",
- "scripts": {
- "test": "node test/test.js | faucet",
- "test-local": "brtapsauce-local test/basic-test.js"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/rvagg/bl.git"
- },
- "homepage": "https://github.com/rvagg/bl",
- "authors": [
- "Rod Vagg (https://github.com/rvagg)",
- "Matteo Collina (https://github.com/mcollina)"
- ],
- "keywords": [
- "buffer",
- "buffers",
- "stream",
- "awesomesauce"
- ],
- "license": "MIT",
- "dependencies": {
- "readable-stream": "~1.0.26"
- },
- "devDependencies": {
- "tape": "~2.12.3",
- "hash_file": "~0.1.1",
- "faucet": "~0.0.1",
- "brtapsauce": "~0.3.0"
- },
- "readme": "# bl *(BufferList)*\n\n[](http://travis-ci.org/rvagg/bl)\n\n**A Node.js Buffer list collector, reader and streamer thingy.**\n\n[](https://nodei.co/npm/bl/)\n[](https://nodei.co/npm/bl/)\n\n**bl** is a storage object for collections of Node Buffers, exposing them with the main Buffer readable API. Also works as a duplex stream so you can collect buffers from a stream that emits them and emit buffers to a stream that consumes them!\n\nThe original buffers are kept intact and copies are only done as necessary. Any reads that require the use of a single original buffer will return a slice of that buffer only (which references the same memory as the original buffer). Reads that span buffers perform concatenation as required and return the results transparently.\n\n```js\nconst BufferList = require('bl')\n\nvar bl = new BufferList()\nbl.append(new Buffer('abcd'))\nbl.append(new Buffer('efg'))\nbl.append('hi') // bl will also accept & convert Strings\nbl.append(new Buffer('j'))\nbl.append(new Buffer([ 0x3, 0x4 ]))\n\nconsole.log(bl.length) // 12\n\nconsole.log(bl.slice(0, 10).toString('ascii')) // 'abcdefghij'\nconsole.log(bl.slice(3, 10).toString('ascii')) // 'defghij'\nconsole.log(bl.slice(3, 6).toString('ascii')) // 'def'\nconsole.log(bl.slice(3, 8).toString('ascii')) // 'defgh'\nconsole.log(bl.slice(5, 10).toString('ascii')) // 'fghij'\n\n// or just use toString!\nconsole.log(bl.toString()) // 'abcdefghij\\u0003\\u0004'\nconsole.log(bl.toString('ascii', 3, 8)) // 'defgh'\nconsole.log(bl.toString('ascii', 5, 10)) // 'fghij'\n\n// other standard Buffer readables\nconsole.log(bl.readUInt16BE(10)) // 0x0304\nconsole.log(bl.readUInt16LE(10)) // 0x0403\n```\n\nGive it a callback in the constructor and use it just like **[concat-stream](https://github.com/maxogden/node-concat-stream)**:\n\n```js\nconst bl = require('bl')\n , fs = require('fs')\n\nfs.createReadStream('README.md')\n .pipe(bl(function (err, data) { // note 'new' isn't strictly required\n // `data` is a complete Buffer object containing the full data\n console.log(data.toString())\n }))\n```\n\nNote that when you use the *callback* method like this, the resulting `data` parameter is a concatenation of all `Buffer` objects in the list. If you want to avoid the overhead of this concatenation (in cases of extreme performance consciousness), then avoid the *callback* method and just listen to `'end'` instead, like a standard Stream.\n\nOr to fetch a URL using [hyperquest](https://github.com/substack/hyperquest) (should work with [request](http://github.com/mikeal/request) and even plain Node http too!):\n```js\nconst hyperquest = require('hyperquest')\n , bl = require('bl')\n , url = 'https://raw.github.com/rvagg/bl/master/README.md'\n\nhyperquest(url).pipe(bl(function (err, data) {\n console.log(data.toString())\n}))\n```\n\nOr, use it as a readable stream to recompose a list of Buffers to an output source:\n\n```js\nconst BufferList = require('bl')\n , fs = require('fs')\n\nvar bl = new BufferList()\nbl.append(new Buffer('abcd'))\nbl.append(new Buffer('efg'))\nbl.append(new Buffer('hi'))\nbl.append(new Buffer('j'))\n\nbl.pipe(fs.createWriteStream('gibberish.txt'))\n```\n\n## API\n\n * new BufferList([ callback ])\n * bl.length\n * bl.append(buffer)\n * bl.get(index)\n * bl.slice([ start[, end ] ])\n * bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ])\n * bl.duplicate()\n * bl.consume(bytes)\n * bl.toString([encoding, [ start, [ end ]]])\n * bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8()\n * Streams\n\n--------------------------------------------------------\n\n### new BufferList([ callback | buffer | buffer array ])\nThe constructor takes an optional callback, if supplied, the callback will be called with an error argument followed by a reference to the **bl** instance, when `bl.end()` is called (i.e. from a piped stream). This is a convenient method of collecting the entire contents of a stream, particularly when the stream is *chunky*, such as a network stream.\n\nNormally, no arguments are required for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` object.\n\n`new` is not strictly required, if you don't instantiate a new object, it will be done automatically for you so you can create a new instance simply with:\n\n```js\nvar bl = require('bl')\nvar myinstance = bl()\n\n// equivilant to:\n\nvar BufferList = require('bl')\nvar myinstance = new BufferList()\n```\n\n--------------------------------------------------------\n\n### bl.length\nGet the length of the list in bytes. This is the sum of the lengths of all of the buffers contained in the list, minus any initial offset for a semi-consumed buffer at the beginning. Should accurately represent the total number of bytes that can be read from the list.\n\n--------------------------------------------------------\n\n### bl.append(buffer)\n`append(buffer)` adds an additional buffer to the internal list.\n\n--------------------------------------------------------\n\n### bl.get(index)\n`get()` will return the byte at the specified index.\n\n--------------------------------------------------------\n\n### bl.slice([ start, [ end ] ])\n`slice()` returns a new `Buffer` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively.\n\nIf the requested range spans a single internal buffer then a slice of that buffer will be returned which shares the original memory range of that Buffer. If the range spans multiple buffers then copy operations will likely occur to give you a uniform Buffer.\n\n--------------------------------------------------------\n\n### bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ])\n`copy()` copies the content of the list in the `dest` buffer, starting from `destStart` and containing the bytes within the range specified with `srcStart` to `srcEnd`. `destStart`, `start` and `end` are optional and will default to the beginning of the `dest` buffer, and the beginning and end of the list respectively.\n\n--------------------------------------------------------\n\n### bl.duplicate()\n`duplicate()` performs a **shallow-copy** of the list. The internal Buffers remains the same, so if you change the underlying Buffers, the change will be reflected in both the original and the duplicate. This method is needed if you want to call `consume()` or `pipe()` and still keep the original list.Example:\n\n```js\nvar bl = new BufferList()\n\nbl.append('hello')\nbl.append(' world')\nbl.append('\\n')\n\nbl.duplicate().pipe(process.stdout, { end: false })\n\nconsole.log(bl.toString())\n```\n\n--------------------------------------------------------\n\n### bl.consume(bytes)\n`consume()` will shift bytes *off the start of the list*. The number of bytes consumed don't need to line up with the sizes of the internal Buffers—initial offsets will be calculated accordingly in order to give you a consistent view of the data.\n\n--------------------------------------------------------\n\n### bl.toString([encoding, [ start, [ end ]]])\n`toString()` will return a string representation of the buffer. The optional `start` and `end` arguments are passed on to `slice()`, while the `encoding` is passed on to `toString()` of the resulting Buffer. See the [Buffer#toString()](http://nodejs.org/docs/latest/api/buffer.html#buffer_buf_tostring_encoding_start_end) documentation for more information.\n\n--------------------------------------------------------\n\n### bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8()\n\nAll of the standard byte-reading methods of the `Buffer` interface are implemented and will operate across internal Buffer boundaries transparently.\n\nSee the [Buffer](http://nodejs.org/docs/latest/api/buffer.html) documentation for how these work.\n\n--------------------------------------------------------\n\n### Streams\n**bl** is a Node **[Duplex Stream](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_duplex)**, so it can be read from and written to like a standard Node stream. You can also `pipe()` to and from a **bl** instance.\n\n--------------------------------------------------------\n\n## Contributors\n\n**bl** is brought to you by the following hackers:\n\n * [Rod Vagg](https://github.com/rvagg)\n * [Matteo Collina](https://github.com/mcollina)\n\n=======\n\n## License\n\n**bl** 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.\n",
- "readmeFilename": "README.md",
- "bugs": {
- "url": "https://github.com/rvagg/bl/issues"
- },
- "_id": "bl@0.8.2",
- "dist": {
- "shasum": "c848cb8f5b16841f1e66335a4db63be3140e1df7"
- },
- "_from": "bl@~0.8.1",
- "_resolved": "https://registry.npmjs.org/bl/-/bl-0.8.2.tgz"
-}
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/test/basic-test.js b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/test/basic-test.js
deleted file mode 100644
index 129658a1..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/test/basic-test.js
+++ /dev/null
@@ -1,524 +0,0 @@
-var tape = require('tape')
- , crypto = require('crypto')
- , fs = require('fs')
- , hash = require('hash_file')
- , BufferList = require('../')
-
- , encodings =
- ('hex utf8 utf-8 ascii binary base64'
- + (process.browser ? '' : ' ucs2 ucs-2 utf16le utf-16le')).split(' ')
-
-tape('single bytes from single buffer', function (t) {
- var bl = new BufferList()
- bl.append(new Buffer('abcd'))
-
- t.equal(bl.length, 4)
-
- t.equal(bl.get(0), 97)
- t.equal(bl.get(1), 98)
- t.equal(bl.get(2), 99)
- t.equal(bl.get(3), 100)
-
- t.end()
-})
-
-tape('single bytes from multiple buffers', function (t) {
- var bl = new BufferList()
- bl.append(new Buffer('abcd'))
- bl.append(new Buffer('efg'))
- bl.append(new Buffer('hi'))
- bl.append(new Buffer('j'))
-
- t.equal(bl.length, 10)
-
- t.equal(bl.get(0), 97)
- t.equal(bl.get(1), 98)
- t.equal(bl.get(2), 99)
- t.equal(bl.get(3), 100)
- t.equal(bl.get(4), 101)
- t.equal(bl.get(5), 102)
- t.equal(bl.get(6), 103)
- t.equal(bl.get(7), 104)
- t.equal(bl.get(8), 105)
- t.equal(bl.get(9), 106)
- t.end()
-})
-
-tape('multi bytes from single buffer', function (t) {
- var bl = new BufferList()
- bl.append(new Buffer('abcd'))
-
- t.equal(bl.length, 4)
-
- t.equal(bl.slice(0, 4).toString('ascii'), 'abcd')
- t.equal(bl.slice(0, 3).toString('ascii'), 'abc')
- t.equal(bl.slice(1, 4).toString('ascii'), 'bcd')
-
- t.end()
-})
-
-tape('multiple bytes from multiple buffers', function (t) {
- var bl = new BufferList()
-
- bl.append(new Buffer('abcd'))
- bl.append(new Buffer('efg'))
- bl.append(new Buffer('hi'))
- bl.append(new Buffer('j'))
-
- t.equal(bl.length, 10)
-
- t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
- t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
- t.equal(bl.slice(3, 6).toString('ascii'), 'def')
- t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
- t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
-
- t.end()
-})
-
-tape('consuming from multiple buffers', function (t) {
- var bl = new BufferList()
-
- bl.append(new Buffer('abcd'))
- bl.append(new Buffer('efg'))
- bl.append(new Buffer('hi'))
- bl.append(new Buffer('j'))
-
- t.equal(bl.length, 10)
-
- t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
-
- bl.consume(3)
- t.equal(bl.length, 7)
- t.equal(bl.slice(0, 7).toString('ascii'), 'defghij')
-
- bl.consume(2)
- t.equal(bl.length, 5)
- t.equal(bl.slice(0, 5).toString('ascii'), 'fghij')
-
- bl.consume(1)
- t.equal(bl.length, 4)
- t.equal(bl.slice(0, 4).toString('ascii'), 'ghij')
-
- bl.consume(1)
- t.equal(bl.length, 3)
- t.equal(bl.slice(0, 3).toString('ascii'), 'hij')
-
- bl.consume(2)
- t.equal(bl.length, 1)
- t.equal(bl.slice(0, 1).toString('ascii'), 'j')
-
- t.end()
-})
-
-tape('test readUInt8 / readInt8', function (t) {
- var buf1 = new Buffer(1)
- , buf2 = new Buffer(3)
- , buf3 = new Buffer(3)
- , bl = new BufferList()
-
- buf2[1] = 0x3
- buf2[2] = 0x4
- buf3[0] = 0x23
- buf3[1] = 0x42
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readUInt8(2), 0x3)
- t.equal(bl.readInt8(2), 0x3)
- t.equal(bl.readUInt8(3), 0x4)
- t.equal(bl.readInt8(3), 0x4)
- t.equal(bl.readUInt8(4), 0x23)
- t.equal(bl.readInt8(4), 0x23)
- t.equal(bl.readUInt8(5), 0x42)
- t.equal(bl.readInt8(5), 0x42)
- t.end()
-})
-
-tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t) {
- var buf1 = new Buffer(1)
- , buf2 = new Buffer(3)
- , buf3 = new Buffer(3)
- , bl = new BufferList()
-
- buf2[1] = 0x3
- buf2[2] = 0x4
- buf3[0] = 0x23
- buf3[1] = 0x42
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readUInt16BE(2), 0x0304)
- t.equal(bl.readUInt16LE(2), 0x0403)
- t.equal(bl.readInt16BE(2), 0x0304)
- t.equal(bl.readInt16LE(2), 0x0403)
- t.equal(bl.readUInt16BE(3), 0x0423)
- t.equal(bl.readUInt16LE(3), 0x2304)
- t.equal(bl.readInt16BE(3), 0x0423)
- t.equal(bl.readInt16LE(3), 0x2304)
- t.equal(bl.readUInt16BE(4), 0x2342)
- t.equal(bl.readUInt16LE(4), 0x4223)
- t.equal(bl.readInt16BE(4), 0x2342)
- t.equal(bl.readInt16LE(4), 0x4223)
- t.end()
-})
-
-tape('test readUInt32LE / readUInt32BE / readInt32LE / readInt32BE', function (t) {
- var buf1 = new Buffer(1)
- , buf2 = new Buffer(3)
- , buf3 = new Buffer(3)
- , bl = new BufferList()
-
- buf2[1] = 0x3
- buf2[2] = 0x4
- buf3[0] = 0x23
- buf3[1] = 0x42
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readUInt32BE(2), 0x03042342)
- t.equal(bl.readUInt32LE(2), 0x42230403)
- t.equal(bl.readInt32BE(2), 0x03042342)
- t.equal(bl.readInt32LE(2), 0x42230403)
- t.end()
-})
-
-tape('test readFloatLE / readFloatBE', function (t) {
- var buf1 = new Buffer(1)
- , buf2 = new Buffer(3)
- , buf3 = new Buffer(3)
- , bl = new BufferList()
-
- buf2[1] = 0x00
- buf2[2] = 0x00
- buf3[0] = 0x80
- buf3[1] = 0x3f
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readFloatLE(2), 0x01)
- t.end()
-})
-
-tape('test readDoubleLE / readDoubleBE', function (t) {
- var buf1 = new Buffer(1)
- , buf2 = new Buffer(3)
- , buf3 = new Buffer(10)
- , bl = new BufferList()
-
- buf2[1] = 0x55
- buf2[2] = 0x55
- buf3[0] = 0x55
- buf3[1] = 0x55
- buf3[2] = 0x55
- buf3[3] = 0x55
- buf3[4] = 0xd5
- buf3[5] = 0x3f
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readDoubleLE(2), 0.3333333333333333)
- t.end()
-})
-
-tape('test toString', function (t) {
- var bl = new BufferList()
-
- bl.append(new Buffer('abcd'))
- bl.append(new Buffer('efg'))
- bl.append(new Buffer('hi'))
- bl.append(new Buffer('j'))
-
- t.equal(bl.toString('ascii', 0, 10), 'abcdefghij')
- t.equal(bl.toString('ascii', 3, 10), 'defghij')
- t.equal(bl.toString('ascii', 3, 6), 'def')
- t.equal(bl.toString('ascii', 3, 8), 'defgh')
- t.equal(bl.toString('ascii', 5, 10), 'fghij')
-
- t.end()
-})
-
-tape('test toString encoding', function (t) {
- var bl = new BufferList()
- , b = new Buffer('abcdefghij\xff\x00')
-
- bl.append(new Buffer('abcd'))
- bl.append(new Buffer('efg'))
- bl.append(new Buffer('hi'))
- bl.append(new Buffer('j'))
- bl.append(new Buffer('\xff\x00'))
-
- encodings.forEach(function (enc) {
- t.equal(bl.toString(enc), b.toString(enc), enc)
- })
-
- t.end()
-})
-
-!process.browser && tape('test stream', function (t) {
- var random = crypto.randomBytes(65534)
- , rndhash = hash(random, 'md5')
- , md5sum = crypto.createHash('md5')
- , bl = new BufferList(function (err, buf) {
- t.ok(Buffer.isBuffer(buf))
- t.ok(err === null)
- t.equal(rndhash, hash(bl.slice(), 'md5'))
- t.equal(rndhash, hash(buf, 'md5'))
-
- bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat'))
- .on('close', function () {
- var s = fs.createReadStream('/tmp/bl_test_rnd_out.dat')
- s.on('data', md5sum.update.bind(md5sum))
- s.on('end', function() {
- t.equal(rndhash, md5sum.digest('hex'), 'woohoo! correct hash!')
- t.end()
- })
- })
-
- })
-
- fs.writeFileSync('/tmp/bl_test_rnd.dat', random)
- fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl)
-})
-
-tape('instantiation with Buffer', function (t) {
- var buf = crypto.randomBytes(1024)
- , buf2 = crypto.randomBytes(1024)
- , b = BufferList(buf)
-
- t.equal(buf.toString('hex'), b.slice().toString('hex'), 'same buffer')
- b = BufferList([ buf, buf2 ])
- t.equal(b.slice().toString('hex'), Buffer.concat([ buf, buf2 ]).toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('test String appendage', function (t) {
- var bl = new BufferList()
- , b = new Buffer('abcdefghij\xff\x00')
-
- bl.append('abcd')
- bl.append('efg')
- bl.append('hi')
- bl.append('j')
- bl.append('\xff\x00')
-
- encodings.forEach(function (enc) {
- t.equal(bl.toString(enc), b.toString(enc))
- })
-
- t.end()
-})
-
-tape('write nothing, should get empty buffer', function (t) {
- t.plan(3)
- BufferList(function (err, data) {
- t.notOk(err, 'no error')
- t.ok(Buffer.isBuffer(data), 'got a buffer')
- t.equal(0, data.length, 'got a zero-length buffer')
- t.end()
- }).end()
-})
-
-tape('unicode string', function (t) {
- t.plan(2)
- var inp1 = '\u2600'
- , inp2 = '\u2603'
- , exp = inp1 + ' and ' + inp2
- , bl = BufferList()
- bl.write(inp1)
- bl.write(' and ')
- bl.write(inp2)
- t.equal(exp, bl.toString())
- t.equal(new Buffer(exp).toString('hex'), bl.toString('hex'))
-})
-
-tape('should emit finish', function (t) {
- var source = BufferList()
- , dest = BufferList()
-
- source.write('hello')
- source.pipe(dest)
-
- dest.on('finish', function () {
- t.equal(dest.toString('utf8'), 'hello')
- t.end()
- })
-})
-
-tape('basic copy', function (t) {
- var buf = crypto.randomBytes(1024)
- , buf2 = new Buffer(1024)
- , b = BufferList(buf)
-
- b.copy(buf2)
- t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('copy after many appends', function (t) {
- var buf = crypto.randomBytes(512)
- , buf2 = new Buffer(1024)
- , b = BufferList(buf)
-
- b.append(buf)
- b.copy(buf2)
- t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('copy at a precise position', function (t) {
- var buf = crypto.randomBytes(1004)
- , buf2 = new Buffer(1024)
- , b = BufferList(buf)
-
- b.copy(buf2, 20)
- t.equal(b.slice().toString('hex'), buf2.slice(20).toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('copy starting from a precise location', function (t) {
- var buf = crypto.randomBytes(10)
- , buf2 = new Buffer(5)
- , b = BufferList(buf)
-
- b.copy(buf2, 0, 5)
- t.equal(b.slice(5).toString('hex'), buf2.toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('copy in an interval', function (t) {
- var rnd = crypto.randomBytes(10)
- , b = BufferList(rnd) // put the random bytes there
- , actual = new Buffer(3)
- , expected = new Buffer(3)
-
- rnd.copy(expected, 0, 5, 8)
- b.copy(actual, 0, 5, 8)
-
- t.equal(actual.toString('hex'), expected.toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('copy an interval between two buffers', function (t) {
- var buf = crypto.randomBytes(10)
- , buf2 = new Buffer(10)
- , b = BufferList(buf)
-
- b.append(buf)
- b.copy(buf2, 0, 5, 15)
-
- t.equal(b.slice(5, 15).toString('hex'), buf2.toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('duplicate', function (t) {
- t.plan(2)
-
- var bl = new BufferList('abcdefghij\xff\x00')
- , dup = bl.duplicate()
-
- t.equal(bl.prototype, dup.prototype)
- t.equal(bl.toString('hex'), dup.toString('hex'))
-})
-
-tape('destroy no pipe', function (t) {
- t.plan(2)
-
- var bl = new BufferList('alsdkfja;lsdkfja;lsdk')
- bl.destroy()
-
- t.equal(bl._bufs.length, 0)
- t.equal(bl.length, 0)
-})
-
-!process.browser && tape('destroy with pipe before read end', function (t) {
- t.plan(2)
-
- var bl = new BufferList()
- fs.createReadStream(__dirname + '/sauce.js')
- .pipe(bl)
-
- bl.destroy()
-
- t.equal(bl._bufs.length, 0)
- t.equal(bl.length, 0)
-
-})
-
-!process.browser && tape('destroy with pipe before read end with race', function (t) {
- t.plan(2)
-
- var bl = new BufferList()
- fs.createReadStream(__dirname + '/sauce.js')
- .pipe(bl)
-
- setTimeout(function () {
- bl.destroy()
- setTimeout(function () {
- t.equal(bl._bufs.length, 0)
- t.equal(bl.length, 0)
- }, 500)
- }, 500)
-})
-
-!process.browser && tape('destroy with pipe after read end', function (t) {
- t.plan(2)
-
- var bl = new BufferList()
- fs.createReadStream(__dirname + '/sauce.js')
- .on('end', onEnd)
- .pipe(bl)
-
- function onEnd () {
- bl.destroy()
-
- t.equal(bl._bufs.length, 0)
- t.equal(bl.length, 0)
- }
-})
-
-!process.browser && tape('destroy with pipe while writing to a destination', function (t) {
- t.plan(4)
-
- var bl = new BufferList()
- , ds = new BufferList()
-
- fs.createReadStream(__dirname + '/sauce.js')
- .on('end', onEnd)
- .pipe(bl)
-
- function onEnd () {
- bl.pipe(ds)
-
- setTimeout(function () {
- bl.destroy()
-
- t.equals(bl._bufs.length, 0)
- t.equals(bl.length, 0)
-
- ds.destroy()
-
- t.equals(bl._bufs.length, 0)
- t.equals(bl.length, 0)
-
- }, 100)
- }
-})
-
-!process.browser && tape('handle error', function (t) {
- t.plan(2)
- fs.createReadStream('/does/not/exist').pipe(BufferList(function (err, data) {
- t.ok(err instanceof Error, 'has error')
- t.notOk(data, 'no data')
- }))
-})
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/test/sauce.js b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/test/sauce.js
deleted file mode 100644
index a6d28625..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/test/sauce.js
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env node
-
-const user = process.env.SAUCE_USER
- , key = process.env.SAUCE_KEY
- , path = require('path')
- , brtapsauce = require('brtapsauce')
- , testFile = path.join(__dirname, 'basic-test.js')
-
- , capabilities = [
- { browserName: 'chrome' , platform: 'Windows XP', version: '' }
- , { browserName: 'firefox' , platform: 'Windows 8' , version: '' }
- , { browserName: 'firefox' , platform: 'Windows XP', version: '4' }
- , { browserName: 'internet explorer' , platform: 'Windows 8' , version: '10' }
- , { browserName: 'internet explorer' , platform: 'Windows 7' , version: '9' }
- , { browserName: 'internet explorer' , platform: 'Windows 7' , version: '8' }
- , { browserName: 'internet explorer' , platform: 'Windows XP', version: '7' }
- , { browserName: 'internet explorer' , platform: 'Windows XP', version: '6' }
- , { browserName: 'safari' , platform: 'Windows 7' , version: '5' }
- , { browserName: 'safari' , platform: 'OS X 10.8' , version: '6' }
- , { browserName: 'opera' , platform: 'Windows 7' , version: '' }
- , { browserName: 'opera' , platform: 'Windows 7' , version: '11' }
- , { browserName: 'ipad' , platform: 'OS X 10.8' , version: '6' }
- , { browserName: 'android' , platform: 'Linux' , version: '4.0', 'device-type': 'tablet' }
- ]
-
-if (!user)
- throw new Error('Must set a SAUCE_USER env var')
-if (!key)
- throw new Error('Must set a SAUCE_KEY env var')
-
-brtapsauce({
- name : 'Traversty'
- , user : user
- , key : key
- , brsrc : testFile
- , capabilities : capabilities
- , options : { timeout: 60 * 6 }
-})
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/test/test.js b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/test/test.js
deleted file mode 100644
index aa9b4877..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/bl/test/test.js
+++ /dev/null
@@ -1,9 +0,0 @@
-require('./basic-test')
-
-if (!process.env.SAUCE_KEY || !process.env.SAUCE_USER)
- return console.log('SAUCE_KEY and/or SAUCE_USER not set, not running sauce tests')
-
-if (!/v0\.10/.test(process.version))
- return console.log('Not Node v0.10.x, not running sauce tests')
-
-require('./sauce.js')
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/.npmignore b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/.npmignore
deleted file mode 100644
index 3c3629e6..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/.npmignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/README.md b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/README.md
deleted file mode 100644
index df800c1e..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-# end-of-stream
-
-A node module that calls a callback when a readable/writable/duplex stream has completed or failed.
-
- npm install end-of-stream
-
-## Usage
-
-Simply pass a stream and a callback to the `eos`.
-Both legacy streams and streams2 are supported.
-
-``` js
-var eos = require('end-of-stream');
-
-eos(readableStream, function(err) {
- if (err) return console.log('stream had an error or closed early');
- console.log('stream has ended');
-});
-
-eos(writableStream, function(err) {
- if (err) return console.log('stream had an error or closed early');
- console.log('stream has finished');
-});
-
-eos(duplexStream, function(err) {
- if (err) return console.log('stream had an error or closed early');
- console.log('stream has ended and finished');
-});
-
-eos(duplexStream, {readable:false}, function(err) {
- if (err) return console.log('stream had an error or closed early');
- console.log('stream has ended but might still be writable');
-});
-
-eos(duplexStream, {writable:false}, function(err) {
- if (err) return console.log('stream had an error or closed early');
- console.log('stream has ended but might still be readable');
-});
-
-eos(readableStream, {error:false}, function(err) {
- // do not treat emit('error', err) as a end-of-stream
-});
-```
-
-## License
-
-MIT
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/index.js b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/index.js
deleted file mode 100644
index b9fbec07..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/index.js
+++ /dev/null
@@ -1,61 +0,0 @@
-var once = require('once');
-
-var noop = function() {};
-
-var isRequest = function(stream) {
- return stream.setHeader && typeof stream.abort === 'function';
-};
-
-var eos = function(stream, opts, callback) {
- if (typeof opts === 'function') return eos(stream, null, opts);
- if (!opts) opts = {};
-
- callback = once(callback || noop);
-
- var ws = stream._writableState;
- var rs = stream._readableState;
- var readable = opts.readable || (opts.readable !== false && stream.readable);
- var writable = opts.writable || (opts.writable !== false && stream.writable);
-
- var onlegacyfinish = function() {
- if (!stream.writable) onfinish();
- };
-
- var onfinish = function() {
- writable = false;
- if (!readable) callback();
- };
-
- var onend = function() {
- readable = false;
- if (!writable) callback();
- };
-
- var onclose = function() {
- if (readable && !(rs && rs.ended)) return callback(new Error('premature close'));
- if (writable && !(ws && ws.ended)) return callback(new Error('premature close'));
- };
-
- var onrequest = function() {
- stream.req.on('finish', onfinish);
- };
-
- if (isRequest(stream)) {
- stream.on('complete', onfinish);
- stream.on('abort', onclose);
- if (stream.req) onrequest();
- else stream.on('request', onrequest);
- } else if (writable && !ws) { // legacy streams
- stream.on('end', onlegacyfinish);
- stream.on('close', onlegacyfinish);
- }
-
- stream.on('end', onend);
- stream.on('finish', onfinish);
- if (opts.error !== false) stream.on('error', callback);
- stream.on('close', onclose);
-
- return stream;
-};
-
-module.exports = eos;
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/node_modules/once/LICENSE b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/node_modules/once/LICENSE
deleted file mode 100644
index 0c44ae71..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/node_modules/once/LICENSE
+++ /dev/null
@@ -1,27 +0,0 @@
-Copyright (c) Isaac Z. Schlueter ("Author")
-All rights reserved.
-
-The BSD License
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
-BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/node_modules/once/README.md b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/node_modules/once/README.md
deleted file mode 100644
index a2981ea0..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/node_modules/once/README.md
+++ /dev/null
@@ -1,51 +0,0 @@
-# once
-
-Only call a function once.
-
-## usage
-
-```javascript
-var once = require('once')
-
-function load (file, cb) {
- cb = once(cb)
- loader.load('file')
- loader.once('load', cb)
- loader.once('error', cb)
-}
-```
-
-Or add to the Function.prototype in a responsible way:
-
-```javascript
-// only has to be done once
-require('once').proto()
-
-function load (file, cb) {
- cb = cb.once()
- loader.load('file')
- loader.once('load', cb)
- loader.once('error', cb)
-}
-```
-
-Ironically, the prototype feature makes this module twice as
-complicated as necessary.
-
-To check whether you function has been called, use `fn.called`. Once the
-function is called for the first time the return value of the original
-function is saved in `fn.value` and subsequent calls will continue to
-return this value.
-
-```javascript
-var once = require('once')
-
-function load (cb) {
- cb = once(cb)
- var stream = createStream()
- stream.once('data', cb)
- stream.once('end', function () {
- if (!cb.called) cb(new Error('not found'))
- })
-}
-```
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/node_modules/once/once.js b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/node_modules/once/once.js
deleted file mode 100644
index 0770a73c..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/node_modules/once/once.js
+++ /dev/null
@@ -1,20 +0,0 @@
-module.exports = once
-
-once.proto = once(function () {
- Object.defineProperty(Function.prototype, 'once', {
- value: function () {
- return once(this)
- },
- configurable: true
- })
-})
-
-function once (fn) {
- var f = function () {
- if (f.called) return f.value
- f.called = true
- return f.value = fn.apply(this, arguments)
- }
- f.called = false
- return f
-}
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/node_modules/once/package.json b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/node_modules/once/package.json
deleted file mode 100644
index ddb0d32f..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/node_modules/once/package.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "name": "once",
- "version": "1.3.0",
- "description": "Run a function exactly one time",
- "main": "once.js",
- "directories": {
- "test": "test"
- },
- "dependencies": {},
- "devDependencies": {
- "tap": "~0.3.0"
- },
- "scripts": {
- "test": "tap test/*.js"
- },
- "repository": {
- "type": "git",
- "url": "git://github.com/isaacs/once"
- },
- "keywords": [
- "once",
- "function",
- "one",
- "single"
- ],
- "author": {
- "name": "Isaac Z. Schlueter",
- "email": "i@izs.me",
- "url": "http://blog.izs.me/"
- },
- "license": "BSD",
- "readme": "# once\n\nOnly call a function once.\n\n## usage\n\n```javascript\nvar once = require('once')\n\nfunction load (file, cb) {\n cb = once(cb)\n loader.load('file')\n loader.once('load', cb)\n loader.once('error', cb)\n}\n```\n\nOr add to the Function.prototype in a responsible way:\n\n```javascript\n// only has to be done once\nrequire('once').proto()\n\nfunction load (file, cb) {\n cb = cb.once()\n loader.load('file')\n loader.once('load', cb)\n loader.once('error', cb)\n}\n```\n\nIronically, the prototype feature makes this module twice as\ncomplicated as necessary.\n\nTo check whether you function has been called, use `fn.called`. Once the\nfunction is called for the first time the return value of the original\nfunction is saved in `fn.value` and subsequent calls will continue to\nreturn this value.\n\n```javascript\nvar once = require('once')\n\nfunction load (cb) {\n cb = once(cb)\n var stream = createStream()\n stream.once('data', cb)\n stream.once('end', function () {\n if (!cb.called) cb(new Error('not found'))\n })\n}\n```\n",
- "readmeFilename": "README.md",
- "bugs": {
- "url": "https://github.com/isaacs/once/issues"
- },
- "homepage": "https://github.com/isaacs/once",
- "_id": "once@1.3.0",
- "_from": "once@~1.3.0"
-}
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/node_modules/once/test/once.js b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/node_modules/once/test/once.js
deleted file mode 100644
index a77951f1..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/node_modules/once/test/once.js
+++ /dev/null
@@ -1,20 +0,0 @@
-var test = require('tap').test
-var once = require('../once.js')
-
-test('once', function (t) {
- var f = 0
- var foo = once(function (g) {
- t.equal(f, 0)
- f ++
- return f + g + this
- })
- t.notOk(foo.called)
- for (var i = 0; i < 1E3; i++) {
- t.same(f, i === 0 ? 0 : 1)
- var g = foo.call(1, 1)
- t.ok(foo.called)
- t.same(g, 3)
- t.same(f, 1)
- }
- t.end()
-})
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/package.json b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/package.json
deleted file mode 100644
index b617f75b..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/package.json
+++ /dev/null
@@ -1,42 +0,0 @@
-{
- "name": "end-of-stream",
- "version": "0.1.5",
- "description": "Call a callback when a readable/writable/duplex stream has completed or failed.",
- "repository": {
- "type": "git",
- "url": "git://github.com/mafintosh/end-of-stream.git"
- },
- "dependencies": {
- "once": "~1.3.0"
- },
- "scripts": {
- "test": "node test.js"
- },
- "keywords": [
- "stream",
- "streams",
- "callback",
- "finish",
- "close",
- "end",
- "wait"
- ],
- "bugs": {
- "url": "https://github.com/mafintosh/end-of-stream/issues"
- },
- "homepage": "https://github.com/mafintosh/end-of-stream",
- "main": "index.js",
- "author": {
- "name": "Mathias Buus",
- "email": "mathiasbuus@gmail.com"
- },
- "license": "MIT",
- "readme": "# end-of-stream\n\nA node module that calls a callback when a readable/writable/duplex stream has completed or failed.\n\n\tnpm install end-of-stream\n\n## Usage\n\nSimply pass a stream and a callback to the `eos`.\nBoth legacy streams and streams2 are supported.\n\n``` js\nvar eos = require('end-of-stream');\n\neos(readableStream, function(err) {\n\tif (err) return console.log('stream had an error or closed early');\n\tconsole.log('stream has ended');\n});\n\neos(writableStream, function(err) {\n\tif (err) return console.log('stream had an error or closed early');\n\tconsole.log('stream has finished');\n});\n\neos(duplexStream, function(err) {\n\tif (err) return console.log('stream had an error or closed early');\n\tconsole.log('stream has ended and finished');\n});\n\neos(duplexStream, {readable:false}, function(err) {\n\tif (err) return console.log('stream had an error or closed early');\n\tconsole.log('stream has ended but might still be writable');\n});\n\neos(duplexStream, {writable:false}, function(err) {\n\tif (err) return console.log('stream had an error or closed early');\n\tconsole.log('stream has ended but might still be readable');\n});\n\neos(readableStream, {error:false}, function(err) {\n\t// do not treat emit('error', err) as a end-of-stream\n});\n```\n\n## License\n\nMIT",
- "readmeFilename": "README.md",
- "_id": "end-of-stream@0.1.5",
- "dist": {
- "shasum": "ef871db3304aa22e4d83045fc98f6b0a795305c1"
- },
- "_from": "end-of-stream@~0.1.3",
- "_resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-0.1.5.tgz"
-}
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/test.js b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/test.js
deleted file mode 100644
index 277f1ce6..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/end-of-stream/test.js
+++ /dev/null
@@ -1,59 +0,0 @@
-var assert = require('assert');
-var eos = require('./index');
-
-var expected = 6;
-var fs = require('fs');
-var net = require('net');
-
-var ws = fs.createWriteStream('/dev/null');
-eos(ws, function(err) {
- expected--;
- assert(!!err);
- if (!expected) process.exit(0);
-});
-ws.close();
-
-var rs = fs.createReadStream('/dev/random');
-eos(rs, function(err) {
- expected--;
- assert(!!err);
- if (!expected) process.exit(0);
-});
-rs.close();
-
-var rs = fs.createReadStream(__filename);
-eos(rs, function(err) {
- expected--;
- assert(!err);
- if (!expected) process.exit(0);
-});
-rs.pipe(fs.createWriteStream('/dev/null'));
-
-var socket = net.connect(50000);
-eos(socket, function(err) {
- expected--;
- assert(!!err);
- if (!expected) process.exit(0);
-});
-
-
-var server = net.createServer(function(socket) {
- eos(socket, function() {
- expected--;
- if (!expected) process.exit(0);
- });
- socket.destroy();
-}).listen(30000, function() {
- var socket = net.connect(30000);
- eos(socket, function() {
- expected--;
- if (!expected) process.exit(0);
- });
-});
-
-
-
-setTimeout(function() {
- assert(expected === 0);
- process.exit(0);
-}, 1000);
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/.jshintrc b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/.jshintrc
deleted file mode 100644
index 77887b5f..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/.jshintrc
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "maxdepth": 4,
- "maxstatements": 200,
- "maxcomplexity": 12,
- "maxlen": 80,
- "maxparams": 5,
-
- "curly": true,
- "eqeqeq": true,
- "immed": true,
- "latedef": false,
- "noarg": true,
- "noempty": true,
- "nonew": true,
- "undef": true,
- "unused": "vars",
- "trailing": true,
-
- "quotmark": true,
- "expr": true,
- "asi": true,
-
- "browser": false,
- "esnext": true,
- "devel": false,
- "node": false,
- "nonstandard": false,
-
- "predef": ["require", "module", "__dirname", "__filename"]
-}
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/.npmignore b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/.npmignore
deleted file mode 100644
index 3c3629e6..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/.npmignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/LICENCE b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/LICENCE
deleted file mode 100644
index 1a14b437..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/LICENCE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2012-2014 Raynos.
-
-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.
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/Makefile b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/Makefile
deleted file mode 100644
index d583fcf4..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-browser:
- node ./support/compile
-
-.PHONY: browser
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/README.md b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/README.md
deleted file mode 100644
index e7548318..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/README.md
+++ /dev/null
@@ -1,28 +0,0 @@
-# xtend
-
-[![browser support][3]][4]
-
-Extend like a boss
-
-xtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes presedence.
-
-## Examples
-
-```js
-var extend = require("xtend")
-
-// extend returns a new object. Does not mutate arguments
-var combination = extend({
- a: "a"
-}, {
- b: "b"
-})
-// { a: "a", b: "b" }
-```
-
-
-## MIT Licenced
-
-
- [3]: http://ci.testling.com/Raynos/xtend.png
- [4]: http://ci.testling.com/Raynos/xtend
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/index.js b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/index.js
deleted file mode 100644
index 5b760152..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-module.exports = extend
-
-function extend() {
- var target = {}
-
- for (var i = 0; i < arguments.length; i++) {
- var source = arguments[i]
-
- for (var key in source) {
- if (source.hasOwnProperty(key)) {
- target[key] = source[key]
- }
- }
- }
-
- return target
-}
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/mutable.js b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/mutable.js
deleted file mode 100644
index a34475eb..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/mutable.js
+++ /dev/null
@@ -1,15 +0,0 @@
-module.exports = extend
-
-function extend(target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i]
-
- for (var key in source) {
- if (source.hasOwnProperty(key)) {
- target[key] = source[key]
- }
- }
- }
-
- return target
-}
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/package.json b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/package.json
deleted file mode 100644
index c1209079..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/package.json
+++ /dev/null
@@ -1,74 +0,0 @@
-{
- "name": "xtend",
- "version": "3.0.0",
- "description": "extend like a boss",
- "keywords": [
- "extend",
- "merge",
- "options",
- "opts",
- "object",
- "array"
- ],
- "author": {
- "name": "Raynos",
- "email": "raynos2@gmail.com"
- },
- "repository": {
- "type": "git",
- "url": "git://github.com/Raynos/xtend.git"
- },
- "main": "index",
- "scripts": {
- "test": "node test"
- },
- "dependencies": {},
- "devDependencies": {
- "tape": "~1.1.0"
- },
- "homepage": "https://github.com/Raynos/xtend",
- "contributors": [
- {
- "name": "Jake Verbaten"
- },
- {
- "name": "Matt Esch"
- }
- ],
- "bugs": {
- "url": "https://github.com/Raynos/xtend/issues",
- "email": "raynos2@gmail.com"
- },
- "licenses": [
- {
- "type": "MIT",
- "url": "http://github.com/raynos/xtend/raw/master/LICENSE"
- }
- ],
- "testling": {
- "files": "test.js",
- "browsers": [
- "ie/7..latest",
- "firefox/16..latest",
- "firefox/nightly",
- "chrome/22..latest",
- "chrome/canary",
- "opera/12..latest",
- "opera/next",
- "safari/5.1..latest",
- "ipad/6.0..latest",
- "iphone/6.0..latest"
- ]
- },
- "engines": {
- "node": ">=0.4"
- },
- "readme": "# xtend\n\n[![browser support][3]][4]\n\nExtend like a boss\n\nxtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes presedence.\n\n## Examples\n\n```js\nvar extend = require(\"xtend\")\n\n// extend returns a new object. Does not mutate arguments\nvar combination = extend({\n a: \"a\"\n}, {\n b: \"b\"\n})\n// { a: \"a\", b: \"b\" }\n```\n\n\n## MIT Licenced\n\n\n [3]: http://ci.testling.com/Raynos/xtend.png\n [4]: http://ci.testling.com/Raynos/xtend\n",
- "readmeFilename": "README.md",
- "_id": "xtend@3.0.0",
- "dist": {
- "shasum": "b8a1e4cf3d9d49b67a26265d50185d319d89ef8c"
- },
- "_from": "xtend@~3.0.0",
- "_resolved": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz"
-}
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/test.js b/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/test.js
deleted file mode 100644
index 3369d796..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/node_modules/xtend/test.js
+++ /dev/null
@@ -1,63 +0,0 @@
-var test = require("tape")
-var extend = require("./")
-var mutableExtend = require("./mutable")
-
-test("merge", function(assert) {
- var a = { a: "foo" }
- var b = { b: "bar" }
-
- assert.deepEqual(extend(a, b), { a: "foo", b: "bar" })
- assert.end()
-})
-
-test("replace", function(assert) {
- var a = { a: "foo" }
- var b = { a: "bar" }
-
- assert.deepEqual(extend(a, b), { a: "bar" })
- assert.end()
-})
-
-test("undefined", function(assert) {
- var a = { a: undefined }
- var b = { b: "foo" }
-
- assert.deepEqual(extend(a, b), { a: undefined, b: "foo" })
- assert.deepEqual(extend(b, a), { a: undefined, b: "foo" })
- assert.end()
-})
-
-test("handle 0", function(assert) {
- var a = { a: "default" }
- var b = { a: 0 }
-
- assert.deepEqual(extend(a, b), { a: 0 })
- assert.deepEqual(extend(b, a), { a: "default" })
- assert.end()
-})
-
-test("is immutable", function (assert) {
- var record = {}
-
- extend(record, { foo: "bar" })
- assert.equal(record.foo, undefined)
- assert.end()
-})
-
-test("null as argument", function (assert) {
- var a = { foo: "bar" }
- var b = null
- var c = void 0
-
- assert.deepEqual(extend(b, a, c), { foo: "bar" })
- assert.end()
-})
-
-test("mutable", function (assert) {
- var a = { foo: "bar" }
-
- mutableExtend(a, { bar: "baz" })
-
- assert.equal(a.bar, "baz")
- assert.end()
-})
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/pack.js b/builder/node_modules/archiver/node_modules/tar-stream/pack.js
deleted file mode 100644
index df5f4071..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/pack.js
+++ /dev/null
@@ -1,194 +0,0 @@
-var util = require('util');
-var eos = require('end-of-stream');
-var headers = require('./headers');
-
-var Readable = require('readable-stream').Readable;
-var Writable = require('readable-stream').Writable;
-var PassThrough = require('readable-stream').PassThrough;
-
-var END_OF_TAR = new Buffer(1024);
-END_OF_TAR.fill(0);
-
-var noop = function() {};
-
-var overflow = function(self, size) {
- size &= 511;
- if (size) self.push(END_OF_TAR.slice(0, 512 - size));
-};
-
-var Sink = function(to) {
- Writable.call(this);
- this.written = 0;
- this._to = to;
- this._destroyed = false;
-};
-
-util.inherits(Sink, Writable);
-
-Sink.prototype._write = function(data, enc, cb) {
- this.written += data.length;
- if (this._to.push(data)) return cb();
- this._to._drain = cb;
-};
-
-Sink.prototype.destroy = function() {
- if (this._destroyed) return;
- this._destroyed = true;
- this.emit('close');
-};
-
-var Void = function() {
- Writable.call(this)
- this._destroyed = false;
-};
-
-util.inherits(Void, Writable);
-
-Void.prototype._write = function(data, enc, cb) {
- cb(new Error('No body allowed for this entry'))
-};
-
-Void.prototype.destroy = function() {
- if (this._destroyed) return;
- this._destroyed = true;
- this.emit('close')
-}
-
-var Pack = function(opts) {
- if (!(this instanceof Pack)) return new Pack(opts);
- Readable.call(this, opts);
-
- this._drain = noop;
- this._finalized = false;
- this._finalizing = false;
- this._destroyed = false;
- this._stream = null;
-};
-
-util.inherits(Pack, Readable);
-
-Pack.prototype.entry = function(header, buffer, callback) {
- if (this._stream) throw new Error('already piping an entry');
- if (this._finalized || this._destroyed) return;
-
- if (typeof buffer === 'function') {
- callback = buffer;
- buffer = null;
- }
-
- if (!callback) callback = noop;
-
- var self = this;
-
- if (!header.size) header.size = 0;
- if (!header.type) header.type = 'file';
- if (!header.mode) header.mode = header.type === 'directory' ? 0755 : 0644;
- if (!header.uid) header.uid = 0;
- if (!header.gid) header.gid = 0;
- if (!header.mtime) header.mtime = new Date();
-
- if (typeof buffer === 'string') buffer = new Buffer(buffer);
- if (Buffer.isBuffer(buffer)) {
- header.size = buffer.length;
- this._encode(header);
- this.push(buffer);
- overflow(self, header.size);
- process.nextTick(callback);
- return new Void();
- }
- if (header.type !== 'file' && header.type !== 'contigious-file') {
- this._encode(header);
- process.nextTick(callback);
- return new Void();
- }
-
- var sink = new Sink(this);
-
- this._encode(header);
- this._stream = sink;
-
- eos(sink, function(err) {
- self._stream = null;
-
- if (err) { // stream was closed
- self.destroy();
- return callback(err);
- }
-
- if (sink.written !== header.size) { // corrupting tar
- self.destroy();
- return callback(new Error('size mismatch'));
- }
-
- overflow(self, header.size);
- if (self._finalizing) self.finalize();
- callback();
- });
-
- return sink;
-};
-
-Pack.prototype.finalize = function() {
- if (this._stream) {
- this._finalizing = true;
- return;
- }
-
- if (this._finalized) return;
- this._finalized = true;
- this.push(END_OF_TAR);
- this.push(null);
-};
-
-Pack.prototype.destroy = function(err) {
- if (this._destroyed) return;
- this._destroyed = true;
-
- if (err) this.emit('error', err);
- this.emit('close');
- if (this._stream && this._stream.destroy) this._stream.destroy();
-};
-
-Pack.prototype._encode = function(header) {
- var buf = headers.encode(header);
- if (buf) this.push(buf);
- else this._encodePax(header);
-};
-
-Pack.prototype._encodePax = function(header) {
- var paxHeader = headers.encodePax({
- name: header.name,
- linkname: header.linkname
- });
-
- var newHeader = {
- name: 'PaxHeader',
- mode: header.mode,
- uid: header.uid,
- gid: header.gid,
- size: paxHeader.length,
- mtime: header.mtime,
- type: 'pax-header',
- linkname: header.linkname && 'PaxHeader',
- uname: header.uname,
- gname: header.gname,
- devmajor: header.devmajor,
- devminor: header.devminor
- };
-
- this.push(headers.encode(newHeader));
- this.push(paxHeader);
- overflow(this, paxHeader.length);
-
- newHeader.size = header.size;
- newHeader.type = header.type;
- this.push(headers.encode(newHeader));
-};
-
-Pack.prototype._read = function(n) {
- var drain = this._drain;
- this._drain = noop;
- drain();
-};
-
-module.exports = Pack;
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/package.json b/builder/node_modules/archiver/node_modules/tar-stream/package.json
deleted file mode 100644
index bf71b566..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/package.json
+++ /dev/null
@@ -1,62 +0,0 @@
-{
- "name": "tar-stream",
- "version": "0.4.4",
- "description": "tar-stream is a streaming tar parser and generator and nothing else. It is streams2 and operates purely using streams which means you can easily extract/parse tarballs without ever hitting the file system.",
- "repository": {
- "type": "git",
- "url": "git://github.com:mafintosh/tar-stream.git"
- },
- "author": {
- "name": "Mathias Buus",
- "email": "mathiasbuus@gmail.com"
- },
- "engines": {
- "node": ">= 0.8.0"
- },
- "dependencies": {
- "bl": "~0.8.1",
- "end-of-stream": "~0.1.3",
- "readable-stream": "~1.0.26-4",
- "xtend": "~3.0.0"
- },
- "devDependencies": {
- "tap": "~0.4.6",
- "concat-stream": "~1.2.1"
- },
- "scripts": {
- "test": "tap test/*.js"
- },
- "keywords": [
- "tar",
- "tarball",
- "parse",
- "parser",
- "generate",
- "generator",
- "stream",
- "stream2",
- "streams",
- "streams2",
- "streaming",
- "pack",
- "extract",
- "modify"
- ],
- "bugs": {
- "url": "https://github.com/mafintosh/tar-stream/issues"
- },
- "homepage": "https://github.com/mafintosh/tar-stream",
- "main": "index.js",
- "directories": {
- "test": "test"
- },
- "license": "MIT",
- "readme": "# tar-stream\n\ntar-stream is a streaming tar parser and generator and nothing else. It is streams2 and operates purely using streams which means you can easily extract/parse tarballs without ever hitting the file system.\n\n\tnpm install tar-stream\n\n[](http://travis-ci.org/mafintosh/tar-stream)\n\n# Usage\n\ntar-stream exposes two streams, [pack](https://github.com/mafintosh/tar-stream#packing) which creates tarballs and [extract](https://github.com/mafintosh/tar-stream#extracting) which extracts tarballs. To [modify an existing tarball](https://github.com/mafintosh/tar-stream#modifying-existing-tarballs) use both.\n\n## Packing\n\nTo create a pack stream use `tar.pack()` and call `pack.entry(header, [callback])` to add tar entries.\n\n``` js\nvar tar = require('tar-stream');\nvar pack = tar.pack(); // p is a streams2 stream\n\n// add a file called my-test.txt with the content \"Hello World!\"\npack.entry({ name: 'my-test.txt' }, 'Hello World!');\n\n// add a file called my-stream-test.txt from a stream\nvar entry = pack.entry({ name: 'my-stream-test.txt' }, function(err) {\n\t// the stream was added\n\t// no more entries\n\tpack.finalize();\n});\nmyStream.pipe(entry);\n\n// pipe the pack stream somewhere\npack.pipe(process.stdout);\n```\n\n## Extracting\n\nTo extract a stream use `tar.extract()` and listen for `extract.on('entry', header, stream, callback)`\n\n``` js\nvar extract = tar.extract();\n\nextract.on('entry', function(header, stream, callback) {\n\t// header is the tar header\n\t// stream is the content body (might be an empty stream)\n\t// call next when you are done with this entry\n\n\tstream.resume(); // just auto drain the stream\n\tstream.on('end', function() {\n\t\tcallback(); // ready for next entry\n\t});\n});\n\nextract.on('finish', function() {\n\t// all entries read\n});\n\npack.pipe(extract);\n```\n\n## Headers\n\nThe header object using in `entry` should contain the following properties.\nMost of these values can be found by stating a file.\n\n``` js\n{\n\tname: 'path/to/this/entry.txt',\n\tsize: 1314, // entry size. defaults to 0\n\tmode: 0644, // entry mode. defaults to to 0755 for dirs and 0644 otherwise\n\tmtime: new Date(), // last modified date for entry. defaults to now.\n\ttype: 'file', // type of entry. defaults to file. can be:\n\t // file | link | symlink | directory | block-device\n\t // character-device | fifo | contigious-file\n\tlinkname: 'path', // linked file name\n\tuid: 0, // uid of entry owner. defaults to 0\n\tgid: 0, // gid of entry owner. defaults to 0\n\tuname: 'maf', // uname of entry owner. defaults to null\n\tgname: 'staff', // gname of entry owner. defaults to null\n\tdevmajor: 0, // device major version. defaults to 0\n\tdevminor: 0 // device minor version. defaults to 0\n}\n```\n\n## Modifying existing tarballs\n\nUsing tar-stream it is easy to rewrite paths / change modes etc in an existing tarball.\n\n``` js\nvar extract = tar.extract();\nvar pack = tar.pack();\nvar path = require('path');\n\nextract.on('entry', function(header, stream, callback) {\n\t// let's prefix all names with 'tmp'\n\theader.name = path.join('tmp', header.name);\n\t// write the new entry to the pack stream\n\tstream.pipe(pack.entry(header, callback));\n});\n\nextract.on('finish', function() {\n\t// all entries done - lets finalize it\n\tpack.finalize();\n});\n\n// pipe the old tarball to the extractor\noldTarball.pipe(extract);\n\n// pipe the new tarball the another stream\npack.pipe(newTarball);\n```\n\n## Performance\n\n[See tar-fs for a performance comparison with node-tar](https://github.com/mafintosh/tar-fs/blob/master/README.md#performance)\n\n# License\n\nMIT\n",
- "readmeFilename": "README.md",
- "_id": "tar-stream@0.4.4",
- "dist": {
- "shasum": "7fb95adb65b968277b41dd6da1b6d536a56cd76f"
- },
- "_from": "tar-stream@~0.4.0",
- "_resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-0.4.4.tgz"
-}
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/test/extract.js b/builder/node_modules/archiver/node_modules/tar-stream/test/extract.js
deleted file mode 100644
index c1e4fd3a..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/test/extract.js
+++ /dev/null
@@ -1,420 +0,0 @@
-var test = require('tap').test;
-var tar = require('../index');
-var fixtures = require('./fixtures');
-var concat = require('concat-stream');
-var fs = require('fs');
-
-var clamp = function(index, len, defaultValue) {
- if (typeof index !== 'number') return defaultValue;
- index = ~~index; // Coerce to integer.
- if (index >= len) return len;
- if (index >= 0) return index;
- index += len;
- if (index >= 0) return index;
- return 0;
-};
-
-test('one-file', function(t) {
- t.plan(3);
-
- var extract = tar.extract();
- var noEntries = false;
-
- extract.on('entry', function(header, stream, callback) {
- t.deepEqual(header, {
- name: 'test.txt',
- mode: 0644,
- uid: 501,
- gid: 20,
- size: 12,
- mtime: new Date(1387580181000),
- type: 'file',
- linkname: null,
- uname: 'maf',
- gname: 'staff',
- devmajor: 0,
- devminor: 0
- });
-
- stream.pipe(concat(function(data) {
- noEntries = true;
- t.same(data.toString(), 'hello world\n');
- callback();
- }));
- });
-
- extract.on('finish', function() {
- t.ok(noEntries);
- });
-
- extract.end(fs.readFileSync(fixtures.ONE_FILE_TAR));
-});
-
-test('chunked-one-file', function(t) {
- t.plan(3);
-
- var extract = tar.extract();
- var noEntries = false;
-
- extract.on('entry', function(header, stream, callback) {
- t.deepEqual(header, {
- name: 'test.txt',
- mode: 0644,
- uid: 501,
- gid: 20,
- size: 12,
- mtime: new Date(1387580181000),
- type: 'file',
- linkname: null,
- uname: 'maf',
- gname: 'staff',
- devmajor: 0,
- devminor: 0
- });
-
- stream.pipe(concat(function(data) {
- noEntries = true;
- t.same(data.toString(), 'hello world\n');
- callback();
- }));
- });
-
- extract.on('finish', function() {
- t.ok(noEntries);
- });
-
- var b = fs.readFileSync(fixtures.ONE_FILE_TAR);
-
- for (var i = 0; i < b.length; i += 321) {
- extract.write(b.slice(i, clamp(i+321, b.length, b.length)));
- }
- extract.end();
-});
-
-
-test('multi-file', function(t) {
- t.plan(5);
-
- var extract = tar.extract();
- var noEntries = false;
-
- var onfile1 = function(header, stream, callback) {
- t.deepEqual(header, {
- name: 'file-1.txt',
- mode: 0644,
- uid: 501,
- gid: 20,
- size: 12,
- mtime: new Date(1387580181000),
- type: 'file',
- linkname: null,
- uname: 'maf',
- gname: 'staff',
- devmajor: 0,
- devminor: 0
- });
-
- extract.on('entry', onfile2);
- stream.pipe(concat(function(data) {
- t.same(data.toString(), 'i am file-1\n');
- callback();
- }));
- };
-
- var onfile2 = function(header, stream, callback) {
- t.deepEqual(header, {
- name: 'file-2.txt',
- mode: 0644,
- uid: 501,
- gid: 20,
- size: 12,
- mtime: new Date(1387580181000),
- type: 'file',
- linkname: null,
- uname: 'maf',
- gname: 'staff',
- devmajor: 0,
- devminor: 0
- });
-
- stream.pipe(concat(function(data) {
- noEntries = true;
- t.same(data.toString(), 'i am file-2\n');
- callback();
- }));
- };
-
- extract.once('entry', onfile1);
-
- extract.on('finish', function() {
- t.ok(noEntries);
- });
-
- extract.end(fs.readFileSync(fixtures.MULTI_FILE_TAR));
-});
-
-test('chunked-multi-file', function(t) {
- t.plan(5);
-
- var extract = tar.extract();
- var noEntries = false;
-
- var onfile1 = function(header, stream, callback) {
- t.deepEqual(header, {
- name: 'file-1.txt',
- mode: 0644,
- uid: 501,
- gid: 20,
- size: 12,
- mtime: new Date(1387580181000),
- type: 'file',
- linkname: null,
- uname: 'maf',
- gname: 'staff',
- devmajor: 0,
- devminor: 0
- });
-
- extract.on('entry', onfile2);
- stream.pipe(concat(function(data) {
- t.same(data.toString(), 'i am file-1\n');
- callback();
- }));
- };
-
- var onfile2 = function(header, stream, callback) {
- t.deepEqual(header, {
- name: 'file-2.txt',
- mode: 0644,
- uid: 501,
- gid: 20,
- size: 12,
- mtime: new Date(1387580181000),
- type: 'file',
- linkname: null,
- uname: 'maf',
- gname: 'staff',
- devmajor: 0,
- devminor: 0
- });
-
- stream.pipe(concat(function(data) {
- noEntries = true;
- t.same(data.toString(), 'i am file-2\n');
- callback();
- }));
- };
-
- extract.once('entry', onfile1);
-
- extract.on('finish', function() {
- t.ok(noEntries);
- });
-
- var b = fs.readFileSync(fixtures.MULTI_FILE_TAR);
- for (var i = 0; i < b.length; i += 321) {
- extract.write(b.slice(i, clamp(i+321, b.length, b.length)));
- }
- extract.end();
-});
-
-test('types', function(t) {
- t.plan(3);
-
- var extract = tar.extract();
- var noEntries = false;
-
- var ondir = function(header, stream, callback) {
- t.deepEqual(header, {
- name: 'directory',
- mode: 0755,
- uid: 501,
- gid: 20,
- size: 0,
- mtime: new Date(1387580181000),
- type: 'directory',
- linkname: null,
- uname: 'maf',
- gname: 'staff',
- devmajor: 0,
- devminor: 0
- });
- stream.on('data', function() {
- t.ok(false);
- });
- extract.once('entry', onlink);
- callback();
- };
-
- var onlink = function(header, stream, callback) {
- t.deepEqual(header, {
- name: 'directory-link',
- mode: 0755,
- uid: 501,
- gid: 20,
- size: 0,
- mtime: new Date(1387580181000),
- type: 'symlink',
- linkname: 'directory',
- uname: 'maf',
- gname: 'staff',
- devmajor: 0,
- devminor: 0
- });
- stream.on('data', function() {
- t.ok(false);
- });
- noEntries = true;
- callback();
- };
-
- extract.once('entry', ondir);
-
- extract.on('finish', function() {
- t.ok(noEntries);
- });
-
- extract.end(fs.readFileSync(fixtures.TYPES_TAR));
-});
-
-test('long-name', function(t) {
- t.plan(3);
-
- var extract = tar.extract();
- var noEntries = false;
-
- extract.on('entry', function(header, stream, callback) {
- t.deepEqual(header, {
- name: 'my/file/is/longer/than/100/characters/and/should/use/the/prefix/header/foobarbaz/foobarbaz/foobarbaz/foobarbaz/foobarbaz/foobarbaz/filename.txt',
- mode: 0644,
- uid: 501,
- gid: 20,
- size: 16,
- mtime: new Date(1387580181000),
- type: 'file',
- linkname: null,
- uname: 'maf',
- gname: 'staff',
- devmajor: 0,
- devminor: 0
- });
-
- stream.pipe(concat(function(data) {
- noEntries = true;
- t.same(data.toString(), 'hello long name\n');
- callback();
- }));
- });
-
- extract.on('finish', function() {
- t.ok(noEntries);
- });
-
- extract.end(fs.readFileSync(fixtures.LONG_NAME_TAR));
-});
-
-test('unicode-bsd', function(t) { // can unpack a bsdtar unicoded tarball
- t.plan(3);
-
- var extract = tar.extract();
- var noEntries = false;
-
- extract.on('entry', function(header, stream, callback) {
- t.deepEqual(header, {
- name: 'høllø.txt',
- mode: 0644,
- uid: 501,
- gid: 20,
- size: 4,
- mtime: new Date(1387588646000),
- type: 'file',
- linkname: null,
- uname: 'maf',
- gname: 'staff',
- devmajor: 0,
- devminor: 0
- });
-
- stream.pipe(concat(function(data) {
- noEntries = true;
- t.same(data.toString(), 'hej\n');
- callback();
- }));
- });
-
- extract.on('finish', function() {
- t.ok(noEntries);
- });
-
- extract.end(fs.readFileSync(fixtures.UNICODE_BSD_TAR));
-});
-
-test('unicode', function(t) { // can unpack a bsdtar unicoded tarball
- t.plan(3);
-
- var extract = tar.extract();
- var noEntries = false;
-
- extract.on('entry', function(header, stream, callback) {
- t.deepEqual(header, {
- name: 'høstål.txt',
- mode: 0644,
- uid: 501,
- gid: 20,
- size: 8,
- mtime: new Date(1387580181000),
- type: 'file',
- linkname: null,
- uname: 'maf',
- gname: 'staff',
- devmajor: 0,
- devminor: 0
- });
-
- stream.pipe(concat(function(data) {
- noEntries = true;
- t.same(data.toString(), 'høllø\n');
- callback();
- }));
- });
-
- extract.on('finish', function() {
- t.ok(noEntries);
- });
-
- extract.end(fs.readFileSync(fixtures.UNICODE_TAR));
-});
-
-test('name-is-100', function(t) {
- t.plan(3);
-
- var extract = tar.extract();
-
- extract.on('entry', function(header, stream, callback) {
- t.same(header.name.length, 100);
-
- stream.pipe(concat(function(data) {
- t.same(data.toString(), 'hello\n');
- callback();
- }));
- });
-
- extract.on('finish', function() {
- t.ok(true);
- });
-
- extract.end(fs.readFileSync(fixtures.NAME_IS_100_TAR));
-});
-
-test('invalid-file', function(t) {
- t.plan(1);
-
- var extract = tar.extract();
-
- extract.on('error', function(err) {
- t.ok(!!err);
- extract.destroy();
- });
-
- extract.end(fs.readFileSync(fixtures.INVALID_TGZ));
-});
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/index.js b/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/index.js
deleted file mode 100644
index 59bc87be..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/index.js
+++ /dev/null
@@ -1,10 +0,0 @@
-var path = require('path');
-
-exports.ONE_FILE_TAR = path.join(__dirname, 'one-file.tar');
-exports.MULTI_FILE_TAR = path.join(__dirname, 'multi-file.tar');
-exports.TYPES_TAR = path.join(__dirname, 'types.tar');
-exports.LONG_NAME_TAR = path.join(__dirname, 'long-name.tar');
-exports.UNICODE_BSD_TAR = path.join(__dirname, 'unicode-bsd.tar');
-exports.UNICODE_TAR = path.join(__dirname, 'unicode.tar');
-exports.NAME_IS_100_TAR = path.join(__dirname, 'name-is-100.tar');
-exports.INVALID_TGZ = path.join(__dirname, 'invalid.tgz');
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/invalid.tgz b/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/invalid.tgz
deleted file mode 100644
index ea35ec4e..00000000
Binary files a/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/invalid.tgz and /dev/null differ
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/long-name.tar b/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/long-name.tar
deleted file mode 100644
index cf939817..00000000
Binary files a/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/long-name.tar and /dev/null differ
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/multi-file.tar b/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/multi-file.tar
deleted file mode 100644
index 6dabdf63..00000000
Binary files a/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/multi-file.tar and /dev/null differ
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/name-is-100.tar b/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/name-is-100.tar
deleted file mode 100644
index 299b2e8c..00000000
Binary files a/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/name-is-100.tar and /dev/null differ
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/one-file.tar b/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/one-file.tar
deleted file mode 100644
index 8d4ac282..00000000
Binary files a/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/one-file.tar and /dev/null differ
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/types.tar b/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/types.tar
deleted file mode 100644
index 197af7b6..00000000
Binary files a/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/types.tar and /dev/null differ
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/unicode-bsd.tar b/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/unicode-bsd.tar
deleted file mode 100644
index 2f74b5f4..00000000
Binary files a/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/unicode-bsd.tar and /dev/null differ
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/unicode.tar b/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/unicode.tar
deleted file mode 100644
index ab7dbad9..00000000
Binary files a/builder/node_modules/archiver/node_modules/tar-stream/test/fixtures/unicode.tar and /dev/null differ
diff --git a/builder/node_modules/archiver/node_modules/tar-stream/test/pack.js b/builder/node_modules/archiver/node_modules/tar-stream/test/pack.js
deleted file mode 100644
index 69a7680a..00000000
--- a/builder/node_modules/archiver/node_modules/tar-stream/test/pack.js
+++ /dev/null
@@ -1,144 +0,0 @@
-var test = require('tap').test;
-var tar = require('../index');
-var fixtures = require('./fixtures');
-var concat = require('concat-stream');
-var fs = require('fs');
-
-test('one-file', function(t) {
- t.plan(2);
-
- var pack = tar.pack();
-
- pack.entry({
- name:'test.txt',
- mtime:new Date(1387580181000),
- mode:0644,
- uname:'maf',
- gname:'staff',
- uid:501,
- gid:20
- }, 'hello world\n');
-
- pack.finalize();
-
- pack.pipe(concat(function(data) {
- t.same(data.length & 511, 0);
- t.deepEqual(data, fs.readFileSync(fixtures.ONE_FILE_TAR));
- }));
-});
-
-test('multi-file', function(t) {
- t.plan(2);
-
- var pack = tar.pack();
-
- pack.entry({
- name:'file-1.txt',
- mtime:new Date(1387580181000),
- mode:0644,
- uname:'maf',
- gname:'staff',
- uid:501,
- gid:20
- }, 'i am file-1\n');
-
- pack.entry({
- name:'file-2.txt',
- mtime:new Date(1387580181000),
- mode:0644,
- size:12,
- uname:'maf',
- gname:'staff',
- uid:501,
- gid:20
- }).end('i am file-2\n');
-
- pack.finalize();
-
- pack.pipe(concat(function(data) {
- t.same(data.length & 511, 0);
- t.deepEqual(data, fs.readFileSync(fixtures.MULTI_FILE_TAR));
- }));
-});
-
-test('types', function(t) {
- t.plan(2);
- var pack = tar.pack();
-
- pack.entry({
- name:'directory',
- mtime:new Date(1387580181000),
- type:'directory',
- mode:0755,
- uname:'maf',
- gname:'staff',
- uid:501,
- gid:20
- });
-
- pack.entry({
- name:'directory-link',
- mtime:new Date(1387580181000),
- type:'symlink',
- linkname: 'directory',
- mode:0755,
- uname:'maf',
- gname:'staff',
- uid:501,
- gid:20
- });
-
- pack.finalize();
-
- pack.pipe(concat(function(data) {
- t.equal(data.length & 511, 0);
- t.deepEqual(data, fs.readFileSync(fixtures.TYPES_TAR));
- }));
-
-});
-
-test('long-name', function(t) {
- t.plan(2);
- var pack = tar.pack();
-
- pack.entry({
- name:'my/file/is/longer/than/100/characters/and/should/use/the/prefix/header/foobarbaz/foobarbaz/foobarbaz/foobarbaz/foobarbaz/foobarbaz/filename.txt',
- mtime:new Date(1387580181000),
- type:'file',
- mode:0644,
- uname:'maf',
- gname:'staff',
- uid:501,
- gid:20
- }, 'hello long name\n');
-
- pack.finalize();
-
- pack.pipe(concat(function(data) {
- t.equal(data.length & 511, 0);
- t.deepEqual(data, fs.readFileSync(fixtures.LONG_NAME_TAR));
- }));
-});
-
-test('unicode', function(t) {
- t.plan(2);
- var pack = tar.pack();
-
- pack.entry({
- name:'høstål.txt',
- mtime:new Date(1387580181000),
- type:'file',
- mode:0644,
- uname:'maf',
- gname:'staff',
- uid:501,
- gid:20
- }, 'høllø\n');
-
- pack.finalize();
-
- pack.pipe(concat(function(data) {
- t.equal(data.length & 511, 0);
- t.deepEqual(data, fs.readFileSync(fixtures.UNICODE_TAR));
- }));
-});
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/LICENSE-MIT b/builder/node_modules/archiver/node_modules/zip-stream/LICENSE-MIT
deleted file mode 100644
index 56420a6a..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/LICENSE-MIT
+++ /dev/null
@@ -1,22 +0,0 @@
-Copyright (c) 2014 Chris Talkington, 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.
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/README.md b/builder/node_modules/archiver/node_modules/zip-stream/README.md
deleted file mode 100644
index ce498433..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/README.md
+++ /dev/null
@@ -1,120 +0,0 @@
-# zip-stream v0.3.6 [](https://travis-ci.org/ctalkington/node-zip-stream)
-
-zip-stream is a streaming zip archive generator. It was built to be a successor to [zipstream](https://npmjs.org/package/zipstream). Dependencies are kept to a minimum through the use of many of node's built-in modules including the use of zlib module for compression.
-
-[](https://nodei.co/npm/zip-stream/)
-
-### Install
-
-```bash
-npm install zip-stream --save
-```
-
-You can also use `npm install https://github.com/ctalkington/node-zip-stream/archive/master.tar.gz` to test upcoming versions.
-
-### Usage
-
-This module is meant to be wrapped internally by other modules and therefore lacks any queue management. This means you have to wait until the previous entry has been fully consumed to add another. Nested callbacks should be used to add multiple entries. There are modules like [async](https://npmjs.org/package/async) that ease the so called "callback hell".
-
-If you want a module that handles entry queueing and much more, you should check out [archiver](https://npmjs.org/package/archiver) which uses this module internally.
-
-```js
-var packer = require('zip-stream');
-var archive = new packer(); // OR new packer(options)
-
-archive.on('error', function(err) {
- throw err;
-});
-
-// pipe archive where you want it (ie fs, http, etc)
-// listen to the destination's end, close, or finish event
-
-archive.entry('string contents', { name: 'string.txt' }, function(err, entry) {
- if (err) throw err;
- archive.entry(null, { name: 'directory/' }, function(err, entry) {
- if (err) throw err;
- archive.finalize();
- });
-});
-```
-
-### Instance API
-
-#### entry(input, data, callback(err, data))
-
-Appends an input source (text string, buffer, or stream) to the instance. When the instance has received, processed, and emitted the input, the callback is fired.
-
-#### finalize()
-
-Finalizes the instance. You should listen to the destination stream's `end`/`close`/`finish` event to know when all output has been safely consumed.
-
-### Instance Options
-
-#### comment `string`
-
-Sets the zip comment.
-
-#### forceUTC `boolean`
-
-If true, forces the entry date to UTC. Helps with testing across timezones.
-
-#### store `boolean`
-
-If true, all entry contents will be archived without compression by default.
-
-#### zlib `object`
-
-Passed to node's [zlib](http://nodejs.org/api/zlib.html#zlib_options) module to control compression. Options may vary by node version.
-
-### Entry Data
-
-#### name `string` `required`
-
-Sets the entry name including internal path.
-
-#### type `string`
-
-Sets the entry type. Defaults to `file` or `directory` if name ends with trailing slash.
-
-#### date `string|Date`
-
-Sets the entry date. This can be any valid date string or instance. Defaults to current time in locale.
-
-#### store `boolean`
-
-If true, entry contents will be archived without compression.
-
-#### comment `string`
-
-Sets the entry comment.
-
-#### mode `number`
-
-Sets the entry permissions. (experimental)
-
-## Debugging
-
-This library makes use of the [debug](https://npmjs.org/package/debug) module with a namespace of `zip-stream` which can be triggered by setting `DEBUG` in your environment like so:
-
-```shell
-# unix
-DEBUG=zip-stream:* node script
-
-# windows (powershell)
-$env:DEBUG="zip-stream:*"
-node script
-
-# windows (cmd)
-SET DEBUG="zip-stream:*"
-node script
-```
-
-## Things of Interest
-
-- [Releases](https://github.com/ctalkington/node-zip-stream/releases)
-- [Contributing](https://github.com/ctalkington/node-zip-stream/blob/master/CONTRIBUTING.md)
-- [MIT License](https://github.com/ctalkington/node-zip-stream/blob/master/LICENSE-MIT)
-
-## Credits
-
-Concept inspired by Antoine van Wel's [zipstream](https://npmjs.org/package/zipstream) module, which is no longer being updated.
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/lib/headers.js b/builder/node_modules/archiver/node_modules/zip-stream/lib/headers.js
deleted file mode 100644
index c052c066..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/lib/headers.js
+++ /dev/null
@@ -1,279 +0,0 @@
-/**
- * node-zip-stream
- *
- * Copyright (c) 2014 Chris Talkington, contributors.
- * Licensed under the MIT license.
- * https://github.com/ctalkington/node-zip-stream/blob/master/LICENSE-MIT
- */
-var inherits = require('util').inherits;
-var util = require('./util');
-
-var debug = util.debug('zip-stream:headers');
-
-var DEFAULT_FILE_MODE = 0100644; // 644 -rw-r--r-- = S_IFREG | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
-var DEFAULT_DIR_MODE = 040755; // 755 drwxr-xr-x = S_IFDIR | S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH
-var EXT_FILE_ATTR_DIR = 010173200020; // 755 drwxr-xr-x = (((S_IFDIR | 0755) << 16) | S_DOS_D)
-var EXT_FILE_ATTR_FILE = 020151000040; // 644 -rw-r--r-- = (((S_IFREG | 0644) << 16) | S_DOS_A) >>> 0
-
-// Unix file types
-var S_IFIFO = 010000; // named pipe (fifo)
-var S_IFCHR = 020000; // character special
-var S_IFDIR = 040000; // directory
-var S_IFBLK = 060000; // block special
-var S_IFREG = 0100000; // regular
-var S_IFLNK = 0120000; // symbolic link
-var S_IFSOCK = 0140000; // socket
-
-var S_IRWXU = 0700; // RWX mask for owner
-var S_IRUSR = 0400; // R for owner
-var S_IWUSR = 0200; // W for owner
-var S_IXUSR = 0100; // X for owner
-
-var S_IRWXG = 070; // RWX mask for group
-var S_IRGRP = 040; // R for group
-var S_IWGRP = 020; // W for group
-var S_IXGRP = 010; // X for group
-
-var S_IRWXO = 07; // RWX mask for other
-var S_IROTH = 04; // R for other
-var S_IWOTH = 02; // W for other
-var S_IXOTH = 01; // X for other
-
-var S_ISVTX = 01000; // save swapped text even after use
-
-// setuid/setgid/sticky bits
-var S_ISUID = 04000; // set user id on execution
-var S_ISGID = 02000; // set group id on execution
-var S_ISTXT = 01000; // sticky bit
-
-// DOS file type flags
-var S_DOS_A = 040; // Archive
-var S_DOS_D = 020; // Directory
-var S_DOS_V = 010; // Volume
-var S_DOS_S = 04; // System
-var S_DOS_H = 02; // Hidden
-var S_DOS_R = 01; // Read Only
-
-function ZipHeader() {
- this.name = 'zipHeader';
- this.bufferSize = 0;
- this.fields = [];
-}
-
-ZipHeader.prototype.toBuffer = function(data) {
- var self = this;
- var buf = new Buffer(self.bufferSize);
- var offset = 0;
- var val;
- var valLength;
- var fallback;
-
- debug('%s:start', self.name);
-
- data = self._normalize(data);
-
- self.fields.forEach(function(field) {
- fallback = (field.type === 'string') ? '' : 0;
- val = data[field.name] || field.def || fallback;
- valLength = (field.lenField && data[field.lenField] > 0) ? data[field.lenField] : field.len;
-
- if (typeof buf['write' + field.type] === 'function') {
- debug('%s:%s:%s:%d+%d', self.name, field.type, field.name, offset, field.len);
- buf['write' + field.type](val, offset);
- } else if (val.length > 0) {
- debug('%s:%s:%d+%d', self.name, field.name, offset, val.length);
- buf.write(val, offset);
- }
-
- offset += valLength;
- });
-
- debug('%s:finish:%d', self.name, offset);
-
- return buf.slice(0, offset);
-};
-
-ZipHeader.prototype.toObject = function(buf) {
- var self = this;
- var data = {};
- var offset = 0;
- var valLength;
-
- self.fields.forEach(function(field) {
- valLength = (field.lenField && data[field.lenField] > 0) ? data[field.lenField] : field.len;
-
- if (typeof buf['read' + field.type] === 'function') {
- data[field.name] = buf['read' + field.type](offset);
- } else if (valLength > 0) {
- data[field.name] = buf.toString(null, offset, valLength);
- } else {
- data[field.name] = null;
- }
-
- offset += valLength;
- });
-
- return data;
-};
-
-ZipHeader.prototype._generateExternalAttributes = function(mode, type) {
- var isDir = type === 'directory';
-
- var owner = (mode >> 6) & 07;
- var group = (mode >> 3) & 07;
- var other = mode & 07;
-
- var attr = isDir ? S_IFDIR : S_IFREG;
- attr |= ((owner & 07) << 6) | ((group & 07) << 3) | (other & 07);
-
- return (attr << 16) | (isDir ? S_DOS_D : S_DOS_A);
-};
-
-ZipHeader.prototype._normalize = function(data) {
- // Don't always set mode as this is a experimental feature
- // if (!data.mode) {
- // data.mode = DEFAULT_FILE_MODE;
- // }
-
- data.filenameLength = 0;
- data.commentLength = 0;
- data.extraFieldLength = 0;
-
- if (data.name) {
- if (Buffer.byteLength(data.name) !== data.name.length) {
- data.flags |= (1 << 11);
- }
-
- data.filenameLength = Buffer.byteLength(data.name);
- }
-
- if (data.comment) {
- if (Buffer.byteLength(data.comment) !== data.comment.length) {
- data.flags |= (1 << 11);
- }
-
- data.commentLength = Buffer.byteLength(data.comment);
- }
-
- if (data.extraField) {
- data.extraFieldLength = data.extraField.length;
- }
-
- if (data.mode) {
- data.mode &= ~S_IFDIR;
-
- if (data.type === 'file') {
- data.mode |= S_IFREG;
- }
-
- data.externalFileAttributes &= ~data.externalFileAttributes;
- data.externalFileAttributes |= this._generateExternalAttributes(data.mode, data.type);
- data.externalFileAttributes >>>= 0;
- }
-
- return data;
-};
-
-function ZipHeaderFile() {
- ZipHeader.call(this);
-
- this.name = 'file';
- this.bufferSize = 1024;
- this.fields = [
- {name: 'signature', len: 4, type: 'UInt32LE', def: 0x04034b50},
- {name: 'versionNeededToExtract', len: 2, type: 'UInt16LE', def: 20},
- {name: 'flags', len: 2, type: 'UInt16LE'},
- {name: 'compressionMethod', len: 2, type: 'UInt16LE'},
- {name: 'lastModifiedDate', len: 4, type: 'UInt32LE'},
- {name: 'crc32', len: 4, type: 'UInt32LE', def: 0},
- {name: 'compressedSize', len: 4, type: 'UInt32LE'},
- {name: 'uncompressedSize', len: 4, type: 'UInt32LE'},
- {name: 'filenameLength', len: 2, type: 'UInt16LE'},
- {name: 'extraFieldLength', len: 2, type: 'UInt16LE'},
- {name: 'name', len: 0, lenField: 'filenameLength', type: 'string'},
- {name: 'extraField', len: 0, lenField: 'extraFieldLength', type: 'string'}
- ];
-}
-inherits(ZipHeaderFile, ZipHeader);
-
-function ZipHeaderFileDescriptor() {
- ZipHeader.call(this);
-
- this.name = 'fileDescriptor';
- this.bufferSize = 16;
- this.fields = [
- {name: 'signature', len: 4, type: 'UInt32LE', def: 0x08074b50},
- {name: 'crc32', len: 4, type: 'UInt32LE'},
- {name: 'compressedSize', len: 4, type: 'UInt32LE'},
- {name: 'uncompressedSize', len: 4, type: 'UInt32LE'}
- ];
-}
-inherits(ZipHeaderFileDescriptor, ZipHeader);
-
-function ZipHeaderCentralDirectory() {
- ZipHeader.call(this);
-
- this.name = 'centralDirectory';
- this.bufferSize = 1024;
- this.fields = [
- {name: 'signature', len: 4, type: 'UInt32LE', def: 0x02014b50},
- {name: 'versionMadeBy', len: 2, type: 'UInt16LE', def: 20},
- {name: 'versionNeededToExtract', len: 2, type: 'UInt16LE', def: 20},
- {name: 'flags', len: 2, type: 'UInt16LE'},
- {name: 'compressionMethod', len: 2, type: 'UInt16LE'},
- {name: 'lastModifiedDate', len: 4, type: 'UInt32LE'},
- {name: 'crc32', len: 4, type: 'UInt32LE'},
- {name: 'compressedSize', len: 4, type: 'UInt32LE'},
- {name: 'uncompressedSize', len: 4, type: 'UInt32LE'},
- {name: 'filenameLength', len: 2, type: 'UInt16LE'},
- {name: 'extranameLength', len: 2, type: 'UInt16LE'},
- {name: 'commentLength', len: 2, type: 'UInt16LE'},
- {name: 'diskNumberStart', len: 2, type: 'UInt16LE'},
- {name: 'internalFileAttributes', len: 2, type: 'UInt16LE'},
- {name: 'externalFileAttributes', len: 4, type: 'UInt32LE'},
- {name: 'offset', len: 4, type: 'UInt32LE'},
- {name: 'name', len: 0, lenField: 'filenameLength', type: 'string'},
- {name: 'extraField', len: 0, lenField: 'extraFieldLength', type: 'string'},
- {name: 'comment', len: 0, lenField: 'commentLength', type: 'string'}
- ];
-}
-inherits(ZipHeaderCentralDirectory, ZipHeader);
-
-function ZipHeaderCentralFooter() {
- ZipHeader.call(this);
-
- this.name = 'centralFooter';
- this.bufferSize = 512;
- this.fields = [
- {name: 'signature', len: 4, type: 'UInt32LE', def: 0x06054b50},
- {name: 'diskNumber', len: 2, type: 'UInt16LE'},
- {name: 'diskNumberStart', len: 2, type: 'UInt16LE'},
- {name: 'directoryRecordsDisk', len: 2, type: 'UInt16LE'},
- {name: 'directoryRecords', len: 2, type: 'UInt16LE'},
- {name: 'centralDirectorySize', len: 4, type: 'UInt32LE'},
- {name: 'centralDirectoryOffset', len: 4, type: 'UInt32LE'},
- {name: 'commentLength', len: 2, type: 'UInt16LE'},
- {name: 'comment', len: 0, lenField: 'commentLength', type: 'string'}
- ];
-}
-inherits(ZipHeaderCentralFooter, ZipHeader);
-
-var headers = {
- file: new ZipHeaderFile(),
- fileDescriptor: new ZipHeaderFileDescriptor(),
- centralDirectory: new ZipHeaderCentralDirectory(),
- centralFooter: new ZipHeaderCentralFooter()
-};
-
-var encode = exports.encode = function(type, data) {
- if (!headers[type] || typeof headers[type].toBuffer !== 'function') {
- throw new Error('Unknown encode type');
- }
-
- return headers[type].toBuffer(data);
-};
-
-exports.file = ZipHeaderFile;
-exports.fileDescriptor = ZipHeaderFileDescriptor;
-exports.centralDirectory = ZipHeaderCentralDirectory;
-exports.centralFooter = ZipHeaderCentralFooter;
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/lib/util/index.js b/builder/node_modules/archiver/node_modules/zip-stream/lib/util/index.js
deleted file mode 100644
index 03ce1862..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/lib/util/index.js
+++ /dev/null
@@ -1,105 +0,0 @@
-/**
- * node-zip-stream
- *
- * Copyright (c) 2014 Chris Talkington, contributors.
- * Licensed under the MIT license.
- * https://github.com/ctalkington/node-zip-stream/blob/master/LICENSE-MIT
- */
-var fs = require('fs');
-var path = require('path');
-
-var Stream = require('stream').Stream;
-var PassThrough = require('readable-stream').PassThrough;
-
-var _ = require('lodash');
-
-var util = module.exports = {};
-
-util.debug = require('debug');
-
-util.convertDateTimeDos = function(input) {
- return new Date(
- ((input >> 25) & 0x7f) + 1980,
- ((input >> 21) & 0x0f) - 1,
- (input >> 16) & 0x1f,
- (input >> 11) & 0x1f,
- (input >> 5) & 0x3f,
- (input & 0x1f) << 1
- );
-};
-
-util.dateify = function(dateish) {
- dateish = dateish || new Date();
-
- if (dateish instanceof Date) {
- dateish = dateish;
- } else if (typeof dateish === 'string') {
- dateish = new Date(dateish);
- } else {
- dateish = new Date();
- }
-
- return dateish;
-};
-
-// this is slightly different from lodash version
-util.defaults = function(object, source, guard) {
- var args = arguments;
- args[0] = args[0] || {};
-
- return _.defaults.apply(_, args);
-};
-
-util.dosDateTime = function(d, utc) {
- d = (d instanceof Date) ? d : util.dateify(d);
- utc = utc || false;
-
- var year = utc ? d.getUTCFullYear() : d.getFullYear();
-
- if (year < 1980) {
- return 2162688; // 1980-1-1 00:00:00
- } else if (year >= 2044) {
- return 2141175677; // 2043-12-31 23:59:58
- }
-
- var val = {
- year: year,
- month: utc ? d.getUTCMonth() : d.getMonth(),
- date: utc ? d.getUTCDate() : d.getDate(),
- hours: utc ? d.getUTCHours() : d.getHours(),
- minutes: utc ? d.getUTCMinutes() : d.getMinutes(),
- seconds: utc ? d.getUTCSeconds() : d.getSeconds()
- };
-
- return ((val.year-1980) << 25) | ((val.month+1) << 21) | (val.date << 16) |
- (val.hours << 11) | (val.minutes << 5) | (val.seconds / 2);
-};
-
-util.isStream = function(source) {
- return source instanceof Stream;
-};
-
-util.normalizeInputSource = function(source) {
- if (source === null) {
- return new Buffer(0);
- } else if (typeof source === 'string') {
- return new Buffer(source);
- } else if (util.isStream(source) && !source._readableState) {
- var normalized = new PassThrough();
- source.pipe(normalized);
-
- return normalized;
- }
-
- return source;
-};
-
-util.sanitizePath = function() {
- var filepath = path.join.apply(path, arguments);
- return filepath.replace(/\\/g, '/').replace(/:/g, '').replace(/^\/+/, '');
-};
-
-util.unixifyPath = function() {
- var filepath = path.join.apply(path, arguments);
- return filepath.replace(/\\/g, '/');
-};
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/lib/zip-stream.js b/builder/node_modules/archiver/node_modules/zip-stream/lib/zip-stream.js
deleted file mode 100644
index e13d752f..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/lib/zip-stream.js
+++ /dev/null
@@ -1,307 +0,0 @@
-/**
- * node-zip-stream
- *
- * Copyright (c) 2014 Chris Talkington, contributors.
- * Licensed under the MIT license.
- * https://github.com/ctalkington/node-zip-stream/blob/master/LICENSE-MIT
- */
-var inherits = require('util').inherits;
-var Transform = require('readable-stream').Transform;
-
-var crc32 = require('buffer-crc32');
-var ChecksumStream = require('crc32-stream');
-var DeflateCRC32Stream = require('deflate-crc32-stream');
-var headers = require('./headers');
-var util = require('./util');
-
-var debug = util.debug('zip-stream:instance');
-var debugEntry = util.debug('zip-stream:entry');
-
-var ZipStream = module.exports = function(options) {
- if (!(this instanceof ZipStream)) {
- return new ZipStream(options);
- }
-
- debug('init');
-
- options = this.options = util.defaults(options, {
- highWaterMark: 1024 * 1024,
- comment: '',
- forceUTC: false,
- store: false
- });
-
- if (typeof options.zlib !== 'object') {
- options.zlib = {};
- }
-
- if (typeof options.level === 'number' && options.level >= 0) {
- options.zlib.level = options.level;
- delete options.level;
- } else if (typeof options.zlib.level !== 'number') {
- options.zlib.level = 1;
- }
-
- if (options.zlib.level === 0) {
- options.store = true;
- }
-
- Transform.call(this, options);
-
- this.offset = 0;
- this.entries = [];
-
- this._finalize = false;
- this._finalized = false;
- this._processing = false;
-
- this.once('end', function() {
- debug('stats:' + this.entries.length + 'e:' + this.offset + 'b');
- debug('end');
- });
-};
-
-inherits(ZipStream, Transform);
-
-ZipStream.prototype._afterAppend = function(entry) {
- debugEntry('%s:finish', entry.name);
-
- this.entries.push(entry);
- this._processing = false;
-
- if (this._finalize) {
- this.finalize();
- }
-};
-
-ZipStream.prototype._appendBuffer = function(source, data, callback) {
- var self = this;
-
- data.offset = self.offset;
-
- if (source.length === 0) {
- data.store = true;
- data.compressionMethod = 0;
- }
-
- if (data.store) {
- data.uncompressedSize = source.length;
- data.compressedSize = data.uncompressedSize;
- data.crc32 = crc32.unsigned(source);
- } else {
- data.flags |= (1 << 3);
- }
-
- self._writeHeader('file', data);
-
- if (data.store) {
- self.write(source);
- self._afterAppend(data);
- callback(null, data);
- } else {
- var processStream = self._newProcessStream(data.store, function(err) {
- if (err) {
- return callback(err);
- }
-
- data.crc32 = processStream.digest();
- data.uncompressedSize = processStream.size();
- data.compressedSize = processStream.compressedSize || data.uncompressedSize;
-
- self._writeHeader('fileDescriptor', data);
- self._afterAppend(data);
- callback(null, data);
- });
-
- processStream.end(source);
- }
-};
-
-ZipStream.prototype._appendStream = function(source, data, callback) {
- var self = this;
-
- data.flags |= (1 << 3);
- data.offset = self.offset;
-
- self._writeHeader('file', data);
-
- var processStream = self._newProcessStream(data.store, function(err) {
- if (err) {
- return callback(err);
- }
-
- data.crc32 = processStream.digest();
- data.uncompressedSize = processStream.size();
- data.compressedSize = processStream.size(true);
-
- self._writeHeader('fileDescriptor', data);
- self._afterAppend(data);
- callback(null, data);
- });
-
- source.pipe(processStream);
-};
-
-ZipStream.prototype._emitErrorCallback = function(err, data) {
- if (err) {
- this.emit('error', err);
- }
-};
-
-ZipStream.prototype._newProcessStream = function(store, callback) {
- var process;
-
- if (store) {
- process = new ChecksumStream();
- } else {
- process = new DeflateCRC32Stream(this.options.zlib);
- }
-
- if (typeof callback === 'function') {
- process.once('error', callback);
- process.once('end', callback);
- }
-
- process.pipe(this, { end: false });
-
- return process;
-};
-
-ZipStream.prototype._normalizeFileData = function(data) {
- data = util.defaults(data, {
- type: 'file',
- name: null,
- date: null,
- store: this.options.store,
- comment: ''
- });
-
- var isDir = data.type === 'directory';
-
- if (data.name) {
- data.name = util.sanitizePath(data.name);
-
- if (data.name.slice(-1) === '/') {
- isDir = true;
- data.type = 'directory';
- } else if (isDir) {
- data.name += '/';
- }
- }
-
- if (isDir) {
- data.store = true;
- }
-
- if (typeof data.lastModifiedDate !== 'number') {
- data.lastModifiedDate = util.dosDateTime(data.date, this.options.forceUTC);
- }
-
- data.flags = 0;
- data.compressionMethod = data.store ? 0 : 8;
- data.uncompressedSize = 0;
- data.compressedSize = 0;
-
- return data;
-};
-
-ZipStream.prototype._transform = function(chunk, encoding, callback) {
- callback(null, chunk);
-};
-
-ZipStream.prototype._writeCentralDirectory = function() {
- var entries = this.entries;
- var comment = this.options.comment;
- var cdoffset = this.offset;
- var cdsize = 0;
-
- var centralDirectoryBuffer;
- for (var i = 0; i < entries.length; i++) {
- var entry = entries[i];
-
- centralDirectoryBuffer = this._writeHeader('centralDirectory', entry);
- cdsize += centralDirectoryBuffer.length;
- }
-
- var centralDirectoryFooterData = {
- directoryRecordsDisk: entries.length,
- directoryRecords: entries.length,
- centralDirectorySize: cdsize,
- centralDirectoryOffset: cdoffset,
- comment: comment
- };
-
- this._writeHeader('centralFooter', centralDirectoryFooterData);
-};
-
-ZipStream.prototype._writeHeader = function(type, data) {
- var encoded = headers.encode(type, data);
- this.write(encoded);
-
- return encoded;
-};
-
-ZipStream.prototype.entry = function(source, data, callback) {
- if (typeof callback !== 'function') {
- callback = this._emitErrorCallback.bind(this);
- }
-
- if (this._processing) {
- callback(new Error('already processing an entry'));
- return;
- }
-
- if (this._finalize || this._finalized) {
- callback(new Error('entry after finalize()'));
- return;
- }
-
- data = this._normalizeFileData(data);
- debugEntry('%s:start', data.name);
-
- if (data.type !== 'file' && data.type !== 'directory') {
- callback(new Error(data.type + ' entries not currently supported'));
- return;
- }
-
- if (typeof data.name !== 'string' || data.name.length === 0) {
- callback(new Error('entry name must be a non-empty string value'));
- return;
- }
-
- this._processing = true;
- source = util.normalizeInputSource(source);
-
- if (Buffer.isBuffer(source)) {
- debugEntry('%s:source:buffer', data.name);
- this._appendBuffer(source, data, callback);
- } else if (util.isStream(source)) {
- debugEntry('%s:source:stream', data.name);
- this._appendStream(source, data, callback);
- } else {
- this._processing = false;
- callback(new Error('input source must be valid Stream or Buffer instance'));
- return;
- }
-};
-
-ZipStream.prototype.finalize = function() {
- if (this._processing) {
- this._finalize = true;
- return;
- }
-
- debug('finalize');
- this._writeCentralDirectory();
- this._finalized = true;
- debug('finalized');
- this.end();
-};
-
-ZipStream.prototype.write = function(chunk, cb) {
- if (chunk) {
- this.offset += chunk.length;
- }
-
- return Transform.prototype.write.call(this, chunk, cb);
-};
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/.npmignore b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/.npmignore
deleted file mode 100644
index c766b8bd..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/.npmignore
+++ /dev/null
@@ -1,3 +0,0 @@
-npm-debug.log
-node_modules/
-tmp/
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/.travis.yml b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/.travis.yml
deleted file mode 100644
index 2ca91f28..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/.travis.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-language: node_js
-node_js:
- - "0.10"
- - "0.8"
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/CHANGELOG b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/CHANGELOG
deleted file mode 100644
index b87f161b..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/CHANGELOG
+++ /dev/null
@@ -1,18 +0,0 @@
-v0.2.0:
- date: 2014-05-03
- changes:
- - add size method to return raw size of data passed-through.
-v0.1.2:
- date: 2014-04-18
- changes:
- - always use readable-stream for consistency.
- - use crc32.unsigned to get digest.
-v0.1.1:
- date: 2014-03-30
- changes:
- - gracefully handle "no data" scenario.
- - trim down deps.
-v0.1.0:
- date: 2014-03-30
- changes:
- - initial release.
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/CONTRIBUTING.md b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/CONTRIBUTING.md
deleted file mode 100644
index 1fa92d43..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/CONTRIBUTING.md
+++ /dev/null
@@ -1,14 +0,0 @@
-## Contributing
-
-#### Code Style Guide
-
-* code should be indented with 2 spaces
-* single quotes should be used where feasible
-* commas should be followed by a single space (function params, etc)
-* variable declaration should include `var`, [no multiple declarations](http://benalman.com/news/2012/05/multiple-var-statements-javascript/)
-
-#### Tests
-
-* tests should be added to the nodeunit configs in `test/`
-* tests can be run with `npm test`
-* see existing tests for guidance
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/LICENSE-MIT b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/LICENSE-MIT
deleted file mode 100644
index 56420a6a..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/LICENSE-MIT
+++ /dev/null
@@ -1,22 +0,0 @@
-Copyright (c) 2014 Chris Talkington, 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.
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/README.md b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/README.md
deleted file mode 100644
index 9ad3e1e6..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/README.md
+++ /dev/null
@@ -1,59 +0,0 @@
-# crc32-stream v0.2.0 [](https://travis-ci.org/ctalkington/node-crc32-stream)
-
-crc32-stream is a streaming CRC32 checksumer. It uses [buffer-crc32](https://www.npmjs.org/package/buffer-crc32) behind the scenes to reliably handle binary data and fancy character sets. Data is passed through untouched.
-
-[](https://nodei.co/npm/crc32-stream/)
-
-### Install
-
-```bash
-npm install crc32-stream --save
-```
-
-You can also use `npm install https://github.com/ctalkington/node-crc32-stream/archive/master.tar.gz` to test upcoming versions.
-
-### Usage
-
-```js
-var CRC32Stream = require('crc32-stream');
-
-var source = fs.createReadStream('file.txt');
-var checksum = new CRC32Stream();
-
-checksum.on('end', function(err) {
- // do something with checksum.digest() here
-});
-
-// either pipe it
-source.pipe(checksum);
-
-// or write it
-checksum.write('string');
-checksum.end();
-```
-
-### Instance API
-
-Inherits [Transform Stream](http://nodejs.org/api/stream.html#stream_class_stream_transform) methods.
-
-#### digest()
-
-Returns the checksum digest in unsigned form.
-
-#### hex()
-
-Returns the hexadecimal representation of the checksum digest. (ie E81722F0)
-
-#### size()
-
-Returns the raw size/length of passed-through data.
-
-### Instance Options
-
-Inherits [Transform Stream](http://nodejs.org/api/stream.html#stream_class_stream_transform) options.
-
-## Things of Interest
-
-- [Changelog](https://github.com/ctalkington/node-crc32-stream/releases)
-- [Contributing](https://github.com/ctalkington/node-crc32-stream/blob/master/CONTRIBUTING.md)
-- [MIT License](https://github.com/ctalkington/node-crc32-stream/blob/master/LICENSE-MIT)
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/lib/crc32-stream.js b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/lib/crc32-stream.js
deleted file mode 100644
index f13aa68a..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/lib/crc32-stream.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * node-crc32-stream
- *
- * Copyright (c) 2014 Chris Talkington, contributors.
- * Licensed under the MIT license.
- * https://github.com/ctalkington/node-crc32-stream/blob/master/LICENSE-MIT
- */
-var inherits = require('util').inherits;
-var Transform = require('readable-stream').Transform;
-
-var crc32 = require('buffer-crc32');
-
-function CRC32Stream(options) {
- Transform.call(this, options);
- this.checksum = new Buffer(4);
- this.checksum.writeInt32BE(0, 0);
-
- this.rawSize = 0;
-}
-
-inherits(CRC32Stream, Transform);
-
-CRC32Stream.prototype._transform = function(chunk, encoding, callback) {
- if (chunk) {
- this.checksum = crc32(chunk, this.checksum);
- this.rawSize += chunk.length;
- }
-
- callback(null, chunk);
-};
-
-CRC32Stream.prototype.digest = function() {
- return crc32.unsigned(0, this.checksum);
-};
-
-CRC32Stream.prototype.hex = function() {
- return this.digest().toString(16).toUpperCase();
-};
-
-CRC32Stream.prototype.size = function() {
- return this.rawSize;
-};
-
-module.exports = CRC32Stream;
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/package.json b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/package.json
deleted file mode 100644
index eb90483e..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/package.json
+++ /dev/null
@@ -1,52 +0,0 @@
-{
- "name": "crc32-stream",
- "version": "0.2.0",
- "description": "a streaming CRC32 checksumer",
- "homepage": "https://github.com/ctalkington/node-crc32-stream",
- "author": {
- "name": "Chris Talkington",
- "url": "http://christalkington.com/"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/ctalkington/node-crc32-stream.git"
- },
- "bugs": {
- "url": "https://github.com/ctalkington/node-crc32-stream/issues"
- },
- "licenses": [
- {
- "type": "MIT",
- "url": "https://github.com/ctalkington/node-crc32-stream/blob/master/LICENSE-MIT"
- }
- ],
- "main": "lib/crc32-stream.js",
- "engines": {
- "node": ">= 0.8.0"
- },
- "scripts": {
- "test": "mocha --reporter dot"
- },
- "dependencies": {
- "readable-stream": "~1.0.24",
- "buffer-crc32": "~0.2.1"
- },
- "devDependencies": {
- "chai": "~1.8.1",
- "mocha": "~1.16.0"
- },
- "keywords": [
- "crc32-stream",
- "crc32",
- "stream",
- "checksum"
- ],
- "readme": "# crc32-stream v0.2.0 [](https://travis-ci.org/ctalkington/node-crc32-stream)\r\n\r\ncrc32-stream is a streaming CRC32 checksumer. It uses [buffer-crc32](https://www.npmjs.org/package/buffer-crc32) behind the scenes to reliably handle binary data and fancy character sets. Data is passed through untouched.\r\n\r\n[](https://nodei.co/npm/crc32-stream/)\r\n\r\n### Install\r\n\r\n```bash\r\nnpm install crc32-stream --save\r\n```\r\n\r\nYou can also use `npm install https://github.com/ctalkington/node-crc32-stream/archive/master.tar.gz` to test upcoming versions.\r\n\r\n### Usage\r\n\r\n```js\r\nvar CRC32Stream = require('crc32-stream');\r\n\r\nvar source = fs.createReadStream('file.txt');\r\nvar checksum = new CRC32Stream();\r\n\r\nchecksum.on('end', function(err) {\r\n // do something with checksum.digest() here\r\n});\r\n\r\n// either pipe it\r\nsource.pipe(checksum);\r\n\r\n// or write it\r\nchecksum.write('string');\r\nchecksum.end();\r\n```\r\n\r\n### Instance API\r\n\r\nInherits [Transform Stream](http://nodejs.org/api/stream.html#stream_class_stream_transform) methods.\r\n\r\n#### digest()\r\n\r\nReturns the checksum digest in unsigned form.\r\n\r\n#### hex()\r\n\r\nReturns the hexadecimal representation of the checksum digest. (ie E81722F0)\r\n\r\n#### size()\r\n\r\nReturns the raw size/length of passed-through data.\r\n\r\n### Instance Options\r\n\r\nInherits [Transform Stream](http://nodejs.org/api/stream.html#stream_class_stream_transform) options.\r\n\r\n## Things of Interest\r\n\r\n- [Changelog](https://github.com/ctalkington/node-crc32-stream/releases)\r\n- [Contributing](https://github.com/ctalkington/node-crc32-stream/blob/master/CONTRIBUTING.md)\r\n- [MIT License](https://github.com/ctalkington/node-crc32-stream/blob/master/LICENSE-MIT)",
- "readmeFilename": "README.md",
- "_id": "crc32-stream@0.2.0",
- "dist": {
- "shasum": "77d25e11ccbcb492ce9dd7a794ac1398dbc87bac"
- },
- "_from": "crc32-stream@~0.2.0",
- "_resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-0.2.0.tgz"
-}
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/test/checksum.js b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/test/checksum.js
deleted file mode 100644
index 967fa92b..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/test/checksum.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/*global before,describe,it */
-var assert = require('chai').assert;
-
-var helpers = require('./helpers');
-var BinaryStream = helpers.BinaryStream;
-var DeadEndStream = helpers.DeadEndStream;
-
-var CRC32Stream = require('../lib/crc32-stream.js');
-
-describe('CRC32Stream', function() {
- it('should checksum data while passing through data', function(done) {
- var binary = new BinaryStream(1024 * 16);
- var checksum = new CRC32Stream();
- var deadend = new DeadEndStream();
-
- checksum.on('end', function() {
- assert.equal(checksum.digest(), 3893830384);
- assert.equal(checksum.hex(), 'E81722F0');
- assert.equal(checksum.size(), 16384);
- done();
- });
-
- checksum.pipe(deadend);
- binary.pipe(checksum);
- });
-
- it('should gracefully handle having no data chunks passed to it', function(done) {
- var checksum = new CRC32Stream();
- var deadend = new DeadEndStream();
-
- checksum.on('end', function() {
- assert.equal(checksum.digest(), 0);
- done();
- });
-
- checksum.pipe(deadend);
- checksum.end();
- });
-});
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/test/helpers/index.js b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/test/helpers/index.js
deleted file mode 100644
index 84f4ded2..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/crc32-stream/test/helpers/index.js
+++ /dev/null
@@ -1,93 +0,0 @@
-var crypto = require('crypto');
-var fs = require('fs');
-var inherits = require('util').inherits;
-
-var Stream = require('stream').Stream;
-var Readable = require('readable-stream').Readable;
-var Writable = require('readable-stream').Writable;
-
-function adjustDateByOffset(d, offset) {
- d = (d instanceof Date) ? d : new Date();
-
- if (offset >= 1) {
- d.setMinutes(d.getMinutes() - offset);
- } else {
- d.setMinutes(d.getMinutes() + Math.abs(offset));
- }
-
- return d;
-}
-
-module.exports.adjustDateByOffset = adjustDateByOffset;
-
-function binaryBuffer(n) {
- var buffer = new Buffer(n);
-
- for (var i = 0; i < n; i++) {
- buffer.writeUInt8(i&255, i);
- }
-
- return buffer;
-}
-
-module.exports.binaryBuffer = binaryBuffer;
-
-function BinaryStream(size, options) {
- Readable.call(this, options);
-
- var buf = new Buffer(size);
-
- for (var i = 0; i < size; i++) {
- buf.writeUInt8(i&255, i);
- }
-
- this.push(buf);
- this.push(null);
-}
-
-inherits(BinaryStream, Readable);
-
-BinaryStream.prototype._read = function(size) {};
-
-module.exports.BinaryStream = BinaryStream;
-
-function DeadEndStream(options) {
- Writable.call(this, options);
-}
-
-inherits(DeadEndStream, Writable);
-
-DeadEndStream.prototype._write = function(chuck, encoding, callback) {
- callback();
-};
-
-module.exports.DeadEndStream = DeadEndStream;
-
-function fileBuffer(filepath) {
- return fs.readFileSync(filepath);
-}
-
-module.exports.fileBuffer = fileBuffer;
-
-function WriteHashStream(path, options) {
- fs.WriteStream.call(this, path, options);
-
- this.hash = crypto.createHash('sha1');
- this.digest = null;
-
- this.on('close', function() {
- this.digest = this.hash.digest('hex');
- });
-}
-
-inherits(WriteHashStream, fs.WriteStream);
-
-WriteHashStream.prototype.write = function(chunk) {
- if (chunk) {
- this.hash.update(chunk);
- }
-
- return fs.WriteStream.prototype.write.call(this, chunk);
-};
-
-module.exports.WriteHashStream = WriteHashStream;
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/.jshintrc b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/.jshintrc
deleted file mode 100644
index 299877f2..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/.jshintrc
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "laxbreak": true
-}
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/.npmignore b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/.npmignore
deleted file mode 100644
index 7e6163db..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/.npmignore
+++ /dev/null
@@ -1,6 +0,0 @@
-support
-test
-examples
-example
-*.sock
-dist
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/History.md b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/History.md
deleted file mode 100644
index 3b965608..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/History.md
+++ /dev/null
@@ -1,144 +0,0 @@
-
-1.0.4 / 2014-07-15
-==================
-
- * dist: recompile
- * example: remove `console.info()` log usage
- * example: add "Content-Type" UTF-8 header to browser example
- * browser: place %c marker after the space character
- * browser: reset the "content" color via `color: inherit`
- * browser: add colors support for Firefox >= v31
- * debug: prefer an instance `log()` function over the global one (#119)
- * Readme: update documentation about styled console logs for FF v31 (#116, @wryk)
-
-1.0.3 / 2014-07-09
-==================
-
- * Add support for multiple wildcards in namespaces (#122, @seegno)
- * browser: fix lint
-
-1.0.2 / 2014-06-10
-==================
-
- * browser: update color palette (#113, @gscottolson)
- * common: make console logging function configurable (#108, @timoxley)
- * node: fix %o colors on old node <= 0.8.x
- * Makefile: find node path using shell/which (#109, @timoxley)
-
-1.0.1 / 2014-06-06
-==================
-
- * browser: use `removeItem()` to clear localStorage
- * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777)
- * package: add "contributors" section
- * node: fix comment typo
- * README: list authors
-
-1.0.0 / 2014-06-04
-==================
-
- * make ms diff be global, not be scope
- * debug: ignore empty strings in enable()
- * node: make DEBUG_COLORS able to disable coloring
- * *: export the `colors` array
- * npmignore: don't publish the `dist` dir
- * Makefile: refactor to use browserify
- * package: add "browserify" as a dev dependency
- * Readme: add Web Inspector Colors section
- * node: reset terminal color for the debug content
- * node: map "%o" to `util.inspect()`
- * browser: map "%j" to `JSON.stringify()`
- * debug: add custom "formatters"
- * debug: use "ms" module for humanizing the diff
- * Readme: add "bash" syntax highlighting
- * browser: add Firebug color support
- * browser: add colors for WebKit browsers
- * node: apply log to `console`
- * rewrite: abstract common logic for Node & browsers
- * add .jshintrc file
-
-0.8.1 / 2014-04-14
-==================
-
- * package: re-add the "component" section
-
-0.8.0 / 2014-03-30
-==================
-
- * add `enable()` method for nodejs. Closes #27
- * change from stderr to stdout
- * remove unnecessary index.js file
-
-0.7.4 / 2013-11-13
-==================
-
- * remove "browserify" key from package.json (fixes something in browserify)
-
-0.7.3 / 2013-10-30
-==================
-
- * fix: catch localStorage security error when cookies are blocked (Chrome)
- * add debug(err) support. Closes #46
- * add .browser prop to package.json. Closes #42
-
-0.7.2 / 2013-02-06
-==================
-
- * fix package.json
- * fix: Mobile Safari (private mode) is broken with debug
- * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript
-
-0.7.1 / 2013-02-05
-==================
-
- * add repository URL to package.json
- * add DEBUG_COLORED to force colored output
- * add browserify support
- * fix component. Closes #24
-
-0.7.0 / 2012-05-04
-==================
-
- * Added .component to package.json
- * Added debug.component.js build
-
-0.6.0 / 2012-03-16
-==================
-
- * Added support for "-" prefix in DEBUG [Vinay Pulim]
- * Added `.enabled` flag to the node version [TooTallNate]
-
-0.5.0 / 2012-02-02
-==================
-
- * Added: humanize diffs. Closes #8
- * Added `debug.disable()` to the CS variant
- * Removed padding. Closes #10
- * Fixed: persist client-side variant again. Closes #9
-
-0.4.0 / 2012-02-01
-==================
-
- * Added browser variant support for older browsers [TooTallNate]
- * Added `debug.enable('project:*')` to browser variant [TooTallNate]
- * Added padding to diff (moved it to the right)
-
-0.3.0 / 2012-01-26
-==================
-
- * Added millisecond diff when isatty, otherwise UTC string
-
-0.2.0 / 2012-01-22
-==================
-
- * Added wildcard support
-
-0.1.0 / 2011-12-02
-==================
-
- * Added: remove colors unless stderr isatty [TooTallNate]
-
-0.0.1 / 2010-01-03
-==================
-
- * Initial release
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/Makefile b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/Makefile
deleted file mode 100644
index b0bde6e6..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/Makefile
+++ /dev/null
@@ -1,33 +0,0 @@
-
-# get Makefile directory name: http://stackoverflow.com/a/5982798/376773
-THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
-THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)
-
-# BIN directory
-BIN := $(THIS_DIR)/node_modules/.bin
-
-# applications
-NODE ?= $(shell which node)
-NPM ?= $(NODE) $(shell which npm)
-BROWSERIFY ?= $(NODE) $(BIN)/browserify
-
-all: dist/debug.js
-
-install: node_modules
-
-clean:
- @rm -rf node_modules dist
-
-dist:
- @mkdir -p $@
-
-dist/debug.js: node_modules browser.js debug.js dist
- @$(BROWSERIFY) \
- --standalone debug \
- . > $@
-
-node_modules: package.json
- @NODE_ENV= $(NPM) install
- @touch node_modules
-
-.PHONY: all install clean
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/Readme.md b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/Readme.md
deleted file mode 100644
index e59b9ada..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/Readme.md
+++ /dev/null
@@ -1,156 +0,0 @@
-# debug
-
- tiny node.js debugging utility modelled after node core's debugging technique.
-
-## Installation
-
-```bash
-$ npm install debug
-```
-
-## Usage
-
- With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility.
-
-Example _app.js_:
-
-```js
-var debug = require('debug')('http')
- , http = require('http')
- , name = 'My App';
-
-// fake app
-
-debug('booting %s', name);
-
-http.createServer(function(req, res){
- debug(req.method + ' ' + req.url);
- res.end('hello\n');
-}).listen(3000, function(){
- debug('listening');
-});
-
-// fake worker of some kind
-
-require('./worker');
-```
-
-Example _worker.js_:
-
-```js
-var debug = require('debug')('worker');
-
-setInterval(function(){
- debug('doing some work');
-}, 1000);
-```
-
- The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:
-
- 
-
- 
-
-## Millisecond diff
-
- When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
-
- 
-
- When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:
-
- 
-
-## Conventions
-
- If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser".
-
-## Wildcards
-
- The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
-
- You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:".
-
-## Browser support
-
- Debug works in the browser as well, currently persisted by `localStorage`. For example if you have `worker:a` and `worker:b` as shown below, and wish to debug both type `debug.enable('worker:*')` in the console and refresh the page, this will remain until you disable with `debug.disable()`.
-
-```js
-a = debug('worker:a');
-b = debug('worker:b');
-
-setInterval(function(){
- a('doing some work');
-}, 1000);
-
-setInterval(function(){
- b('doing some work');
-}, 1200);
-```
-
-#### Web Inspector Colors
-
- Colors are also enabled on "Web Inspectors" that understand the `%c` formatting
- option. These are WebKit web inspectors, Firefox ([since version
- 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))
- and the Firebug plugin for Firefox (any version).
-
- Colored output looks something like:
-
- 
-
-### stderr vs stdout
-
-You can set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally:
-
-Example _stderr.js_:
-
-```js
-var debug = require('../');
-var log = debug('app:log');
-
-// by default console.log is used
-log('goes to stdout!');
-
-var error = debug('app:error');
-// set this namespace to log via console.error
-error.log = console.error.bind(console); // don't forget to bind to console!
-error('goes to stderr');
-log('still goes to stdout!');
-
-// set all output to go via console.warn
-// overrides all per-namespace log settings
-debug.log = console.warn.bind(console);
-log('now goes to stderr via console.warn');
-error('still goes to stderr, but via console.warn now');
-```
-
-## Authors
-
- - TJ Holowaychuk
- - Nathan Rajlich
-
-## License
-
-(The MIT License)
-
-Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca>
-
-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.
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/browser.js b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/browser.js
deleted file mode 100644
index ce6369f1..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/browser.js
+++ /dev/null
@@ -1,147 +0,0 @@
-
-/**
- * This is the web browser implementation of `debug()`.
- *
- * Expose `debug()` as the module.
- */
-
-exports = module.exports = require('./debug');
-exports.log = log;
-exports.formatArgs = formatArgs;
-exports.save = save;
-exports.load = load;
-exports.useColors = useColors;
-
-/**
- * Colors.
- */
-
-exports.colors = [
- 'lightseagreen',
- 'forestgreen',
- 'goldenrod',
- 'dodgerblue',
- 'darkorchid',
- 'crimson'
-];
-
-/**
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
- * and the Firebug extension (any Firefox version) are known
- * to support "%c" CSS customizations.
- *
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
- */
-
-function useColors() {
- // is webkit? http://stackoverflow.com/a/16459606/376773
- return ('WebkitAppearance' in document.documentElement.style) ||
- // is firebug? http://stackoverflow.com/a/398120/376773
- (window.console && (console.firebug || (console.exception && console.table))) ||
- // is firefox >= v31?
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
- (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31);
-}
-
-/**
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
- */
-
-exports.formatters.j = function(v) {
- return JSON.stringify(v);
-};
-
-
-/**
- * Colorize log arguments if enabled.
- *
- * @api public
- */
-
-function formatArgs() {
- var args = arguments;
- var useColors = this.useColors;
-
- args[0] = (useColors ? '%c' : '')
- + this.namespace
- + (useColors ? ' %c' : ' ')
- + args[0]
- + (useColors ? '%c ' : ' ')
- + '+' + exports.humanize(this.diff);
-
- if (!useColors) return args;
-
- var c = 'color: ' + this.color;
- args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));
-
- // the final "%c" is somewhat tricky, because there could be other
- // arguments passed either before or after the %c, so we need to
- // figure out the correct index to insert the CSS into
- var index = 0;
- var lastC = 0;
- args[0].replace(/%[a-z%]/g, function(match) {
- if ('%%' === match) return;
- index++;
- if ('%c' === match) {
- // we only are interested in the *last* %c
- // (the user may have provided their own)
- lastC = index;
- }
- });
-
- args.splice(lastC, 0, c);
- return args;
-}
-
-/**
- * Invokes `console.log()` when available.
- * No-op when `console.log` is not a "function".
- *
- * @api public
- */
-
-function log() {
- // This hackery is required for IE8,
- // where the `console.log` function doesn't have 'apply'
- return 'object' == typeof console
- && 'function' == typeof console.log
- && Function.prototype.apply.call(console.log, console, arguments);
-}
-
-/**
- * Save `namespaces`.
- *
- * @param {String} namespaces
- * @api private
- */
-
-function save(namespaces) {
- try {
- if (null == namespaces) {
- localStorage.removeItem('debug');
- } else {
- localStorage.debug = namespaces;
- }
- } catch(e) {}
-}
-
-/**
- * Load `namespaces`.
- *
- * @return {String} returns the previously persisted debug modes
- * @api private
- */
-
-function load() {
- var r;
- try {
- r = localStorage.debug;
- } catch(e) {}
- return r;
-}
-
-/**
- * Enable namespaces listed in `localStorage.debug` initially.
- */
-
-exports.enable(load());
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/component.json b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/component.json
deleted file mode 100644
index ab5f3eee..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/component.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "name": "debug",
- "repo": "visionmedia/debug",
- "description": "small debugging utility",
- "version": "1.0.4",
- "keywords": [
- "debug",
- "log",
- "debugger"
- ],
- "main": "browser.js",
- "scripts": [
- "browser.js",
- "debug.js"
- ],
- "dependencies": {
- "guille/ms.js": "0.6.1"
- }
-}
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/debug.js b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/debug.js
deleted file mode 100644
index 7571a860..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/debug.js
+++ /dev/null
@@ -1,197 +0,0 @@
-
-/**
- * This is the common logic for both the Node.js and web browser
- * implementations of `debug()`.
- *
- * Expose `debug()` as the module.
- */
-
-exports = module.exports = debug;
-exports.coerce = coerce;
-exports.disable = disable;
-exports.enable = enable;
-exports.enabled = enabled;
-exports.humanize = require('ms');
-
-/**
- * The currently active debug mode names, and names to skip.
- */
-
-exports.names = [];
-exports.skips = [];
-
-/**
- * Map of special "%n" handling functions, for the debug "format" argument.
- *
- * Valid key names are a single, lowercased letter, i.e. "n".
- */
-
-exports.formatters = {};
-
-/**
- * Previously assigned color.
- */
-
-var prevColor = 0;
-
-/**
- * Previous log timestamp.
- */
-
-var prevTime;
-
-/**
- * Select a color.
- *
- * @return {Number}
- * @api private
- */
-
-function selectColor() {
- return exports.colors[prevColor++ % exports.colors.length];
-}
-
-/**
- * Create a debugger with the given `namespace`.
- *
- * @param {String} namespace
- * @return {Function}
- * @api public
- */
-
-function debug(namespace) {
-
- // define the `disabled` version
- function disabled() {
- }
- disabled.enabled = false;
-
- // define the `enabled` version
- function enabled() {
-
- var self = enabled;
-
- // set `diff` timestamp
- var curr = +new Date();
- var ms = curr - (prevTime || curr);
- self.diff = ms;
- self.prev = prevTime;
- self.curr = curr;
- prevTime = curr;
-
- // add the `color` if not set
- if (null == self.useColors) self.useColors = exports.useColors();
- if (null == self.color && self.useColors) self.color = selectColor();
-
- var args = Array.prototype.slice.call(arguments);
-
- args[0] = exports.coerce(args[0]);
-
- if ('string' !== typeof args[0]) {
- // anything else let's inspect with %o
- args = ['%o'].concat(args);
- }
-
- // apply any `formatters` transformations
- var index = 0;
- args[0] = args[0].replace(/%([a-z%])/g, function(match, format) {
- // if we encounter an escaped % then don't increase the array index
- if (match === '%%') return match;
- index++;
- var formatter = exports.formatters[format];
- if ('function' === typeof formatter) {
- var val = args[index];
- match = formatter.call(self, val);
-
- // now we need to remove `args[index]` since it's inlined in the `format`
- args.splice(index, 1);
- index--;
- }
- return match;
- });
-
- if ('function' === typeof exports.formatArgs) {
- args = exports.formatArgs.apply(self, args);
- }
- var logFn = enabled.log || exports.log || console.log.bind(console);
- logFn.apply(self, args);
- }
- enabled.enabled = true;
-
- var fn = exports.enabled(namespace) ? enabled : disabled;
-
- fn.namespace = namespace;
-
- return fn;
-}
-
-/**
- * Enables a debug mode by namespaces. This can include modes
- * separated by a colon and wildcards.
- *
- * @param {String} namespaces
- * @api public
- */
-
-function enable(namespaces) {
- exports.save(namespaces);
-
- var split = (namespaces || '').split(/[\s,]+/);
- var len = split.length;
-
- for (var i = 0; i < len; i++) {
- if (!split[i]) continue; // ignore empty strings
- namespaces = split[i].replace(/\*/g, '.*?');
- if (namespaces[0] === '-') {
- exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
- } else {
- exports.names.push(new RegExp('^' + namespaces + '$'));
- }
- }
-}
-
-/**
- * Disable debug output.
- *
- * @api public
- */
-
-function disable() {
- exports.enable('');
-}
-
-/**
- * Returns true if the given mode name is enabled, false otherwise.
- *
- * @param {String} name
- * @return {Boolean}
- * @api public
- */
-
-function enabled(name) {
- var i, len;
- for (i = 0, len = exports.skips.length; i < len; i++) {
- if (exports.skips[i].test(name)) {
- return false;
- }
- }
- for (i = 0, len = exports.names.length; i < len; i++) {
- if (exports.names[i].test(name)) {
- return true;
- }
- }
- return false;
-}
-
-/**
- * Coerce `val`.
- *
- * @param {Mixed} val
- * @return {Mixed}
- * @api private
- */
-
-function coerce(val) {
- if (val instanceof Error) return val.stack || val.message;
- return val;
-}
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/node.js b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/node.js
deleted file mode 100644
index c94f7d12..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/node.js
+++ /dev/null
@@ -1,129 +0,0 @@
-
-/**
- * Module dependencies.
- */
-
-var tty = require('tty');
-var util = require('util');
-
-/**
- * This is the Node.js implementation of `debug()`.
- *
- * Expose `debug()` as the module.
- */
-
-exports = module.exports = require('./debug');
-exports.log = log;
-exports.formatArgs = formatArgs;
-exports.save = save;
-exports.load = load;
-exports.useColors = useColors;
-
-/**
- * Colors.
- */
-
-exports.colors = [6, 2, 3, 4, 5, 1];
-
-/**
- * Is stdout a TTY? Colored output is enabled when `true`.
- */
-
-function useColors() {
- var debugColors = (process.env.DEBUG_COLORS || '').trim().toLowerCase();
- if (0 === debugColors.length) {
- return tty.isatty(1);
- } else {
- return '0' !== debugColors
- && 'no' !== debugColors
- && 'false' !== debugColors
- && 'disabled' !== debugColors;
- }
-}
-
-/**
- * Map %o to `util.inspect()`, since Node doesn't do that out of the box.
- */
-
-var inspect = (4 === util.inspect.length ?
- // node <= 0.8.x
- function (v, colors) {
- return util.inspect(v, void 0, void 0, colors);
- } :
- // node > 0.8.x
- function (v, colors) {
- return util.inspect(v, { colors: colors });
- }
-);
-
-exports.formatters.o = function(v) {
- return inspect(v, this.useColors)
- .replace(/\s*\n\s*/g, ' ');
-};
-
-/**
- * Adds ANSI color escape codes if enabled.
- *
- * @api public
- */
-
-function formatArgs() {
- var args = arguments;
- var useColors = this.useColors;
- var name = this.namespace;
-
- if (useColors) {
- var c = this.color;
-
- args[0] = ' \u001b[9' + c + 'm' + name + ' '
- + '\u001b[0m'
- + args[0] + '\u001b[3' + c + 'm'
- + ' +' + exports.humanize(this.diff) + '\u001b[0m';
- } else {
- args[0] = new Date().toUTCString()
- + ' ' + name + ' ' + args[0];
- }
- return args;
-}
-
-/**
- * Invokes `console.log()` with the specified arguments.
- */
-
-function log() {
- return console.log.apply(console, arguments);
-}
-
-/**
- * Save `namespaces`.
- *
- * @param {String} namespaces
- * @api private
- */
-
-function save(namespaces) {
- if (null == namespaces) {
- // If you set a process.env field to null or undefined, it gets cast to the
- // string 'null' or 'undefined'. Just delete instead.
- delete process.env.DEBUG;
- } else {
- process.env.DEBUG = namespaces;
- }
-}
-
-/**
- * Load `namespaces`.
- *
- * @return {String} returns the previously persisted debug modes
- * @api private
- */
-
-function load() {
- return process.env.DEBUG;
-}
-
-/**
- * Enable namespaces listed in `process.env.DEBUG` initially.
- */
-
-exports.enable(load());
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/node_modules/ms/.npmignore b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/node_modules/ms/.npmignore
deleted file mode 100644
index d1aa0ce4..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/node_modules/ms/.npmignore
+++ /dev/null
@@ -1,5 +0,0 @@
-node_modules
-test
-History.md
-Makefile
-component.json
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/node_modules/ms/README.md b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/node_modules/ms/README.md
deleted file mode 100644
index d4ab12a7..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/node_modules/ms/README.md
+++ /dev/null
@@ -1,33 +0,0 @@
-# ms.js: miliseconds conversion utility
-
-```js
-ms('1d') // 86400000
-ms('10h') // 36000000
-ms('2h') // 7200000
-ms('1m') // 60000
-ms('5s') // 5000
-ms('100') // 100
-```
-
-```js
-ms(60000) // "1m"
-ms(2 * 60000) // "2m"
-ms(ms('10 hours')) // "10h"
-```
-
-```js
-ms(60000, { long: true }) // "1 minute"
-ms(2 * 60000, { long: true }) // "2 minutes"
-ms(ms('10 hours', { long: true })) // "10 hours"
-```
-
-- Node/Browser compatible. Published as `ms` in NPM.
-- If a number is supplied to `ms`, a string with a unit is returned.
-- If a string that contains the number is supplied, it returns it as
-a number (e.g: it returns `100` for `'100'`).
-- If you pass a string with a number and a valid unit, the number of
-equivalent ms is returned.
-
-## License
-
-MIT
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/node_modules/ms/index.js b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/node_modules/ms/index.js
deleted file mode 100644
index c5847f8d..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/node_modules/ms/index.js
+++ /dev/null
@@ -1,111 +0,0 @@
-/**
- * Helpers.
- */
-
-var s = 1000;
-var m = s * 60;
-var h = m * 60;
-var d = h * 24;
-var y = d * 365.25;
-
-/**
- * Parse or format the given `val`.
- *
- * Options:
- *
- * - `long` verbose formatting [false]
- *
- * @param {String|Number} val
- * @param {Object} options
- * @return {String|Number}
- * @api public
- */
-
-module.exports = function(val, options){
- options = options || {};
- if ('string' == typeof val) return parse(val);
- return options.long
- ? long(val)
- : short(val);
-};
-
-/**
- * Parse the given `str` and return milliseconds.
- *
- * @param {String} str
- * @return {Number}
- * @api private
- */
-
-function parse(str) {
- var match = /^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(str);
- if (!match) return;
- var n = parseFloat(match[1]);
- var type = (match[2] || 'ms').toLowerCase();
- switch (type) {
- case 'years':
- case 'year':
- case 'y':
- return n * y;
- case 'days':
- case 'day':
- case 'd':
- return n * d;
- case 'hours':
- case 'hour':
- case 'h':
- return n * h;
- case 'minutes':
- case 'minute':
- case 'm':
- return n * m;
- case 'seconds':
- case 'second':
- case 's':
- return n * s;
- case 'ms':
- return n;
- }
-}
-
-/**
- * Short format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
- */
-
-function short(ms) {
- if (ms >= d) return Math.round(ms / d) + 'd';
- if (ms >= h) return Math.round(ms / h) + 'h';
- if (ms >= m) return Math.round(ms / m) + 'm';
- if (ms >= s) return Math.round(ms / s) + 's';
- return ms + 'ms';
-}
-
-/**
- * Long format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
- */
-
-function long(ms) {
- return plural(ms, d, 'day')
- || plural(ms, h, 'hour')
- || plural(ms, m, 'minute')
- || plural(ms, s, 'second')
- || ms + ' ms';
-}
-
-/**
- * Pluralization helper.
- */
-
-function plural(ms, n, name) {
- if (ms < n) return;
- if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name;
- return Math.ceil(ms / n) + ' ' + name + 's';
-}
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/node_modules/ms/package.json b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/node_modules/ms/package.json
deleted file mode 100644
index 589027e4..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/node_modules/ms/package.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "name": "ms",
- "version": "0.6.2",
- "description": "Tiny ms conversion utility",
- "repository": {
- "type": "git",
- "url": "git://github.com/guille/ms.js.git"
- },
- "main": "./index",
- "devDependencies": {
- "mocha": "*",
- "expect.js": "*",
- "serve": "*"
- },
- "component": {
- "scripts": {
- "ms/index.js": "index.js"
- }
- },
- "readme": "# ms.js: miliseconds conversion utility\n\n```js\nms('1d') // 86400000\nms('10h') // 36000000\nms('2h') // 7200000\nms('1m') // 60000\nms('5s') // 5000\nms('100') // 100\n```\n\n```js\nms(60000) // \"1m\"\nms(2 * 60000) // \"2m\"\nms(ms('10 hours')) // \"10h\"\n```\n\n```js\nms(60000, { long: true }) // \"1 minute\"\nms(2 * 60000, { long: true }) // \"2 minutes\"\nms(ms('10 hours', { long: true })) // \"10 hours\"\n```\n\n- Node/Browser compatible. Published as `ms` in NPM.\n- If a number is supplied to `ms`, a string with a unit is returned.\n- If a string that contains the number is supplied, it returns it as\na number (e.g: it returns `100` for `'100'`).\n- If you pass a string with a number and a valid unit, the number of\nequivalent ms is returned.\n\n## License\n\nMIT",
- "readmeFilename": "README.md",
- "bugs": {
- "url": "https://github.com/guille/ms.js/issues"
- },
- "homepage": "https://github.com/guille/ms.js",
- "_id": "ms@0.6.2",
- "dist": {
- "shasum": "0e548127e2b433c846c7dc010d2f7d67b6135bd5"
- },
- "_from": "ms@0.6.2",
- "_resolved": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz"
-}
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/package.json b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/package.json
deleted file mode 100644
index 443d7261..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/debug/package.json
+++ /dev/null
@@ -1,52 +0,0 @@
-{
- "name": "debug",
- "version": "1.0.4",
- "repository": {
- "type": "git",
- "url": "git://github.com/visionmedia/debug.git"
- },
- "description": "small debugging utility",
- "keywords": [
- "debug",
- "log",
- "debugger"
- ],
- "author": {
- "name": "TJ Holowaychuk",
- "email": "tj@vision-media.ca"
- },
- "contributors": [
- {
- "name": "Nathan Rajlich",
- "email": "nathan@tootallnate.net",
- "url": "http://n8.io"
- }
- ],
- "dependencies": {
- "ms": "0.6.2"
- },
- "devDependencies": {
- "browserify": "4.1.6",
- "mocha": "*"
- },
- "main": "./node.js",
- "browser": "./browser.js",
- "component": {
- "scripts": {
- "debug/index.js": "browser.js",
- "debug/debug.js": "debug.js"
- }
- },
- "readme": "# debug\n\n tiny node.js debugging utility modelled after node core's debugging technique.\n\n## Installation\n\n```bash\n$ npm install debug\n```\n\n## Usage\n\n With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility.\n\nExample _app.js_:\n\n```js\nvar debug = require('debug')('http')\n , http = require('http')\n , name = 'My App';\n\n// fake app\n\ndebug('booting %s', name);\n\nhttp.createServer(function(req, res){\n debug(req.method + ' ' + req.url);\n res.end('hello\\n');\n}).listen(3000, function(){\n debug('listening');\n});\n\n// fake worker of some kind\n\nrequire('./worker');\n```\n\nExample _worker.js_:\n\n```js\nvar debug = require('debug')('worker');\n\nsetInterval(function(){\n debug('doing some work');\n}, 1000);\n```\n\n The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:\n\n \n\n \n\n## Millisecond diff\n\n When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the \"+NNNms\" will show you how much time was spent between calls.\n\n \n\n When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:\n\n \n\n## Conventions\n\n If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use \":\" to separate features. For example \"bodyParser\" from Connect would then be \"connect:bodyParser\".\n\n## Wildcards\n\n The `*` character may be used as a wildcard. Suppose for example your library has debuggers named \"connect:bodyParser\", \"connect:compress\", \"connect:session\", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.\n\n You can also exclude specific debuggers by prefixing them with a \"-\" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with \"connect:\".\n\n## Browser support\n\n Debug works in the browser as well, currently persisted by `localStorage`. For example if you have `worker:a` and `worker:b` as shown below, and wish to debug both type `debug.enable('worker:*')` in the console and refresh the page, this will remain until you disable with `debug.disable()`.\n\n```js\na = debug('worker:a');\nb = debug('worker:b');\n\nsetInterval(function(){\n a('doing some work');\n}, 1000);\n\nsetInterval(function(){\n b('doing some work');\n}, 1200);\n```\n\n#### Web Inspector Colors\n\n Colors are also enabled on \"Web Inspectors\" that understand the `%c` formatting\n option. These are WebKit web inspectors, Firefox ([since version\n 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))\n and the Firebug plugin for Firefox (any version).\n\n Colored output looks something like:\n\n \n\n### stderr vs stdout\n\nYou can set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally:\n\nExample _stderr.js_:\n\n```js\nvar debug = require('../');\nvar log = debug('app:log');\n\n// by default console.log is used\nlog('goes to stdout!');\n\nvar error = debug('app:error');\n// set this namespace to log via console.error\nerror.log = console.error.bind(console); // don't forget to bind to console!\nerror('goes to stderr');\nlog('still goes to stdout!');\n\n// set all output to go via console.warn\n// overrides all per-namespace log settings\ndebug.log = console.warn.bind(console);\nlog('now goes to stderr via console.warn');\nerror('still goes to stderr, but via console.warn now');\n```\n\n## Authors\n\n - TJ Holowaychuk\n - Nathan Rajlich\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",
- "readmeFilename": "Readme.md",
- "bugs": {
- "url": "https://github.com/visionmedia/debug/issues"
- },
- "homepage": "https://github.com/visionmedia/debug",
- "_id": "debug@1.0.4",
- "dist": {
- "shasum": "980714316c81aa97c175a673ed22950582b80859"
- },
- "_from": "debug@~1.0.2",
- "_resolved": "https://registry.npmjs.org/debug/-/debug-1.0.4.tgz"
-}
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/deflate-crc32-stream/LICENSE-MIT b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/deflate-crc32-stream/LICENSE-MIT
deleted file mode 100644
index 56420a6a..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/deflate-crc32-stream/LICENSE-MIT
+++ /dev/null
@@ -1,22 +0,0 @@
-Copyright (c) 2014 Chris Talkington, 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.
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/deflate-crc32-stream/README.md b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/deflate-crc32-stream/README.md
deleted file mode 100644
index 740675bd..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/deflate-crc32-stream/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-# deflate-crc32-stream v0.1.0 [](https://travis-ci.org/ctalkington/node-deflate-crc32-stream)
-
-deflate-crc32-stream is a streaming deflater with CRC32 checksumer. It uses [buffer-crc32](https://www.npmjs.org/package/buffer-crc32) behind the scenes to reliably handle binary data and fancy character sets. Data comes through compressed with [zlib.DeflateRaw](http://nodejs.org/api/zlib.html#zlib_class_zlib_deflateraw).
-
-[](https://nodei.co/npm/deflate-crc32-stream/)
-
-### Install
-
-```bash
-npm install deflate-crc32-stream --save
-```
-
-You can also use `npm install https://github.com/ctalkington/node-deflate-crc32-stream/archive/master.tar.gz` to test upcoming versions.
-
-### Usage
-
-```js
-var CRC32Stream = require('deflate-crc32-stream');
-
-var source = fs.createReadStream('file.txt');
-var deflate = new DeflateCRC32Stream();
-
-deflate.on('end', function(err) {
- // do something with deflate.digest() here
-});
-
-// either pipe it
-source.pipe(deflate);
-
-// or write it
-deflate.write('string');
-deflate.end();
-```
-
-### Instance API
-
-Inherits [zlib.DeflateRaw](http://nodejs.org/api/zlib.html#zlib_class_zlib_deflateraw) methods.
-
-#### digest()
-
-Returns the checksum digest in unsigned form.
-
-#### hex()
-
-Returns the hexadecimal representation of the checksum digest. (ie E81722F0)
-
-#### size(compressed)
-
-Returns the raw uncompressed size/length of passed-through data.
-
-If `compressed` is `true`, it returns compressed length instead.
-
-### Instance Options
-
-Inherits [zlib.DeflateRaw](http://nodejs.org/api/zlib.html#zlib_class_zlib_deflateraw) options.
-
-## Things of Interest
-
-- [Changelog](https://github.com/ctalkington/node-deflate-crc32-stream/releases)
-- [Contributing](https://github.com/ctalkington/node-deflate-crc32-stream/blob/master/CONTRIBUTING.md)
-- [MIT License](https://github.com/ctalkington/node-deflate-crc32-stream/blob/master/LICENSE-MIT)
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/deflate-crc32-stream/lib/deflate-crc32-stream.js b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/deflate-crc32-stream/lib/deflate-crc32-stream.js
deleted file mode 100644
index d467dada..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/deflate-crc32-stream/lib/deflate-crc32-stream.js
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * node-deflate-crc32-stream
- *
- * Copyright (c) 2014 Chris Talkington, contributors.
- * Licensed under the MIT license.
- * https://github.com/ctalkington/node-deflate-crc32-stream/blob/master/LICENSE-MIT
- */
-var zlib = require('zlib');
-var inherits = require('util').inherits;
-
-var crc32 = require('buffer-crc32');
-
-function DeflateCRC32Stream(options) {
- zlib.DeflateRaw.call(this, options);
-
- this.checksum = new Buffer(4);
- this.checksum.writeInt32BE(0, 0);
-
- this.rawSize = 0;
- this.compressedSize = 0;
-
- // BC v0.8
- if (typeof zlib.DeflateRaw.prototype.push !== 'function') {
- this.on('data', function(chunk) {
- if (chunk) {
- this.compressedSize += chunk.length;
- }
- });
- }
-}
-
-inherits(DeflateCRC32Stream, zlib.DeflateRaw);
-
-DeflateCRC32Stream.prototype.push = function(chunk, encoding) {
- if (chunk) {
- this.compressedSize += chunk.length;
- }
-
- return zlib.DeflateRaw.prototype.push.call(this, chunk, encoding);
-};
-
-DeflateCRC32Stream.prototype.write = function(chunk, cb) {
- if (chunk) {
- this.checksum = crc32(chunk, this.checksum);
- this.rawSize += chunk.length;
- }
-
- return zlib.DeflateRaw.prototype.write.call(this, chunk, cb);
-};
-
-DeflateCRC32Stream.prototype.digest = function() {
- return crc32.unsigned(0, this.checksum);
-};
-
-DeflateCRC32Stream.prototype.hex = function() {
- return this.digest().toString(16).toUpperCase();
-};
-
-DeflateCRC32Stream.prototype.size = function(compressed) {
- compressed = compressed || false;
-
- if (compressed) {
- return this.compressedSize;
- } else {
- return this.rawSize;
- }
-};
-
-module.exports = DeflateCRC32Stream;
\ No newline at end of file
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/deflate-crc32-stream/package.json b/builder/node_modules/archiver/node_modules/zip-stream/node_modules/deflate-crc32-stream/package.json
deleted file mode 100644
index 0fe77826..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/node_modules/deflate-crc32-stream/package.json
+++ /dev/null
@@ -1,57 +0,0 @@
-{
- "name": "deflate-crc32-stream",
- "version": "0.1.1",
- "description": "a streaming deflater with CRC32 checksumer",
- "homepage": "https://github.com/ctalkington/node-deflate-crc32-stream",
- "author": {
- "name": "Chris Talkington",
- "url": "http://christalkington.com/"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/ctalkington/node-deflate-crc32-stream.git"
- },
- "bugs": {
- "url": "https://github.com/ctalkington/node-deflate-crc32-stream/issues"
- },
- "licenses": [
- {
- "type": "MIT",
- "url": "https://github.com/ctalkington/node-deflate-crc32-stream/blob/master/LICENSE-MIT"
- }
- ],
- "main": "lib/deflate-crc32-stream.js",
- "files": [
- "lib",
- "LICENSE-MIT"
- ],
- "engines": {
- "node": ">= 0.8.0"
- },
- "scripts": {
- "test": "mocha --reporter dot"
- },
- "dependencies": {
- "buffer-crc32": "~0.2.1"
- },
- "devDependencies": {
- "chai": "~1.8.1",
- "mocha": "~1.16.0",
- "readable-stream": "~1.0.24"
- },
- "keywords": [
- "deflate",
- "crc32-stream",
- "crc32",
- "stream",
- "checksum"
- ],
- "readme": "# deflate-crc32-stream v0.1.0 [](https://travis-ci.org/ctalkington/node-deflate-crc32-stream)\r\n\r\ndeflate-crc32-stream is a streaming deflater with CRC32 checksumer. It uses [buffer-crc32](https://www.npmjs.org/package/buffer-crc32) behind the scenes to reliably handle binary data and fancy character sets. Data comes through compressed with [zlib.DeflateRaw](http://nodejs.org/api/zlib.html#zlib_class_zlib_deflateraw).\r\n\r\n[](https://nodei.co/npm/deflate-crc32-stream/)\r\n\r\n### Install\r\n\r\n```bash\r\nnpm install deflate-crc32-stream --save\r\n```\r\n\r\nYou can also use `npm install https://github.com/ctalkington/node-deflate-crc32-stream/archive/master.tar.gz` to test upcoming versions.\r\n\r\n### Usage\r\n\r\n```js\r\nvar CRC32Stream = require('deflate-crc32-stream');\r\n\r\nvar source = fs.createReadStream('file.txt');\r\nvar deflate = new DeflateCRC32Stream();\r\n\r\ndeflate.on('end', function(err) {\r\n // do something with deflate.digest() here\r\n});\r\n\r\n// either pipe it\r\nsource.pipe(deflate);\r\n\r\n// or write it\r\ndeflate.write('string');\r\ndeflate.end();\r\n```\r\n\r\n### Instance API\r\n\r\nInherits [zlib.DeflateRaw](http://nodejs.org/api/zlib.html#zlib_class_zlib_deflateraw) methods.\r\n\r\n#### digest()\r\n\r\nReturns the checksum digest in unsigned form.\r\n\r\n#### hex()\r\n\r\nReturns the hexadecimal representation of the checksum digest. (ie E81722F0)\r\n\r\n#### size(compressed)\r\n\r\nReturns the raw uncompressed size/length of passed-through data.\r\n\r\nIf `compressed` is `true`, it returns compressed length instead.\r\n\r\n### Instance Options\r\n\r\nInherits [zlib.DeflateRaw](http://nodejs.org/api/zlib.html#zlib_class_zlib_deflateraw) options.\r\n\r\n## Things of Interest\r\n\r\n- [Changelog](https://github.com/ctalkington/node-deflate-crc32-stream/releases)\r\n- [Contributing](https://github.com/ctalkington/node-deflate-crc32-stream/blob/master/CONTRIBUTING.md)\r\n- [MIT License](https://github.com/ctalkington/node-deflate-crc32-stream/blob/master/LICENSE-MIT)",
- "readmeFilename": "README.md",
- "_id": "deflate-crc32-stream@0.1.1",
- "dist": {
- "shasum": "5c6b428b7bbb42083440b233f46488d8140fafff"
- },
- "_from": "deflate-crc32-stream@~0.1.0",
- "_resolved": "https://registry.npmjs.org/deflate-crc32-stream/-/deflate-crc32-stream-0.1.1.tgz"
-}
diff --git a/builder/node_modules/archiver/node_modules/zip-stream/package.json b/builder/node_modules/archiver/node_modules/zip-stream/package.json
deleted file mode 100644
index d3b83399..00000000
--- a/builder/node_modules/archiver/node_modules/zip-stream/package.json
+++ /dev/null
@@ -1,62 +0,0 @@
-{
- "name": "zip-stream",
- "version": "0.3.6",
- "description": "a streaming zip archive generator.",
- "homepage": "https://github.com/ctalkington/node-zip-stream",
- "author": {
- "name": "Chris Talkington",
- "url": "http://christalkington.com/"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/ctalkington/node-zip-stream.git"
- },
- "bugs": {
- "url": "https://github.com/ctalkington/node-zip-stream/issues"
- },
- "licenses": [
- {
- "type": "MIT",
- "url": "https://github.com/ctalkington/node-zip-stream/blob/master/LICENSE-MIT"
- }
- ],
- "main": "lib/zip-stream.js",
- "files": [
- "lib",
- "LICENSE-MIT"
- ],
- "engines": {
- "node": ">= 0.8.0"
- },
- "scripts": {
- "test": "mocha --reporter dot"
- },
- "dependencies": {
- "buffer-crc32": "~0.2.1",
- "crc32-stream": "~0.2.0",
- "debug": "~1.0.2",
- "deflate-crc32-stream": "~0.1.0",
- "lodash": "~2.4.1",
- "readable-stream": "~1.0.26"
- },
- "devDependencies": {
- "chai": "~1.9.1",
- "mocha": "~1.18.2",
- "rimraf": "~2.2.8",
- "mkdirp": "~0.5.0"
- },
- "keywords": [
- "archive",
- "stream",
- "zip-stream",
- "zip"
- ],
- "readme": "# zip-stream v0.3.6 [](https://travis-ci.org/ctalkington/node-zip-stream)\r\n\r\nzip-stream is a streaming zip archive generator. It was built to be a successor to [zipstream](https://npmjs.org/package/zipstream). Dependencies are kept to a minimum through the use of many of node's built-in modules including the use of zlib module for compression.\r\n\r\n[](https://nodei.co/npm/zip-stream/)\r\n\r\n### Install\r\n\r\n```bash\r\nnpm install zip-stream --save\r\n```\r\n\r\nYou can also use `npm install https://github.com/ctalkington/node-zip-stream/archive/master.tar.gz` to test upcoming versions.\r\n\r\n### Usage\r\n\r\nThis module is meant to be wrapped internally by other modules and therefore lacks any queue management. This means you have to wait until the previous entry has been fully consumed to add another. Nested callbacks should be used to add multiple entries. There are modules like [async](https://npmjs.org/package/async) that ease the so called \"callback hell\".\r\n\r\nIf you want a module that handles entry queueing and much more, you should check out [archiver](https://npmjs.org/package/archiver) which uses this module internally.\r\n\r\n```js\r\nvar packer = require('zip-stream');\r\nvar archive = new packer(); // OR new packer(options)\r\n\r\narchive.on('error', function(err) {\r\n throw err;\r\n});\r\n\r\n// pipe archive where you want it (ie fs, http, etc)\r\n// listen to the destination's end, close, or finish event\r\n\r\narchive.entry('string contents', { name: 'string.txt' }, function(err, entry) {\r\n if (err) throw err;\r\n archive.entry(null, { name: 'directory/' }, function(err, entry) {\r\n if (err) throw err;\r\n archive.finalize();\r\n });\r\n});\r\n```\r\n\r\n### Instance API\r\n\r\n#### entry(input, data, callback(err, data))\r\n\r\nAppends an input source (text string, buffer, or stream) to the instance. When the instance has received, processed, and emitted the input, the callback is fired.\r\n\r\n#### finalize()\r\n\r\nFinalizes the instance. You should listen to the destination stream's `end`/`close`/`finish` event to know when all output has been safely consumed.\r\n\r\n### Instance Options\r\n\r\n#### comment `string`\r\n\r\nSets the zip comment.\r\n\r\n#### forceUTC `boolean`\r\n\r\nIf true, forces the entry date to UTC. Helps with testing across timezones.\r\n\r\n#### store `boolean`\r\n\r\nIf true, all entry contents will be archived without compression by default.\r\n\r\n#### zlib `object`\r\n\r\nPassed to node's [zlib](http://nodejs.org/api/zlib.html#zlib_options) module to control compression. Options may vary by node version.\r\n\r\n### Entry Data\r\n\r\n#### name `string` `required`\r\n\r\nSets the entry name including internal path.\r\n\r\n#### type `string`\r\n\r\nSets the entry type. Defaults to `file` or `directory` if name ends with trailing slash.\r\n\r\n#### date `string|Date`\r\n\r\nSets the entry date. This can be any valid date string or instance. Defaults to current time in locale.\r\n\r\n#### store `boolean`\r\n\r\nIf true, entry contents will be archived without compression.\r\n\r\n#### comment `string`\r\n\r\nSets the entry comment.\r\n\r\n#### mode `number`\r\n\r\nSets the entry permissions. (experimental)\r\n\r\n## Debugging\r\n\r\nThis library makes use of the [debug](https://npmjs.org/package/debug) module with a namespace of `zip-stream` which can be triggered by setting `DEBUG` in your environment like so:\r\n\r\n```shell\r\n# unix\r\nDEBUG=zip-stream:* node script\r\n\r\n# windows (powershell)\r\n$env:DEBUG=\"zip-stream:*\"\r\nnode script\r\n\r\n# windows (cmd)\r\nSET DEBUG=\"zip-stream:*\"\r\nnode script\r\n```\r\n\r\n## Things of Interest\r\n\r\n- [Releases](https://github.com/ctalkington/node-zip-stream/releases)\r\n- [Contributing](https://github.com/ctalkington/node-zip-stream/blob/master/CONTRIBUTING.md)\r\n- [MIT License](https://github.com/ctalkington/node-zip-stream/blob/master/LICENSE-MIT)\r\n\r\n## Credits\r\n\r\nConcept inspired by Antoine van Wel's [zipstream](https://npmjs.org/package/zipstream) module, which is no longer being updated.",
- "readmeFilename": "README.md",
- "_id": "zip-stream@0.3.6",
- "dist": {
- "shasum": "50f691167ccae3b0b020b9ace2619fd64de3b9b2"
- },
- "_from": "zip-stream@~0.3.0",
- "_resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-0.3.6.tgz"
-}
diff --git a/builder/node_modules/archiver/package.json b/builder/node_modules/archiver/package.json
deleted file mode 100644
index 629ad4b9..00000000
--- a/builder/node_modules/archiver/package.json
+++ /dev/null
@@ -1,66 +0,0 @@
-{
- "name": "archiver",
- "version": "0.10.1",
- "description": "a streaming interface for archive generation",
- "homepage": "https://github.com/ctalkington/node-archiver",
- "author": {
- "name": "Chris Talkington",
- "url": "http://christalkington.com/"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/ctalkington/node-archiver.git"
- },
- "bugs": {
- "url": "https://github.com/ctalkington/node-archiver/issues"
- },
- "licenses": [
- {
- "type": "MIT",
- "url": "https://github.com/ctalkington/node-archiver/blob/master/LICENSE-MIT"
- }
- ],
- "main": "lib/archiver.js",
- "files": [
- "lib",
- "LICENSE-MIT"
- ],
- "engines": {
- "node": ">= 0.10.0"
- },
- "scripts": {
- "test": "mocha --reporter dot",
- "bench": "node benchmark/simple/pack-zip.js"
- },
- "dependencies": {
- "buffer-crc32": "~0.2.1",
- "readable-stream": "~1.0.26",
- "tar-stream": "~0.4.0",
- "zip-stream": "~0.3.0",
- "lazystream": "~0.1.0",
- "file-utils": "~0.2.0",
- "lodash": "~2.4.1"
- },
- "devDependencies": {
- "chai": "~1.9.1",
- "mocha": "~1.18.2",
- "rimraf": "~2.2.8",
- "mkdirp": "~0.5.0",
- "stream-bench": "~0.1.2"
- },
- "keywords": [
- "archive",
- "archiver",
- "stream",
- "zip",
- "tar"
- ],
- "readme": "# Archiver v0.10.1 [](https://travis-ci.org/ctalkington/node-archiver)\r\n\r\na streaming interface for archive generation\r\n\r\n[](https://nodei.co/npm/archiver/)\r\n\r\n## Install\r\n\r\n```bash\r\nnpm install archiver --save\r\n```\r\n\r\nYou can also use `npm install https://github.com/ctalkington/node-archiver/archive/master.tar.gz` to test upcoming versions.\r\n\r\n## Archiver\r\n\r\n#### create(format, options)\r\n\r\nCreates an Archiver instance based on the format (zip, tar, etc) passed. Parameters can be passed directly to `Archiver` constructor for convenience.\r\n\r\n#### registerFormat(format, module)\r\n\r\nRegisters an archive format. Format modules are essentially transform streams with a few required methods. They will be further documented once a formal spec is in place.\r\n\r\n### Instance Methods\r\n\r\nInherits [Transform Stream](http://nodejs.org/api/stream.html#stream_class_stream_transform) methods.\r\n\r\n#### append(input, data)\r\n\r\nAppends an input source (text string, buffer, or stream) to the instance. When the instance has received, processed, and emitted the input, the `entry` event is fired.\r\n\r\nReplaced `#addFile` in v0.5.\r\n\r\n```js\r\narchive.append('string', { name:'string.txt' });\r\narchive.append(new Buffer('string'), { name:'buffer.txt' });\r\narchive.append(fs.createReadStream('mydir/file.txt'), { name:'stream.txt' });\r\narchive.append(null, { name:'dir/' });\r\n```\r\n\r\n#### bulk(mappings)\r\n\r\nAppends multiple entries from passed array of src-dest mappings. A lazystream wrapper is used to prevent issues with open file limits.\r\n\r\nGlobbing patterns are supported through use of the [file-utils](https://github.com/SBoudrias/file-utils) package. Please note that multiple src files to single dest file (ie concat) is not supported.\r\n\r\nThe `data` property can be set (per src-dest mapping) to define data for matched entries.\r\n\r\n```js\r\narchive.bulk([\r\n { src: ['mydir/**'], data: { date: new Date() } },\r\n { expand: true, cwd: 'mydir', src: ['**'], dest: 'newdir' }\r\n]);\r\n```\r\n\r\nFor more detail on this feature, please see [BULK.md](https://github.com/ctalkington/node-archiver/blob/master/BULK.md).\r\n\r\n#### file(filepath, data)\r\n\r\nAppends a file given its filepath using a lazystream wrapper to prevent issues with open file limits. When the instance has received, processed, and emitted the file, the `entry` event is fired.\r\n\r\n```js\r\narchive.file('mydir/file.txt', { name:'file.txt' });\r\n```\r\n\r\n#### finalize()\r\n\r\nFinalizes the instance. You should listen for the `end`/`close`/`finish` of the destination stream to properly detect completion.\r\n\r\n#### pointer()\r\n\r\nReturns the current byte length emitted by archiver. Use this in your end callback to log generated size.\r\n\r\n## Events\r\n\r\nInherits [Transform Stream](http://nodejs.org/api/stream.html#stream_class_stream_transform) events.\r\n\r\n#### entry\r\n\r\nFired when the input has been received, processed, and emitted. Passes entry data as first argument.\r\n\r\n## Zip\r\n\r\n### Options\r\n\r\n#### comment `string`\r\n\r\nSets the zip comment.\r\n\r\n#### forceUTC `boolean`\r\n\r\nIf true, forces the entry date to UTC. Helps with testing across timezones.\r\n\r\n#### store `boolean`\r\n\r\nIf true, all entry contents will be archived without compression by default.\r\n\r\n#### zlib `object`\r\n\r\nPassed to node's [zlib](http://nodejs.org/api/zlib.html#zlib_options) module to control compression. Options may vary by node version.\r\n\r\n### Entry Data\r\n\r\n#### name `string` `required`\r\n\r\nSets the entry name including internal path.\r\n\r\n#### date `string|Date`\r\n\r\nSets the entry date. This can be any valid date string or instance. Defaults to current time in locale.\r\n\r\n#### store `boolean`\r\n\r\nIf true, entry contents will be archived without compression.\r\n\r\n#### comment `string`\r\n\r\nSets the entry comment.\r\n\r\n#### mode `number`\r\n\r\nSets the entry permissions. Defaults to octal 0755 (directory) or 0644 (file).\r\n\r\n## Tar\r\n\r\n### Options\r\n\r\n#### gzip `boolean`\r\n\r\nCompresses the tar archive using gzip, default is false.\r\n\r\n#### gzipOptions `object`\r\n\r\nPassed to node's [zlib](http://nodejs.org/api/zlib.html#zlib_options) module to control compression. Options may vary by node version.\r\n\r\n### Entry Data\r\n\r\n#### name `string` `required`\r\n\r\nSets the entry name including internal path.\r\n\r\n#### date `string|Date`\r\n\r\nSets the entry date. This can be any valid date string or instance. Defaults to current time in locale.\r\n\r\n#### mode `number`\r\n\r\nSets the entry permissions. Defaults to octal 0755 (directory) or 0644 (file).\r\n\r\n## Libraries\r\n\r\nArchiver makes use of several libraries/modules to avoid duplication of efforts.\r\n\r\n- [zip-stream](https://npmjs.org/package/zip-stream)\r\n- [tar-stream](https://npmjs.org/package/tar-stream)\r\n\r\n## Things of Interest\r\n\r\n- [Examples](https://github.com/ctalkington/node-archiver/blob/master/examples)\r\n- [Changelog](https://github.com/ctalkington/node-archiver/releases)\r\n- [Contributing](https://github.com/ctalkington/node-archiver/blob/master/CONTRIBUTING.md)\r\n- [MIT License](https://github.com/ctalkington/node-archiver/blob/master/LICENSE-MIT)",
- "readmeFilename": "README.md",
- "_id": "archiver@0.10.1",
- "dist": {
- "shasum": "ed79d1aa20123e3562cc66aaf28cf5c073dc39d0"
- },
- "_from": "archiver@",
- "_resolved": "https://registry.npmjs.org/archiver/-/archiver-0.10.1.tgz"
-}
diff --git a/builder/node_modules/jshint/README.md b/builder/node_modules/jshint/README.md
deleted file mode 100644
index fb2c8416..00000000
--- a/builder/node_modules/jshint/README.md
+++ /dev/null
@@ -1,51 +0,0 @@
-JSHint, A Static Code Analysis Tool for JavaScript
---------------------------------------------------
-
-\[ [Use it online](http://jshint.com/) • [About](http://jshint.com/about/) •
-[Docs](http://jshint.com/docs/) • [FAQ](http://jshint.com/docs/faq) •
-[Install](http://jshint.com/install/) • [Hack](http://jshint.com/hack/) •
-[Blog](http://jshint.com/blog/) • [Twitter](https://twitter.com/jshint/) \]
-
-[](https://travis-ci.org/jshint/jshint)
-[](http://badge.fury.io/js/jshint)
-
-JSHint is a community-driven tool to detect errors and potential problems
-in JavaScript code. It is very flexible so you can easily adjust it to your
-particular coding guidelines and the environment you expect your code to
-execute in.
-
-#### JSHint 2.x versus JSHint 3
-
-There's an effort going on to release the next major version of JSHint. All
-development in the `master` branch is for the version 3.0. Current stable
-version is in the `2.x` branch. Keep that in mind when submitting pull requests.
-
-Also, before reporting a bug or thinking about hacking on JSHint, read this:
-[JSHint 3 plans](http://www.jshint.com/blog/jshint-3-plans/). TL;DR: we're
-moving away from style checks within JSHint so no new features around
-style checks will be accepted. Bug fixes are fine for the `2.x` branch.
-
-#### Reporting a bug
-
-To report a bug simply create a
-[new GitHub Issue](https://github.com/jshint/jshint/issues/new) and describe
-your problem or suggestion. We welcome all kind of feedback regarding
-JSHint including but not limited to:
-
- * When JSHint doesn't work as expected
- * When JSHint complains about valid JavaScript code that works in all browsers
- * When you simply want a new option or feature
-
-Before reporting a bug look around to see if there are any open or closed tickets
-that cover your issue. And remember the wisdom: pull request > bug report > tweet.
-
-
-#### License
-
-JSHint is distributed under the MIT License. One file and one file only
-(src/stable/jshint.js) is distributed under the slightly modified MIT License.
-
-
-#### Thank you!
-
-We really appreciate all kind of feedback and contributions. Thanks for using and supporting JSHint!
diff --git a/builder/node_modules/jshint/bin/apply b/builder/node_modules/jshint/bin/apply
deleted file mode 100644
index ab0da408..00000000
--- a/builder/node_modules/jshint/bin/apply
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/usr/bin/env node
-
-var shjs = require("shelljs");
-var url = "https://github.com/jshint/jshint/pull/" + process.argv[2] + ".diff";
-
-shjs.exec('curl "' + url + '" | git apply');
\ No newline at end of file
diff --git a/builder/node_modules/jshint/bin/build b/builder/node_modules/jshint/bin/build
deleted file mode 100644
index a0c7f4a6..00000000
--- a/builder/node_modules/jshint/bin/build
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/usr/bin/env node
-/*jshint shelljs:true */
-
-"use strict";
-
-var browserify = require("browserify");
-var bundle = browserify("./src/jshint.js");
-var version = require("../package.json").version;
-require("shelljs/make");
-
-if (!test("-e", "../dist"))
- mkdir("../dist");
-
-bundle.require("./src/jshint.js", { expose: "jshint" });
-bundle.bundle({}, function (err, src) {
- var web = "./dist/jshint.js";
- var rhino = "./dist/jshint-rhino.js";
-
- [ "// " + version,
- "var JSHINT;",
- "if (typeof window === 'undefined') window = {};",
- "(function () {",
- "var require;",
- src,
- "JSHINT = require('jshint').JSHINT;",
- "if (typeof exports === 'object' && exports) exports.JSHINT = JSHINT;",
- "}());"
- ].join("\n").to(web);
-
- ("#!/usr/bin/env rhino\nvar window = {};\n" + cat(web, "./src/platforms/rhino.js")).to(rhino);
- chmod("+x", rhino);
-});
\ No newline at end of file
diff --git a/builder/node_modules/jshint/bin/changelog b/builder/node_modules/jshint/bin/changelog
deleted file mode 100644
index 522c5166..00000000
--- a/builder/node_modules/jshint/bin/changelog
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env node
-/*jshint shelljs:true, lastsemic:true, -W101*/
-
-"use strict";
-
-var version = require("../package.json").version;
-require("shelljs/make");
-
-exec("git log --format='%H|%h|%an|%s' " + version + "..HEAD", { silent: true }, function (code, output) {
- if (code !== 0)
- return void console.log("git log return code is non-zero");
-
- var commits = output.split("\n")
- .filter(function (cmt) { return cmt.trim() !== "" })
- .map(function (cmt) { return cmt.split("|") });
-
- var html = "";
- var authors = {};
-
- commits.forEach(function (cmt) {
- var tr = "";
- tr += "
",
- "expected": [
- {
- "event": "opentagname",
- "data": [
- "p"
- ]
- },
- {
- "event": "attribute",
- "data": [
- "<",
- ""
- ]
- },
- {
- "event": "attribute",
- "data": [
- "fail",
- ""
- ]
- },
- {
- "event": "opentag",
- "data": [
- "p",
- {
- "<": "",
- "fail": ""
- }
- ]
- },
- {
- "event": "text",
- "data": [
- "stuff"
- ]
- },
- {
- "event": "closetag",
- "data": [
- "p"
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/builder/node_modules/jshint/node_modules/htmlparser2/test/Events/11-script_in_script.json b/builder/node_modules/jshint/node_modules/htmlparser2/test/Events/11-script_in_script.json
deleted file mode 100644
index ddbb87c8..00000000
--- a/builder/node_modules/jshint/node_modules/htmlparser2/test/Events/11-script_in_script.json
+++ /dev/null
@@ -1,54 +0,0 @@
-{
- "name": "Scripts creating other scripts",
- "options": {
- "handler": {},
- "parser": {}
- },
- "html": "",
- "expected": [
- {
- "event": "opentagname",
- "data": [
- "p"
- ]
- },
- {
- "event": "opentag",
- "data": [
- "p",
- {}
- ]
- },
- {
- "event": "opentagname",
- "data": [
- "script"
- ]
- },
- {
- "event": "opentag",
- "data": [
- "script",
- {}
- ]
- },
- {
- "event": "text",
- "data": [
- "var str = '
-
-
-
diff --git a/builder/node_modules/jshint/node_modules/underscore/index.js b/builder/node_modules/jshint/node_modules/underscore/index.js
deleted file mode 100644
index 2cf0ca5b..00000000
--- a/builder/node_modules/jshint/node_modules/underscore/index.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./underscore');
diff --git a/builder/node_modules/jshint/node_modules/underscore/package.json b/builder/node_modules/jshint/node_modules/underscore/package.json
deleted file mode 100644
index 4c89a679..00000000
--- a/builder/node_modules/jshint/node_modules/underscore/package.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "name": "underscore",
- "description": "JavaScript's functional programming helper library.",
- "homepage": "http://underscorejs.org",
- "keywords": [
- "util",
- "functional",
- "server",
- "client",
- "browser"
- ],
- "author": {
- "name": "Jeremy Ashkenas",
- "email": "jeremy@documentcloud.org"
- },
- "repository": {
- "type": "git",
- "url": "git://github.com/documentcloud/underscore.git"
- },
- "main": "underscore.js",
- "version": "1.4.4",
- "devDependencies": {
- "phantomjs": "0.2.2"
- },
- "scripts": {
- "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true"
- },
- "readme": " __\n /\\ \\ __\n __ __ ___ \\_\\ \\ __ _ __ ____ ___ ___ _ __ __ /\\_\\ ____\n /\\ \\/\\ \\ /' _ `\\ /'_ \\ /'__`\\/\\ __\\/ ,__\\ / ___\\ / __`\\/\\ __\\/'__`\\ \\/\\ \\ /',__\\\n \\ \\ \\_\\ \\/\\ \\/\\ \\/\\ \\ \\ \\/\\ __/\\ \\ \\//\\__, `\\/\\ \\__//\\ \\ \\ \\ \\ \\//\\ __/ __ \\ \\ \\/\\__, `\\\n \\ \\____/\\ \\_\\ \\_\\ \\___,_\\ \\____\\\\ \\_\\\\/\\____/\\ \\____\\ \\____/\\ \\_\\\\ \\____\\/\\_\\ _\\ \\ \\/\\____/\n \\/___/ \\/_/\\/_/\\/__,_ /\\/____/ \\/_/ \\/___/ \\/____/\\/___/ \\/_/ \\/____/\\/_//\\ \\_\\ \\/___/\n \\ \\____/\n \\/___/\n\nUnderscore.js is a utility-belt library for JavaScript that provides\nsupport for the usual functional suspects (each, map, reduce, filter...)\nwithout extending any core JavaScript objects.\n\nFor Docs, License, Tests, and pre-packed downloads, see:\nhttp://underscorejs.org\n\nMany thanks to our contributors:\nhttps://github.com/documentcloud/underscore/contributors\n",
- "readmeFilename": "README.md",
- "bugs": {
- "url": "https://github.com/documentcloud/underscore/issues"
- },
- "_id": "underscore@1.4.4",
- "_from": "underscore@1.4.x"
-}
diff --git a/builder/node_modules/jshint/node_modules/underscore/underscore-min.js b/builder/node_modules/jshint/node_modules/underscore/underscore-min.js
deleted file mode 100644
index c1d9d3ae..00000000
--- a/builder/node_modules/jshint/node_modules/underscore/underscore-min.js
+++ /dev/null
@@ -1 +0,0 @@
-(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,d=e.filter,g=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,_=Object.keys,j=i.bind,w=function(n){return n instanceof w?n:this instanceof w?(this._wrapped=n,void 0):new w(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=w),exports._=w):n._=w,w.VERSION="1.4.4";var A=w.each=w.forEach=function(n,t,e){if(null!=n)if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a in n)if(w.has(n,a)&&t.call(e,n[a],a,n)===r)return};w.map=w.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e[e.length]=t.call(r,n,u,i)}),e)};var O="Reduce of empty array with no initial value";w.reduce=w.foldl=w.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=w.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(O);return r},w.reduceRight=w.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=w.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=w.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(O);return r},w.find=w.detect=function(n,t,r){var e;return E(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},w.filter=w.select=function(n,t,r){var e=[];return null==n?e:d&&n.filter===d?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&(e[e.length]=n)}),e)},w.reject=function(n,t,r){return w.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},w.every=w.all=function(n,t,e){t||(t=w.identity);var u=!0;return null==n?u:g&&n.every===g?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var E=w.some=w.any=function(n,t,e){t||(t=w.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};w.contains=w.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:E(n,function(n){return n===t})},w.invoke=function(n,t){var r=o.call(arguments,2),e=w.isFunction(t);return w.map(n,function(n){return(e?t:n[t]).apply(n,r)})},w.pluck=function(n,t){return w.map(n,function(n){return n[t]})},w.where=function(n,t,r){return w.isEmpty(t)?r?null:[]:w[r?"find":"filter"](n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},w.findWhere=function(n,t){return w.where(n,t,!0)},w.max=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.max.apply(Math,n);if(!t&&w.isEmpty(n))return-1/0;var e={computed:-1/0,value:-1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>=e.computed&&(e={value:n,computed:a})}),e.value},w.min=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.min.apply(Math,n);if(!t&&w.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;e.computed>a&&(e={value:n,computed:a})}),e.value},w.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=w.random(r++),e[r-1]=e[t],e[t]=n}),e};var k=function(n){return w.isFunction(n)?n:function(t){return t[n]}};w.sortBy=function(n,t,r){var e=k(t);return w.pluck(w.map(n,function(n,t,u){return{value:n,index:t,criteria:e.call(r,n,t,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.indexi;){var o=i+a>>>1;u>r.call(e,n[o])?i=o+1:a=o}return i},w.toArray=function(n){return n?w.isArray(n)?o.call(n):n.length===+n.length?w.map(n,w.identity):w.values(n):[]},w.size=function(n){return null==n?0:n.length===+n.length?n.length:w.keys(n).length},w.first=w.head=w.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:o.call(n,0,t)},w.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},w.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},w.rest=w.tail=w.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},w.compact=function(n){return w.filter(n,w.identity)};var R=function(n,t,r){return A(n,function(n){w.isArray(n)?t?a.apply(r,n):R(n,t,r):r.push(n)}),r};w.flatten=function(n,t){return R(n,t,[])},w.without=function(n){return w.difference(n,o.call(arguments,1))},w.uniq=w.unique=function(n,t,r,e){w.isFunction(t)&&(e=r,r=t,t=!1);var u=r?w.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:w.contains(a,r))||(a.push(r),i.push(n[e]))}),i},w.union=function(){return w.uniq(c.apply(e,arguments))},w.intersection=function(n){var t=o.call(arguments,1);return w.filter(w.uniq(n),function(n){return w.every(t,function(t){return w.indexOf(t,n)>=0})})},w.difference=function(n){var t=c.apply(e,o.call(arguments,1));return w.filter(n,function(n){return!w.contains(t,n)})},w.zip=function(){for(var n=o.call(arguments),t=w.max(w.pluck(n,"length")),r=Array(t),e=0;t>e;e++)r[e]=w.pluck(n,""+e);return r},w.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},w.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=w.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},w.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},w.range=function(n,t,r){1>=arguments.length&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=Array(e);e>u;)i[u++]=n,n+=r;return i},w.bind=function(n,t){if(n.bind===j&&j)return j.apply(n,o.call(arguments,1));var r=o.call(arguments,2);return function(){return n.apply(t,r.concat(o.call(arguments)))}},w.partial=function(n){var t=o.call(arguments,1);return function(){return n.apply(this,t.concat(o.call(arguments)))}},w.bindAll=function(n){var t=o.call(arguments,1);return 0===t.length&&(t=w.functions(n)),A(t,function(t){n[t]=w.bind(n[t],n)}),n},w.memoize=function(n,t){var r={};return t||(t=w.identity),function(){var e=t.apply(this,arguments);return w.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},w.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},w.defer=function(n){return w.delay.apply(w,[n,1].concat(o.call(arguments,1)))},w.throttle=function(n,t){var r,e,u,i,a=0,o=function(){a=new Date,u=null,i=n.apply(r,e)};return function(){var c=new Date,l=t-(c-a);return r=this,e=arguments,0>=l?(clearTimeout(u),u=null,a=c,i=n.apply(r,e)):u||(u=setTimeout(o,l)),i}},w.debounce=function(n,t,r){var e,u;return function(){var i=this,a=arguments,o=function(){e=null,r||(u=n.apply(i,a))},c=r&&!e;return clearTimeout(e),e=setTimeout(o,t),c&&(u=n.apply(i,a)),u}},w.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},w.wrap=function(n,t){return function(){var r=[n];return a.apply(r,arguments),t.apply(this,r)}},w.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},w.after=function(n,t){return 0>=n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},w.keys=_||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)w.has(n,r)&&(t[t.length]=r);return t},w.values=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push(n[r]);return t},w.pairs=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push([r,n[r]]);return t},w.invert=function(n){var t={};for(var r in n)w.has(n,r)&&(t[n[r]]=r);return t},w.functions=w.methods=function(n){var t=[];for(var r in n)w.isFunction(n[r])&&t.push(r);return t.sort()},w.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},w.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},w.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)w.contains(r,u)||(t[u]=n[u]);return t},w.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)null==n[r]&&(n[r]=t[r])}),n},w.clone=function(n){return w.isObject(n)?w.isArray(n)?n.slice():w.extend({},n):n},w.tap=function(n,t){return t(n),n};var I=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof w&&(n=n._wrapped),t instanceof w&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==t+"";case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;r.push(n),e.push(t);var a=0,o=!0;if("[object Array]"==u){if(a=n.length,o=a==t.length)for(;a--&&(o=I(n[a],t[a],r,e)););}else{var c=n.constructor,f=t.constructor;if(c!==f&&!(w.isFunction(c)&&c instanceof c&&w.isFunction(f)&&f instanceof f))return!1;for(var s in n)if(w.has(n,s)&&(a++,!(o=w.has(t,s)&&I(n[s],t[s],r,e))))break;if(o){for(s in t)if(w.has(t,s)&&!a--)break;o=!a}}return r.pop(),e.pop(),o};w.isEqual=function(n,t){return I(n,t,[],[])},w.isEmpty=function(n){if(null==n)return!0;if(w.isArray(n)||w.isString(n))return 0===n.length;for(var t in n)if(w.has(n,t))return!1;return!0},w.isElement=function(n){return!(!n||1!==n.nodeType)},w.isArray=x||function(n){return"[object Array]"==l.call(n)},w.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){w["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),w.isArguments(arguments)||(w.isArguments=function(n){return!(!n||!w.has(n,"callee"))}),"function"!=typeof/./&&(w.isFunction=function(n){return"function"==typeof n}),w.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},w.isNaN=function(n){return w.isNumber(n)&&n!=+n},w.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},w.isNull=function(n){return null===n},w.isUndefined=function(n){return n===void 0},w.has=function(n,t){return f.call(n,t)},w.noConflict=function(){return n._=t,this},w.identity=function(n){return n},w.times=function(n,t,r){for(var e=Array(n),u=0;n>u;u++)e[u]=t.call(r,u);return e},w.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};var M={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};M.unescape=w.invert(M.escape);var S={escape:RegExp("["+w.keys(M.escape).join("")+"]","g"),unescape:RegExp("("+w.keys(M.unescape).join("|")+")","g")};w.each(["escape","unescape"],function(n){w[n]=function(t){return null==t?"":(""+t).replace(S[n],function(t){return M[n][t]})}}),w.result=function(n,t){if(null==n)return null;var r=n[t];return w.isFunction(r)?r.call(n):r},w.mixin=function(n){A(w.functions(n),function(t){var r=w[t]=n[t];w.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),D.call(this,r.apply(w,n))}})};var N=0;w.uniqueId=function(n){var t=++N+"";return n?n+t:t},w.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var T=/(.)^/,q={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},B=/\\|'|\r|\n|\t|\u2028|\u2029/g;w.template=function(n,t,r){var e;r=w.defaults({},r,w.templateSettings);var u=RegExp([(r.escape||T).source,(r.interpolate||T).source,(r.evaluate||T).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(B,function(n){return"\\"+q[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,w);var c=function(n){return e.call(this,n,w)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},w.chain=function(n){return w(n).chain()};var D=function(n){return this._chain?w(n).chain():n};w.mixin(w),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];w.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],D.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];w.prototype[n]=function(){return D.call(this,t.apply(this._wrapped,arguments))}}),w.extend(w.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this);
\ No newline at end of file
diff --git a/builder/node_modules/jshint/node_modules/underscore/underscore.js b/builder/node_modules/jshint/node_modules/underscore/underscore.js
deleted file mode 100644
index a12f0d96..00000000
--- a/builder/node_modules/jshint/node_modules/underscore/underscore.js
+++ /dev/null
@@ -1,1226 +0,0 @@
-// Underscore.js 1.4.4
-// http://underscorejs.org
-// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
-// Underscore may be freely distributed under the MIT license.
-
-(function() {
-
- // Baseline setup
- // --------------
-
- // Establish the root object, `window` in the browser, or `global` on the server.
- var root = this;
-
- // Save the previous value of the `_` variable.
- var previousUnderscore = root._;
-
- // Establish the object that gets returned to break out of a loop iteration.
- var breaker = {};
-
- // Save bytes in the minified (but not gzipped) version:
- var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
-
- // Create quick reference variables for speed access to core prototypes.
- var push = ArrayProto.push,
- slice = ArrayProto.slice,
- concat = ArrayProto.concat,
- toString = ObjProto.toString,
- hasOwnProperty = ObjProto.hasOwnProperty;
-
- // All **ECMAScript 5** native function implementations that we hope to use
- // are declared here.
- var
- nativeForEach = ArrayProto.forEach,
- nativeMap = ArrayProto.map,
- nativeReduce = ArrayProto.reduce,
- nativeReduceRight = ArrayProto.reduceRight,
- nativeFilter = ArrayProto.filter,
- nativeEvery = ArrayProto.every,
- nativeSome = ArrayProto.some,
- nativeIndexOf = ArrayProto.indexOf,
- nativeLastIndexOf = ArrayProto.lastIndexOf,
- nativeIsArray = Array.isArray,
- nativeKeys = Object.keys,
- nativeBind = FuncProto.bind;
-
- // Create a safe reference to the Underscore object for use below.
- var _ = function(obj) {
- if (obj instanceof _) return obj;
- if (!(this instanceof _)) return new _(obj);
- this._wrapped = obj;
- };
-
- // Export the Underscore object for **Node.js**, with
- // backwards-compatibility for the old `require()` API. If we're in
- // the browser, add `_` as a global object via a string identifier,
- // for Closure Compiler "advanced" mode.
- if (typeof exports !== 'undefined') {
- if (typeof module !== 'undefined' && module.exports) {
- exports = module.exports = _;
- }
- exports._ = _;
- } else {
- root._ = _;
- }
-
- // Current version.
- _.VERSION = '1.4.4';
-
- // Collection Functions
- // --------------------
-
- // The cornerstone, an `each` implementation, aka `forEach`.
- // Handles objects with the built-in `forEach`, arrays, and raw objects.
- // Delegates to **ECMAScript 5**'s native `forEach` if available.
- var each = _.each = _.forEach = function(obj, iterator, context) {
- if (obj == null) return;
- if (nativeForEach && obj.forEach === nativeForEach) {
- obj.forEach(iterator, context);
- } else if (obj.length === +obj.length) {
- for (var i = 0, l = obj.length; i < l; i++) {
- if (iterator.call(context, obj[i], i, obj) === breaker) return;
- }
- } else {
- for (var key in obj) {
- if (_.has(obj, key)) {
- if (iterator.call(context, obj[key], key, obj) === breaker) return;
- }
- }
- }
- };
-
- // Return the results of applying the iterator to each element.
- // Delegates to **ECMAScript 5**'s native `map` if available.
- _.map = _.collect = function(obj, iterator, context) {
- var results = [];
- if (obj == null) return results;
- if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
- each(obj, function(value, index, list) {
- results[results.length] = iterator.call(context, value, index, list);
- });
- return results;
- };
-
- var reduceError = 'Reduce of empty array with no initial value';
-
- // **Reduce** builds up a single result from a list of values, aka `inject`,
- // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
- _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
- var initial = arguments.length > 2;
- if (obj == null) obj = [];
- if (nativeReduce && obj.reduce === nativeReduce) {
- if (context) iterator = _.bind(iterator, context);
- return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
- }
- each(obj, function(value, index, list) {
- if (!initial) {
- memo = value;
- initial = true;
- } else {
- memo = iterator.call(context, memo, value, index, list);
- }
- });
- if (!initial) throw new TypeError(reduceError);
- return memo;
- };
-
- // The right-associative version of reduce, also known as `foldr`.
- // Delegates to **ECMAScript 5**'s native `reduceRight` if available.
- _.reduceRight = _.foldr = function(obj, iterator, memo, context) {
- var initial = arguments.length > 2;
- if (obj == null) obj = [];
- if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
- if (context) iterator = _.bind(iterator, context);
- return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
- }
- var length = obj.length;
- if (length !== +length) {
- var keys = _.keys(obj);
- length = keys.length;
- }
- each(obj, function(value, index, list) {
- index = keys ? keys[--length] : --length;
- if (!initial) {
- memo = obj[index];
- initial = true;
- } else {
- memo = iterator.call(context, memo, obj[index], index, list);
- }
- });
- if (!initial) throw new TypeError(reduceError);
- return memo;
- };
-
- // Return the first value which passes a truth test. Aliased as `detect`.
- _.find = _.detect = function(obj, iterator, context) {
- var result;
- any(obj, function(value, index, list) {
- if (iterator.call(context, value, index, list)) {
- result = value;
- return true;
- }
- });
- return result;
- };
-
- // Return all the elements that pass a truth test.
- // Delegates to **ECMAScript 5**'s native `filter` if available.
- // Aliased as `select`.
- _.filter = _.select = function(obj, iterator, context) {
- var results = [];
- if (obj == null) return results;
- if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
- each(obj, function(value, index, list) {
- if (iterator.call(context, value, index, list)) results[results.length] = value;
- });
- return results;
- };
-
- // Return all the elements for which a truth test fails.
- _.reject = function(obj, iterator, context) {
- return _.filter(obj, function(value, index, list) {
- return !iterator.call(context, value, index, list);
- }, context);
- };
-
- // Determine whether all of the elements match a truth test.
- // Delegates to **ECMAScript 5**'s native `every` if available.
- // Aliased as `all`.
- _.every = _.all = function(obj, iterator, context) {
- iterator || (iterator = _.identity);
- var result = true;
- if (obj == null) return result;
- if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);
- each(obj, function(value, index, list) {
- if (!(result = result && iterator.call(context, value, index, list))) return breaker;
- });
- return !!result;
- };
-
- // Determine if at least one element in the object matches a truth test.
- // Delegates to **ECMAScript 5**'s native `some` if available.
- // Aliased as `any`.
- var any = _.some = _.any = function(obj, iterator, context) {
- iterator || (iterator = _.identity);
- var result = false;
- if (obj == null) return result;
- if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
- each(obj, function(value, index, list) {
- if (result || (result = iterator.call(context, value, index, list))) return breaker;
- });
- return !!result;
- };
-
- // Determine if the array or object contains a given value (using `===`).
- // Aliased as `include`.
- _.contains = _.include = function(obj, target) {
- if (obj == null) return false;
- if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
- return any(obj, function(value) {
- return value === target;
- });
- };
-
- // Invoke a method (with arguments) on every item in a collection.
- _.invoke = function(obj, method) {
- var args = slice.call(arguments, 2);
- var isFunc = _.isFunction(method);
- return _.map(obj, function(value) {
- return (isFunc ? method : value[method]).apply(value, args);
- });
- };
-
- // Convenience version of a common use case of `map`: fetching a property.
- _.pluck = function(obj, key) {
- return _.map(obj, function(value){ return value[key]; });
- };
-
- // Convenience version of a common use case of `filter`: selecting only objects
- // containing specific `key:value` pairs.
- _.where = function(obj, attrs, first) {
- if (_.isEmpty(attrs)) return first ? null : [];
- return _[first ? 'find' : 'filter'](obj, function(value) {
- for (var key in attrs) {
- if (attrs[key] !== value[key]) return false;
- }
- return true;
- });
- };
-
- // Convenience version of a common use case of `find`: getting the first object
- // containing specific `key:value` pairs.
- _.findWhere = function(obj, attrs) {
- return _.where(obj, attrs, true);
- };
-
- // Return the maximum element or (element-based computation).
- // Can't optimize arrays of integers longer than 65,535 elements.
- // See: https://bugs.webkit.org/show_bug.cgi?id=80797
- _.max = function(obj, iterator, context) {
- if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
- return Math.max.apply(Math, obj);
- }
- if (!iterator && _.isEmpty(obj)) return -Infinity;
- var result = {computed : -Infinity, value: -Infinity};
- each(obj, function(value, index, list) {
- var computed = iterator ? iterator.call(context, value, index, list) : value;
- computed >= result.computed && (result = {value : value, computed : computed});
- });
- return result.value;
- };
-
- // Return the minimum element (or element-based computation).
- _.min = function(obj, iterator, context) {
- if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
- return Math.min.apply(Math, obj);
- }
- if (!iterator && _.isEmpty(obj)) return Infinity;
- var result = {computed : Infinity, value: Infinity};
- each(obj, function(value, index, list) {
- var computed = iterator ? iterator.call(context, value, index, list) : value;
- computed < result.computed && (result = {value : value, computed : computed});
- });
- return result.value;
- };
-
- // Shuffle an array.
- _.shuffle = function(obj) {
- var rand;
- var index = 0;
- var shuffled = [];
- each(obj, function(value) {
- rand = _.random(index++);
- shuffled[index - 1] = shuffled[rand];
- shuffled[rand] = value;
- });
- return shuffled;
- };
-
- // An internal function to generate lookup iterators.
- var lookupIterator = function(value) {
- return _.isFunction(value) ? value : function(obj){ return obj[value]; };
- };
-
- // Sort the object's values by a criterion produced by an iterator.
- _.sortBy = function(obj, value, context) {
- var iterator = lookupIterator(value);
- return _.pluck(_.map(obj, function(value, index, list) {
- return {
- value : value,
- index : index,
- criteria : iterator.call(context, value, index, list)
- };
- }).sort(function(left, right) {
- var a = left.criteria;
- var b = right.criteria;
- if (a !== b) {
- if (a > b || a === void 0) return 1;
- if (a < b || b === void 0) return -1;
- }
- return left.index < right.index ? -1 : 1;
- }), 'value');
- };
-
- // An internal function used for aggregate "group by" operations.
- var group = function(obj, value, context, behavior) {
- var result = {};
- var iterator = lookupIterator(value || _.identity);
- each(obj, function(value, index) {
- var key = iterator.call(context, value, index, obj);
- behavior(result, key, value);
- });
- return result;
- };
-
- // Groups the object's values by a criterion. Pass either a string attribute
- // to group by, or a function that returns the criterion.
- _.groupBy = function(obj, value, context) {
- return group(obj, value, context, function(result, key, value) {
- (_.has(result, key) ? result[key] : (result[key] = [])).push(value);
- });
- };
-
- // Counts instances of an object that group by a certain criterion. Pass
- // either a string attribute to count by, or a function that returns the
- // criterion.
- _.countBy = function(obj, value, context) {
- return group(obj, value, context, function(result, key) {
- if (!_.has(result, key)) result[key] = 0;
- result[key]++;
- });
- };
-
- // Use a comparator function to figure out the smallest index at which
- // an object should be inserted so as to maintain order. Uses binary search.
- _.sortedIndex = function(array, obj, iterator, context) {
- iterator = iterator == null ? _.identity : lookupIterator(iterator);
- var value = iterator.call(context, obj);
- var low = 0, high = array.length;
- while (low < high) {
- var mid = (low + high) >>> 1;
- iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid;
- }
- return low;
- };
-
- // Safely convert anything iterable into a real, live array.
- _.toArray = function(obj) {
- if (!obj) return [];
- if (_.isArray(obj)) return slice.call(obj);
- if (obj.length === +obj.length) return _.map(obj, _.identity);
- return _.values(obj);
- };
-
- // Return the number of elements in an object.
- _.size = function(obj) {
- if (obj == null) return 0;
- return (obj.length === +obj.length) ? obj.length : _.keys(obj).length;
- };
-
- // Array Functions
- // ---------------
-
- // Get the first element of an array. Passing **n** will return the first N
- // values in the array. Aliased as `head` and `take`. The **guard** check
- // allows it to work with `_.map`.
- _.first = _.head = _.take = function(array, n, guard) {
- if (array == null) return void 0;
- return (n != null) && !guard ? slice.call(array, 0, n) : array[0];
- };
-
- // Returns everything but the last entry of the array. Especially useful on
- // the arguments object. Passing **n** will return all the values in
- // the array, excluding the last N. The **guard** check allows it to work with
- // `_.map`.
- _.initial = function(array, n, guard) {
- return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));
- };
-
- // Get the last element of an array. Passing **n** will return the last N
- // values in the array. The **guard** check allows it to work with `_.map`.
- _.last = function(array, n, guard) {
- if (array == null) return void 0;
- if ((n != null) && !guard) {
- return slice.call(array, Math.max(array.length - n, 0));
- } else {
- return array[array.length - 1];
- }
- };
-
- // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
- // Especially useful on the arguments object. Passing an **n** will return
- // the rest N values in the array. The **guard**
- // check allows it to work with `_.map`.
- _.rest = _.tail = _.drop = function(array, n, guard) {
- return slice.call(array, (n == null) || guard ? 1 : n);
- };
-
- // Trim out all falsy values from an array.
- _.compact = function(array) {
- return _.filter(array, _.identity);
- };
-
- // Internal implementation of a recursive `flatten` function.
- var flatten = function(input, shallow, output) {
- each(input, function(value) {
- if (_.isArray(value)) {
- shallow ? push.apply(output, value) : flatten(value, shallow, output);
- } else {
- output.push(value);
- }
- });
- return output;
- };
-
- // Return a completely flattened version of an array.
- _.flatten = function(array, shallow) {
- return flatten(array, shallow, []);
- };
-
- // Return a version of the array that does not contain the specified value(s).
- _.without = function(array) {
- return _.difference(array, slice.call(arguments, 1));
- };
-
- // Produce a duplicate-free version of the array. If the array has already
- // been sorted, you have the option of using a faster algorithm.
- // Aliased as `unique`.
- _.uniq = _.unique = function(array, isSorted, iterator, context) {
- if (_.isFunction(isSorted)) {
- context = iterator;
- iterator = isSorted;
- isSorted = false;
- }
- var initial = iterator ? _.map(array, iterator, context) : array;
- var results = [];
- var seen = [];
- each(initial, function(value, index) {
- if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) {
- seen.push(value);
- results.push(array[index]);
- }
- });
- return results;
- };
-
- // Produce an array that contains the union: each distinct element from all of
- // the passed-in arrays.
- _.union = function() {
- return _.uniq(concat.apply(ArrayProto, arguments));
- };
-
- // Produce an array that contains every item shared between all the
- // passed-in arrays.
- _.intersection = function(array) {
- var rest = slice.call(arguments, 1);
- return _.filter(_.uniq(array), function(item) {
- return _.every(rest, function(other) {
- return _.indexOf(other, item) >= 0;
- });
- });
- };
-
- // Take the difference between one array and a number of other arrays.
- // Only the elements present in just the first array will remain.
- _.difference = function(array) {
- var rest = concat.apply(ArrayProto, slice.call(arguments, 1));
- return _.filter(array, function(value){ return !_.contains(rest, value); });
- };
-
- // Zip together multiple lists into a single array -- elements that share
- // an index go together.
- _.zip = function() {
- var args = slice.call(arguments);
- var length = _.max(_.pluck(args, 'length'));
- var results = new Array(length);
- for (var i = 0; i < length; i++) {
- results[i] = _.pluck(args, "" + i);
- }
- return results;
- };
-
- // Converts lists into objects. Pass either a single array of `[key, value]`
- // pairs, or two parallel arrays of the same length -- one of keys, and one of
- // the corresponding values.
- _.object = function(list, values) {
- if (list == null) return {};
- var result = {};
- for (var i = 0, l = list.length; i < l; i++) {
- if (values) {
- result[list[i]] = values[i];
- } else {
- result[list[i][0]] = list[i][1];
- }
- }
- return result;
- };
-
- // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),
- // we need this function. Return the position of the first occurrence of an
- // item in an array, or -1 if the item is not included in the array.
- // Delegates to **ECMAScript 5**'s native `indexOf` if available.
- // If the array is large and already in sort order, pass `true`
- // for **isSorted** to use binary search.
- _.indexOf = function(array, item, isSorted) {
- if (array == null) return -1;
- var i = 0, l = array.length;
- if (isSorted) {
- if (typeof isSorted == 'number') {
- i = (isSorted < 0 ? Math.max(0, l + isSorted) : isSorted);
- } else {
- i = _.sortedIndex(array, item);
- return array[i] === item ? i : -1;
- }
- }
- if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted);
- for (; i < l; i++) if (array[i] === item) return i;
- return -1;
- };
-
- // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
- _.lastIndexOf = function(array, item, from) {
- if (array == null) return -1;
- var hasIndex = from != null;
- if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) {
- return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item);
- }
- var i = (hasIndex ? from : array.length);
- while (i--) if (array[i] === item) return i;
- return -1;
- };
-
- // Generate an integer Array containing an arithmetic progression. A port of
- // the native Python `range()` function. See
- // [the Python documentation](http://docs.python.org/library/functions.html#range).
- _.range = function(start, stop, step) {
- if (arguments.length <= 1) {
- stop = start || 0;
- start = 0;
- }
- step = arguments[2] || 1;
-
- var len = Math.max(Math.ceil((stop - start) / step), 0);
- var idx = 0;
- var range = new Array(len);
-
- while(idx < len) {
- range[idx++] = start;
- start += step;
- }
-
- return range;
- };
-
- // Function (ahem) Functions
- // ------------------
-
- // Create a function bound to a given object (assigning `this`, and arguments,
- // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
- // available.
- _.bind = function(func, context) {
- if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
- var args = slice.call(arguments, 2);
- return function() {
- return func.apply(context, args.concat(slice.call(arguments)));
- };
- };
-
- // Partially apply a function by creating a version that has had some of its
- // arguments pre-filled, without changing its dynamic `this` context.
- _.partial = function(func) {
- var args = slice.call(arguments, 1);
- return function() {
- return func.apply(this, args.concat(slice.call(arguments)));
- };
- };
-
- // Bind all of an object's methods to that object. Useful for ensuring that
- // all callbacks defined on an object belong to it.
- _.bindAll = function(obj) {
- var funcs = slice.call(arguments, 1);
- if (funcs.length === 0) funcs = _.functions(obj);
- each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
- return obj;
- };
-
- // Memoize an expensive function by storing its results.
- _.memoize = function(func, hasher) {
- var memo = {};
- hasher || (hasher = _.identity);
- return function() {
- var key = hasher.apply(this, arguments);
- return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
- };
- };
-
- // Delays a function for the given number of milliseconds, and then calls
- // it with the arguments supplied.
- _.delay = function(func, wait) {
- var args = slice.call(arguments, 2);
- return setTimeout(function(){ return func.apply(null, args); }, wait);
- };
-
- // Defers a function, scheduling it to run after the current call stack has
- // cleared.
- _.defer = function(func) {
- return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
- };
-
- // Returns a function, that, when invoked, will only be triggered at most once
- // during a given window of time.
- _.throttle = function(func, wait) {
- var context, args, timeout, result;
- var previous = 0;
- var later = function() {
- previous = new Date;
- timeout = null;
- result = func.apply(context, args);
- };
- return function() {
- var now = new Date;
- var remaining = wait - (now - previous);
- context = this;
- args = arguments;
- if (remaining <= 0) {
- clearTimeout(timeout);
- timeout = null;
- previous = now;
- result = func.apply(context, args);
- } else if (!timeout) {
- timeout = setTimeout(later, remaining);
- }
- return result;
- };
- };
-
- // Returns a function, that, as long as it continues to be invoked, will not
- // be triggered. The function will be called after it stops being called for
- // N milliseconds. If `immediate` is passed, trigger the function on the
- // leading edge, instead of the trailing.
- _.debounce = function(func, wait, immediate) {
- var timeout, result;
- return function() {
- var context = this, args = arguments;
- var later = function() {
- timeout = null;
- if (!immediate) result = func.apply(context, args);
- };
- var callNow = immediate && !timeout;
- clearTimeout(timeout);
- timeout = setTimeout(later, wait);
- if (callNow) result = func.apply(context, args);
- return result;
- };
- };
-
- // Returns a function that will be executed at most one time, no matter how
- // often you call it. Useful for lazy initialization.
- _.once = function(func) {
- var ran = false, memo;
- return function() {
- if (ran) return memo;
- ran = true;
- memo = func.apply(this, arguments);
- func = null;
- return memo;
- };
- };
-
- // Returns the first function passed as an argument to the second,
- // allowing you to adjust arguments, run code before and after, and
- // conditionally execute the original function.
- _.wrap = function(func, wrapper) {
- return function() {
- var args = [func];
- push.apply(args, arguments);
- return wrapper.apply(this, args);
- };
- };
-
- // Returns a function that is the composition of a list of functions, each
- // consuming the return value of the function that follows.
- _.compose = function() {
- var funcs = arguments;
- return function() {
- var args = arguments;
- for (var i = funcs.length - 1; i >= 0; i--) {
- args = [funcs[i].apply(this, args)];
- }
- return args[0];
- };
- };
-
- // Returns a function that will only be executed after being called N times.
- _.after = function(times, func) {
- if (times <= 0) return func();
- return function() {
- if (--times < 1) {
- return func.apply(this, arguments);
- }
- };
- };
-
- // Object Functions
- // ----------------
-
- // Retrieve the names of an object's properties.
- // Delegates to **ECMAScript 5**'s native `Object.keys`
- _.keys = nativeKeys || function(obj) {
- if (obj !== Object(obj)) throw new TypeError('Invalid object');
- var keys = [];
- for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key;
- return keys;
- };
-
- // Retrieve the values of an object's properties.
- _.values = function(obj) {
- var values = [];
- for (var key in obj) if (_.has(obj, key)) values.push(obj[key]);
- return values;
- };
-
- // Convert an object into a list of `[key, value]` pairs.
- _.pairs = function(obj) {
- var pairs = [];
- for (var key in obj) if (_.has(obj, key)) pairs.push([key, obj[key]]);
- return pairs;
- };
-
- // Invert the keys and values of an object. The values must be serializable.
- _.invert = function(obj) {
- var result = {};
- for (var key in obj) if (_.has(obj, key)) result[obj[key]] = key;
- return result;
- };
-
- // Return a sorted list of the function names available on the object.
- // Aliased as `methods`
- _.functions = _.methods = function(obj) {
- var names = [];
- for (var key in obj) {
- if (_.isFunction(obj[key])) names.push(key);
- }
- return names.sort();
- };
-
- // Extend a given object with all the properties in passed-in object(s).
- _.extend = function(obj) {
- each(slice.call(arguments, 1), function(source) {
- if (source) {
- for (var prop in source) {
- obj[prop] = source[prop];
- }
- }
- });
- return obj;
- };
-
- // Return a copy of the object only containing the whitelisted properties.
- _.pick = function(obj) {
- var copy = {};
- var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
- each(keys, function(key) {
- if (key in obj) copy[key] = obj[key];
- });
- return copy;
- };
-
- // Return a copy of the object without the blacklisted properties.
- _.omit = function(obj) {
- var copy = {};
- var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
- for (var key in obj) {
- if (!_.contains(keys, key)) copy[key] = obj[key];
- }
- return copy;
- };
-
- // Fill in a given object with default properties.
- _.defaults = function(obj) {
- each(slice.call(arguments, 1), function(source) {
- if (source) {
- for (var prop in source) {
- if (obj[prop] == null) obj[prop] = source[prop];
- }
- }
- });
- return obj;
- };
-
- // Create a (shallow-cloned) duplicate of an object.
- _.clone = function(obj) {
- if (!_.isObject(obj)) return obj;
- return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
- };
-
- // Invokes interceptor with the obj, and then returns obj.
- // The primary purpose of this method is to "tap into" a method chain, in
- // order to perform operations on intermediate results within the chain.
- _.tap = function(obj, interceptor) {
- interceptor(obj);
- return obj;
- };
-
- // Internal recursive comparison function for `isEqual`.
- var eq = function(a, b, aStack, bStack) {
- // Identical objects are equal. `0 === -0`, but they aren't identical.
- // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.
- if (a === b) return a !== 0 || 1 / a == 1 / b;
- // A strict comparison is necessary because `null == undefined`.
- if (a == null || b == null) return a === b;
- // Unwrap any wrapped objects.
- if (a instanceof _) a = a._wrapped;
- if (b instanceof _) b = b._wrapped;
- // Compare `[[Class]]` names.
- var className = toString.call(a);
- if (className != toString.call(b)) return false;
- switch (className) {
- // Strings, numbers, dates, and booleans are compared by value.
- case '[object String]':
- // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
- // equivalent to `new String("5")`.
- return a == String(b);
- case '[object Number]':
- // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for
- // other numeric values.
- return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);
- case '[object Date]':
- case '[object Boolean]':
- // Coerce dates and booleans to numeric primitive values. Dates are compared by their
- // millisecond representations. Note that invalid dates with millisecond representations
- // of `NaN` are not equivalent.
- return +a == +b;
- // RegExps are compared by their source patterns and flags.
- case '[object RegExp]':
- return a.source == b.source &&
- a.global == b.global &&
- a.multiline == b.multiline &&
- a.ignoreCase == b.ignoreCase;
- }
- if (typeof a != 'object' || typeof b != 'object') return false;
- // Assume equality for cyclic structures. The algorithm for detecting cyclic
- // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
- var length = aStack.length;
- while (length--) {
- // Linear search. Performance is inversely proportional to the number of
- // unique nested structures.
- if (aStack[length] == a) return bStack[length] == b;
- }
- // Add the first object to the stack of traversed objects.
- aStack.push(a);
- bStack.push(b);
- var size = 0, result = true;
- // Recursively compare objects and arrays.
- if (className == '[object Array]') {
- // Compare array lengths to determine if a deep comparison is necessary.
- size = a.length;
- result = size == b.length;
- if (result) {
- // Deep compare the contents, ignoring non-numeric properties.
- while (size--) {
- if (!(result = eq(a[size], b[size], aStack, bStack))) break;
- }
- }
- } else {
- // Objects with different constructors are not equivalent, but `Object`s
- // from different frames are.
- var aCtor = a.constructor, bCtor = b.constructor;
- if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) &&
- _.isFunction(bCtor) && (bCtor instanceof bCtor))) {
- return false;
- }
- // Deep compare objects.
- for (var key in a) {
- if (_.has(a, key)) {
- // Count the expected number of properties.
- size++;
- // Deep compare each member.
- if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break;
- }
- }
- // Ensure that both objects contain the same number of properties.
- if (result) {
- for (key in b) {
- if (_.has(b, key) && !(size--)) break;
- }
- result = !size;
- }
- }
- // Remove the first object from the stack of traversed objects.
- aStack.pop();
- bStack.pop();
- return result;
- };
-
- // Perform a deep comparison to check if two objects are equal.
- _.isEqual = function(a, b) {
- return eq(a, b, [], []);
- };
-
- // Is a given array, string, or object empty?
- // An "empty" object has no enumerable own-properties.
- _.isEmpty = function(obj) {
- if (obj == null) return true;
- if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
- for (var key in obj) if (_.has(obj, key)) return false;
- return true;
- };
-
- // Is a given value a DOM element?
- _.isElement = function(obj) {
- return !!(obj && obj.nodeType === 1);
- };
-
- // Is a given value an array?
- // Delegates to ECMA5's native Array.isArray
- _.isArray = nativeIsArray || function(obj) {
- return toString.call(obj) == '[object Array]';
- };
-
- // Is a given variable an object?
- _.isObject = function(obj) {
- return obj === Object(obj);
- };
-
- // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.
- each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {
- _['is' + name] = function(obj) {
- return toString.call(obj) == '[object ' + name + ']';
- };
- });
-
- // Define a fallback version of the method in browsers (ahem, IE), where
- // there isn't any inspectable "Arguments" type.
- if (!_.isArguments(arguments)) {
- _.isArguments = function(obj) {
- return !!(obj && _.has(obj, 'callee'));
- };
- }
-
- // Optimize `isFunction` if appropriate.
- if (typeof (/./) !== 'function') {
- _.isFunction = function(obj) {
- return typeof obj === 'function';
- };
- }
-
- // Is a given object a finite number?
- _.isFinite = function(obj) {
- return isFinite(obj) && !isNaN(parseFloat(obj));
- };
-
- // Is the given value `NaN`? (NaN is the only number which does not equal itself).
- _.isNaN = function(obj) {
- return _.isNumber(obj) && obj != +obj;
- };
-
- // Is a given value a boolean?
- _.isBoolean = function(obj) {
- return obj === true || obj === false || toString.call(obj) == '[object Boolean]';
- };
-
- // Is a given value equal to null?
- _.isNull = function(obj) {
- return obj === null;
- };
-
- // Is a given variable undefined?
- _.isUndefined = function(obj) {
- return obj === void 0;
- };
-
- // Shortcut function for checking if an object has a given property directly
- // on itself (in other words, not on a prototype).
- _.has = function(obj, key) {
- return hasOwnProperty.call(obj, key);
- };
-
- // Utility Functions
- // -----------------
-
- // Run Underscore.js in *noConflict* mode, returning the `_` variable to its
- // previous owner. Returns a reference to the Underscore object.
- _.noConflict = function() {
- root._ = previousUnderscore;
- return this;
- };
-
- // Keep the identity function around for default iterators.
- _.identity = function(value) {
- return value;
- };
-
- // Run a function **n** times.
- _.times = function(n, iterator, context) {
- var accum = Array(n);
- for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i);
- return accum;
- };
-
- // Return a random integer between min and max (inclusive).
- _.random = function(min, max) {
- if (max == null) {
- max = min;
- min = 0;
- }
- return min + Math.floor(Math.random() * (max - min + 1));
- };
-
- // List of HTML entities for escaping.
- var entityMap = {
- escape: {
- '&': '&',
- '<': '<',
- '>': '>',
- '"': '"',
- "'": ''',
- '/': '/'
- }
- };
- entityMap.unescape = _.invert(entityMap.escape);
-
- // Regexes containing the keys and values listed immediately above.
- var entityRegexes = {
- escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'),
- unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g')
- };
-
- // Functions for escaping and unescaping strings to/from HTML interpolation.
- _.each(['escape', 'unescape'], function(method) {
- _[method] = function(string) {
- if (string == null) return '';
- return ('' + string).replace(entityRegexes[method], function(match) {
- return entityMap[method][match];
- });
- };
- });
-
- // If the value of the named property is a function then invoke it;
- // otherwise, return it.
- _.result = function(object, property) {
- if (object == null) return null;
- var value = object[property];
- return _.isFunction(value) ? value.call(object) : value;
- };
-
- // Add your own custom functions to the Underscore object.
- _.mixin = function(obj) {
- each(_.functions(obj), function(name){
- var func = _[name] = obj[name];
- _.prototype[name] = function() {
- var args = [this._wrapped];
- push.apply(args, arguments);
- return result.call(this, func.apply(_, args));
- };
- });
- };
-
- // Generate a unique integer id (unique within the entire client session).
- // Useful for temporary DOM ids.
- var idCounter = 0;
- _.uniqueId = function(prefix) {
- var id = ++idCounter + '';
- return prefix ? prefix + id : id;
- };
-
- // By default, Underscore uses ERB-style template delimiters, change the
- // following template settings to use alternative delimiters.
- _.templateSettings = {
- evaluate : /<%([\s\S]+?)%>/g,
- interpolate : /<%=([\s\S]+?)%>/g,
- escape : /<%-([\s\S]+?)%>/g
- };
-
- // When customizing `templateSettings`, if you don't want to define an
- // interpolation, evaluation or escaping regex, we need one that is
- // guaranteed not to match.
- var noMatch = /(.)^/;
-
- // Certain characters need to be escaped so that they can be put into a
- // string literal.
- var escapes = {
- "'": "'",
- '\\': '\\',
- '\r': 'r',
- '\n': 'n',
- '\t': 't',
- '\u2028': 'u2028',
- '\u2029': 'u2029'
- };
-
- var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g;
-
- // JavaScript micro-templating, similar to John Resig's implementation.
- // Underscore templating handles arbitrary delimiters, preserves whitespace,
- // and correctly escapes quotes within interpolated code.
- _.template = function(text, data, settings) {
- var render;
- settings = _.defaults({}, settings, _.templateSettings);
-
- // Combine delimiters into one regular expression via alternation.
- var matcher = new RegExp([
- (settings.escape || noMatch).source,
- (settings.interpolate || noMatch).source,
- (settings.evaluate || noMatch).source
- ].join('|') + '|$', 'g');
-
- // Compile the template source, escaping string literals appropriately.
- var index = 0;
- var source = "__p+='";
- text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
- source += text.slice(index, offset)
- .replace(escaper, function(match) { return '\\' + escapes[match]; });
-
- if (escape) {
- source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
- }
- if (interpolate) {
- source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
- }
- if (evaluate) {
- source += "';\n" + evaluate + "\n__p+='";
- }
- index = offset + match.length;
- return match;
- });
- source += "';\n";
-
- // If a variable is not specified, place data values in local scope.
- if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
-
- source = "var __t,__p='',__j=Array.prototype.join," +
- "print=function(){__p+=__j.call(arguments,'');};\n" +
- source + "return __p;\n";
-
- try {
- render = new Function(settings.variable || 'obj', '_', source);
- } catch (e) {
- e.source = source;
- throw e;
- }
-
- if (data) return render(data, _);
- var template = function(data) {
- return render.call(this, data, _);
- };
-
- // Provide the compiled function source as a convenience for precompilation.
- template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}';
-
- return template;
- };
-
- // Add a "chain" function, which will delegate to the wrapper.
- _.chain = function(obj) {
- return _(obj).chain();
- };
-
- // OOP
- // ---------------
- // If Underscore is called as a function, it returns a wrapped object that
- // can be used OO-style. This wrapper holds altered versions of all the
- // underscore functions. Wrapped objects may be chained.
-
- // Helper function to continue chaining intermediate results.
- var result = function(obj) {
- return this._chain ? _(obj).chain() : obj;
- };
-
- // Add all of the Underscore functions to the wrapper object.
- _.mixin(_);
-
- // Add all mutator Array functions to the wrapper.
- each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
- var method = ArrayProto[name];
- _.prototype[name] = function() {
- var obj = this._wrapped;
- method.apply(obj, arguments);
- if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0];
- return result.call(this, obj);
- };
- });
-
- // Add all accessor Array functions to the wrapper.
- each(['concat', 'join', 'slice'], function(name) {
- var method = ArrayProto[name];
- _.prototype[name] = function() {
- return result.call(this, method.apply(this._wrapped, arguments));
- };
- });
-
- _.extend(_.prototype, {
-
- // Start chaining a wrapped Underscore object.
- chain: function() {
- this._chain = true;
- return this;
- },
-
- // Extracts the result from a wrapped and chained object.
- value: function() {
- return this._wrapped;
- }
-
- });
-
-}).call(this);
diff --git a/builder/node_modules/jshint/package.json b/builder/node_modules/jshint/package.json
deleted file mode 100644
index 3a7f4579..00000000
--- a/builder/node_modules/jshint/package.json
+++ /dev/null
@@ -1,68 +0,0 @@
-{
- "name": "jshint",
- "version": "2.5.0",
- "homepage": "http://jshint.com/",
- "description": "Static analysis tool for JavaScript",
- "author": {
- "name": "Anton Kovalyov",
- "email": "anton@kovalyov.net",
- "url": "http://anton.kovalyov.net/"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/jshint/jshint.git"
- },
- "bugs": {
- "url": "https://github.com/jshint/jshint/issues"
- },
- "bin": {
- "jshint": "./bin/jshint"
- },
- "scripts": {
- "data": "node scripts/generate-identifier-data",
- "build": "node bin/build",
- "test": "nodeunit tests tests/regression tests/unit",
- "pretest": "jshint src"
- },
- "main": "./src/jshint.js",
- "dependencies": {
- "shelljs": "0.1.x",
- "underscore": "1.4.x",
- "cli": "0.4.x",
- "minimatch": "0.x.x",
- "htmlparser2": "3.3.x",
- "console-browserify": "0.1.x",
- "exit": "0.1.x",
- "strip-json-comments": "0.1.x"
- },
- "devDependencies": {
- "jshint": "2.4.x",
- "shelljs": "0.1.x",
- "browserify": "3.x",
- "coveraje": "0.2.x",
- "nodeunit": "0.8.x",
- "sinon": "1.7.x",
- "unicode-6.3.0": "0.1.x",
- "regenerate": "0.5.x"
- },
- "licenses": [
- {
- "type": "MIT",
- "url": "https://github.com/jshint/jshint/blob/master/LICENSE"
- }
- ],
- "preferGlobal": true,
- "files": [
- "bin",
- "src",
- "data"
- ],
- "readme": "JSHint, A Static Code Analysis Tool for JavaScript\n--------------------------------------------------\n\n\\[ [Use it online](http://jshint.com/) • [About](http://jshint.com/about/) •\n[Docs](http://jshint.com/docs/) • [FAQ](http://jshint.com/docs/faq) •\n[Install](http://jshint.com/install/) • [Hack](http://jshint.com/hack/) •\n[Blog](http://jshint.com/blog/) • [Twitter](https://twitter.com/jshint/) \\]\n\n[](https://travis-ci.org/jshint/jshint)\n[](http://badge.fury.io/js/jshint)\n\nJSHint is a community-driven tool to detect errors and potential problems\nin JavaScript code. It is very flexible so you can easily adjust it to your\nparticular coding guidelines and the environment you expect your code to\nexecute in.\n\n#### JSHint 2.x versus JSHint 3\n\nThere's an effort going on to release the next major version of JSHint. All\ndevelopment in the `master` branch is for the version 3.0. Current stable\nversion is in the `2.x` branch. Keep that in mind when submitting pull requests.\n\nAlso, before reporting a bug or thinking about hacking on JSHint, read this:\n[JSHint 3 plans](http://www.jshint.com/blog/jshint-3-plans/). TL;DR: we're\nmoving away from style checks within JSHint so no new features around\nstyle checks will be accepted. Bug fixes are fine for the `2.x` branch.\n\n#### Reporting a bug\n\nTo report a bug simply create a\n[new GitHub Issue](https://github.com/jshint/jshint/issues/new) and describe\nyour problem or suggestion. We welcome all kind of feedback regarding\nJSHint including but not limited to:\n\n * When JSHint doesn't work as expected\n * When JSHint complains about valid JavaScript code that works in all browsers\n * When you simply want a new option or feature\n\nBefore reporting a bug look around to see if there are any open or closed tickets\nthat cover your issue. And remember the wisdom: pull request > bug report > tweet.\n\n\n#### License\n\nJSHint is distributed under the MIT License. One file and one file only\n(src/stable/jshint.js) is distributed under the slightly modified MIT License.\n\n\n#### Thank you!\n\nWe really appreciate all kind of feedback and contributions. Thanks for using and supporting JSHint!\n",
- "readmeFilename": "README.md",
- "_id": "jshint@2.5.0",
- "dist": {
- "shasum": "9148b7236838f7355bcdf67dff230255c2b7ff22"
- },
- "_from": "jshint@2.5.0",
- "_resolved": "https://registry.npmjs.org/jshint/-/jshint-2.5.0.tgz"
-}
diff --git a/builder/node_modules/jshint/src/cli.js b/builder/node_modules/jshint/src/cli.js
deleted file mode 100644
index 93a59e66..00000000
--- a/builder/node_modules/jshint/src/cli.js
+++ /dev/null
@@ -1,702 +0,0 @@
-"use strict";
-
-var _ = require("underscore");
-var cli = require("cli");
-var path = require("path");
-var shjs = require("shelljs");
-var minimatch = require("minimatch");
-var htmlparser = require("htmlparser2");
-var exit = require("exit");
-var stripJsonComments = require("strip-json-comments");
-var JSHINT = require("./jshint.js").JSHINT;
-var defReporter = require("./reporters/default").reporter;
-
-var OPTIONS = {
- "config": ["c", "Custom configuration file", "string", false ],
- "reporter": ["reporter", "Custom reporter (|jslint|checkstyle)", "string", undefined ],
- "exclude": ["exclude",
- "Exclude files matching the given filename pattern (same as .jshintignore)", "string", null],
- "exclude-path": ["exclude-path", "Pass in a custom jshintignore file path", "string", null],
- "filename": ["filename",
- "Pass in a filename when using STDIN to emulate config lookup for that file name",
- "string", null],
- "verbose": ["verbose", "Show message codes"],
- "show-non-errors": ["show-non-errors", "Show additional data generated by jshint"],
- "extra-ext": ["e",
- "Comma-separated list of file extensions to use (default is .js)", "string", ""],
-
- "extract": [
- "extract",
- "Extract inline scripts contained in HTML (auto|always|never, default to never)",
- "string",
- "never"
- ],
-
- // Deprecated options.
- "jslint-reporter": [
- "jslint-reporter",
- deprecated("Use a jslint compatible reporter", "--reporter=jslint")
- ],
-
- "checkstyle-reporter": [
- "checkstyle-reporter",
- deprecated("Use a CheckStyle compatible XML reporter", "--reporter=checkstyle")
- ]
-};
-
-/**
- * Returns the same text but with a deprecation notice.
- * Useful for options descriptions.
- *
- * @param {string} text
- * @param {string} alt (optional) Alternative command to include in the
- * deprecation notice.
- *
- * @returns {string}
- */
-function deprecated(text, alt) {
- if (!alt) {
- return text + " (DEPRECATED)";
- }
-
- return text + " (DEPRECATED, use " + alt + " instead)";
-}
-
-/**
- * Tries to find a configuration file in either project directory
- * or in the home directory. Configuration files are named
- * '.jshintrc'.
- *
- * @param {string} file path to the file to be linted
- * @returns {string} a path to the config file
- */
-function findConfig(file) {
- var dir = path.dirname(path.resolve(file));
- var envs = process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE;
- var home = path.normalize(path.join(envs, ".jshintrc"));
-
- var proj = findFile(".jshintrc", dir);
- if (proj)
- return proj;
-
- if (shjs.test("-e", home))
- return home;
-
- return null;
-}
-
-/**
- * Tries to find JSHint configuration within a package.json file
- * (if any). It search in the current directory and then goes up
- * all the way to the root just like findFile.
- *
- * @param {string} file path to the file to be linted
- * @returns {object} config object
- */
-function loadNpmConfig(file) {
- var dir = path.dirname(path.resolve(file));
- var fp = findFile("package.json", dir);
-
- if (!fp)
- return null;
-
- try {
- return require(fp).jshintConfig;
- } catch (e) {
- return null;
- }
-}
-
-/**
- * Tries to import a reporter file and returns its reference.
- *
- * @param {string} fp a path to the reporter file
- * @returns {object} imported module for the reporter or 'null'
- * if a module cannot be imported.
- */
-function loadReporter(fp) {
- try {
- return require(fp).reporter;
- } catch (err) {
- return null;
- }
-}
-
-// Storage for memoized results from find file
-// Should prevent lots of directory traversal &
-// lookups when liniting an entire project
-var findFileResults = {};
-
-/**
- * Searches for a file with a specified name starting with
- * 'dir' and going all the way up either until it finds the file
- * or hits the root.
- *
- * @param {string} name filename to search for (e.g. .jshintrc)
- * @param {string} dir directory to start search from (default:
- * current working directory)
- *
- * @returns {string} normalized filename
- */
-function findFile(name, dir) {
- dir = dir || process.cwd();
-
- var filename = path.normalize(path.join(dir, name));
- if (findFileResults[filename] !== undefined) {
- return findFileResults[filename];
- }
-
- var parent = path.resolve(dir, "../");
-
- if (shjs.test("-e", filename)) {
- findFileResults[filename] = filename;
- return filename;
- }
-
- if (dir === parent) {
- findFileResults[filename] = null;
- return null;
- }
-
- return findFile(name, parent);
-}
-
-/**
- * Loads a list of files that have to be skipped. JSHint assumes that
- * the list is located in a file called '.jshintignore'.
- *
- * @return {array} a list of files to ignore.
- */
-function loadIgnores(exclude, excludePath) {
- var file = findFile(excludePath || ".jshintignore");
-
- if (!file && !exclude) {
- return [];
- }
-
- var lines = (file ? shjs.cat(file) : "").split("\n");
- lines.unshift(exclude || "");
-
- return lines
- .filter(function (line) {
- return !!line.trim();
- })
- .map(function (line) {
- if (line[0] === "!")
- return "!" + path.resolve(path.dirname(file), line.substr(1).trim());
-
- return path.join(path.dirname(file), line.trim());
- });
-}
-
-/**
- * Checks whether we should ignore a file or not.
- *
- * @param {string} fp a path to a file
- * @param {array} patterns a list of patterns for files to ignore
- *
- * @return {boolean} 'true' if file should be ignored, 'false' otherwise.
- */
-function isIgnored(fp, patterns) {
- return patterns.some(function (ip) {
- if (minimatch(path.resolve(fp), ip, { nocase: true })) {
- return true;
- }
-
- if (path.resolve(fp) === ip) {
- return true;
- }
-
- if (shjs.test("-d", fp) && ip.match(/^[^\/]*\/?$/) &&
- fp.match(new RegExp("^" + ip + ".*"))) {
- return true;
- }
- });
-}
-
-/**
- * Extract JS code from a given source code. The source code my be either HTML
- * code or JS code. In the latter case, no extraction will be done unless
- * 'always' is given.
- *
- * @param {string} code a piece of code
- * @param {string} when 'always' will extract the JS code, no matter what.
- * 'never' won't do anything. 'auto' will check if the code looks like HTML
- * before extracting it.
- *
- * @return {string} the extracted code
- */
-function extract(code, when) {
- // A JS file won't start with a less-than character, whereas a HTML file
- // should always start with that.
- if (when !== "always" && (when !== "auto" || !/^\s* tag.
- function onopen(name, attrs) {
- if (name !== "script")
- return;
-
- if (attrs.type && !/text\/javascript/.test(attrs.type.toLowerCase()))
- return;
-
- // Mark that we're inside a tag and this tag and this 0) {
- sys.error("WARN: Ignoring input files since --self was passed");
- }
- files = UglifyJS.FILES;
- if (!ARGS.wrap) ARGS.wrap = "UglifyJS";
- ARGS.export_all = true;
-}
-
-var ORIG_MAP = ARGS.in_source_map;
-
-if (ORIG_MAP) {
- ORIG_MAP = JSON.parse(fs.readFileSync(ORIG_MAP));
- if (files.length == 0) {
- sys.error("INFO: Using file from the input source map: " + ORIG_MAP.file);
- files = [ ORIG_MAP.file ];
- }
- if (ARGS.source_map_root == null) {
- ARGS.source_map_root = ORIG_MAP.sourceRoot;
- }
-}
-
-if (files.length == 0) {
- files = [ "-" ];
-}
-
-if (files.indexOf("-") >= 0 && ARGS.source_map) {
- sys.error("ERROR: Source map doesn't work with input from STDIN");
- process.exit(1);
-}
-
-if (files.filter(function(el){ return el == "-" }).length > 1) {
- sys.error("ERROR: Can read a single file from STDIN (two or more dashes specified)");
- process.exit(1);
-}
-
-var STATS = {};
-var OUTPUT_FILE = ARGS.o;
-var TOPLEVEL = null;
-var P_RELATIVE = ARGS.p && ARGS.p == "relative";
-var SOURCES_CONTENT = {};
-
-var SOURCE_MAP = ARGS.source_map ? UglifyJS.SourceMap({
- file: P_RELATIVE ? path.relative(path.dirname(ARGS.source_map), OUTPUT_FILE) : OUTPUT_FILE,
- root: ARGS.source_map_root,
- orig: ORIG_MAP,
-}) : null;
-
-OUTPUT_OPTIONS.source_map = SOURCE_MAP;
-
-try {
- var output = UglifyJS.OutputStream(OUTPUT_OPTIONS);
- var compressor = COMPRESS && UglifyJS.Compressor(COMPRESS);
-} catch(ex) {
- if (ex instanceof UglifyJS.DefaultsError) {
- sys.error(ex.msg);
- sys.error("Supported options:");
- sys.error(sys.inspect(ex.defs));
- process.exit(1);
- }
-}
-
-async.eachLimit(files, 1, function (file, cb) {
- read_whole_file(file, function (err, code) {
- if (err) {
- sys.error("ERROR: can't read file: " + file);
- process.exit(1);
- }
- if (ARGS.p != null) {
- if (P_RELATIVE) {
- file = path.relative(path.dirname(ARGS.source_map), file);
- } else {
- var p = parseInt(ARGS.p, 10);
- if (!isNaN(p)) {
- file = file.replace(/^\/+/, "").split(/\/+/).slice(ARGS.p).join("/");
- }
- }
- }
- SOURCES_CONTENT[file] = code;
- time_it("parse", function(){
- if (ARGS.spidermonkey) {
- var program = JSON.parse(code);
- if (!TOPLEVEL) TOPLEVEL = program;
- else TOPLEVEL.body = TOPLEVEL.body.concat(program.body);
- }
- else if (ARGS.acorn) {
- TOPLEVEL = acorn.parse(code, {
- locations : true,
- sourceFile : file,
- program : TOPLEVEL
- });
- }
- else {
- try {
- TOPLEVEL = UglifyJS.parse(code, {
- filename : file,
- toplevel : TOPLEVEL,
- expression : ARGS.expr,
- });
- } catch(ex) {
- if (ex instanceof UglifyJS.JS_Parse_Error) {
- sys.error("Parse error at " + file + ":" + ex.line + "," + ex.col);
- sys.error(ex.message);
- sys.error(ex.stack);
- process.exit(1);
- }
- throw ex;
- }
- };
- });
- cb();
- });
-}, function () {
- if (ARGS.acorn || ARGS.spidermonkey) time_it("convert_ast", function(){
- TOPLEVEL = UglifyJS.AST_Node.from_mozilla_ast(TOPLEVEL);
- });
-
- if (ARGS.wrap) {
- TOPLEVEL = TOPLEVEL.wrap_commonjs(ARGS.wrap, ARGS.export_all);
- }
-
- if (ARGS.enclose) {
- var arg_parameter_list = ARGS.enclose;
- if (arg_parameter_list === true) {
- arg_parameter_list = [];
- }
- else if (!(arg_parameter_list instanceof Array)) {
- arg_parameter_list = [arg_parameter_list];
- }
- TOPLEVEL = TOPLEVEL.wrap_enclose(arg_parameter_list);
- }
-
- var SCOPE_IS_NEEDED = COMPRESS || MANGLE || ARGS.lint;
-
- if (SCOPE_IS_NEEDED) {
- time_it("scope", function(){
- TOPLEVEL.figure_out_scope({ screw_ie8: ARGS.screw_ie8 });
- if (ARGS.lint) {
- TOPLEVEL.scope_warnings();
- }
- });
- }
-
- if (COMPRESS) {
- time_it("squeeze", function(){
- TOPLEVEL = TOPLEVEL.transform(compressor);
- });
- }
-
- if (SCOPE_IS_NEEDED) {
- time_it("scope", function(){
- TOPLEVEL.figure_out_scope({ screw_ie8: ARGS.screw_ie8 });
- if (MANGLE) {
- TOPLEVEL.compute_char_frequency(MANGLE);
- }
- });
- }
-
- if (MANGLE) time_it("mangle", function(){
- TOPLEVEL.mangle_names(MANGLE);
- });
-
- if (ARGS.source_map_include_sources) {
- for (var file in SOURCES_CONTENT) {
- if (SOURCES_CONTENT.hasOwnProperty(file)) {
- SOURCE_MAP.get().setSourceContent(file, SOURCES_CONTENT[file]);
- }
- }
- }
-
- time_it("generate", function(){
- TOPLEVEL.print(output);
- });
-
- output = output.get();
-
- if (SOURCE_MAP) {
- fs.writeFileSync(ARGS.source_map, SOURCE_MAP, "utf8");
- var source_map_url = ARGS.source_map_url || (
- P_RELATIVE
- ? path.relative(path.dirname(OUTPUT_FILE), ARGS.source_map)
- : ARGS.source_map
- );
- output += "\n//# sourceMappingURL=" + source_map_url;
- }
-
- if (OUTPUT_FILE) {
- fs.writeFileSync(OUTPUT_FILE, output, "utf8");
- } else {
- sys.print(output);
- }
-
- if (ARGS.stats) {
- sys.error(UglifyJS.string_template("Timing information (compressed {count} files):", {
- count: files.length
- }));
- for (var i in STATS) if (STATS.hasOwnProperty(i)) {
- sys.error(UglifyJS.string_template("- {name}: {time}s", {
- name: i,
- time: (STATS[i] / 1000).toFixed(3)
- }));
- }
- }
-});
-
-/* -----[ functions ]----- */
-
-function normalize(o) {
- for (var i in o) if (o.hasOwnProperty(i) && /-/.test(i)) {
- o[i.replace(/-/g, "_")] = o[i];
- delete o[i];
- }
-}
-
-function getOptions(x, constants) {
- x = ARGS[x];
- if (!x) return null;
- var ret = {};
- if (x !== true) {
- var ast;
- try {
- ast = UglifyJS.parse(x, { expression: true });
- } catch(ex) {
- if (ex instanceof UglifyJS.JS_Parse_Error) {
- sys.error("Error parsing arguments in: " + x);
- process.exit(1);
- }
- }
- ast.walk(new UglifyJS.TreeWalker(function(node){
- if (node instanceof UglifyJS.AST_Seq) return; // descend
- if (node instanceof UglifyJS.AST_Assign) {
- var name = node.left.print_to_string({ beautify: false }).replace(/-/g, "_");
- var value = node.right;
- if (constants)
- value = new Function("return (" + value.print_to_string() + ")")();
- ret[name] = value;
- return true; // no descend
- }
- if (node instanceof UglifyJS.AST_Symbol || node instanceof UglifyJS.AST_Binary) {
- var name = node.print_to_string({ beautify: false }).replace(/-/g, "_");
- ret[name] = true;
- return true; // no descend
- }
- sys.error(node.TYPE)
- sys.error("Error parsing arguments in: " + x);
- process.exit(1);
- }));
- }
- return ret;
-}
-
-function read_whole_file(filename, cb) {
- if (filename == "-") {
- var chunks = [];
- process.stdin.setEncoding('utf-8');
- process.stdin.on('data', function (chunk) {
- chunks.push(chunk);
- }).on('end', function () {
- cb(null, chunks.join(""));
- });
- process.openStdin();
- } else {
- fs.readFile(filename, "utf-8", cb);
- }
-}
-
-function time_it(name, cont) {
- var t1 = new Date().getTime();
- var ret = cont();
- if (ARGS.stats) {
- var spent = new Date().getTime() - t1;
- if (STATS[name]) STATS[name] += spent;
- else STATS[name] = spent;
- }
- return ret;
-}
diff --git a/builder/node_modules/uglify-js/lib/ast.js b/builder/node_modules/uglify-js/lib/ast.js
deleted file mode 100644
index 2f216c20..00000000
--- a/builder/node_modules/uglify-js/lib/ast.js
+++ /dev/null
@@ -1,984 +0,0 @@
-/***********************************************************************
-
- A JavaScript tokenizer / parser / beautifier / compressor.
- https://github.com/mishoo/UglifyJS2
-
- -------------------------------- (C) ---------------------------------
-
- Author: Mihai Bazon
-
- http://mihai.bazon.net/blog
-
- Distributed under the BSD license:
-
- Copyright 2012 (c) Mihai Bazon
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- * Redistributions of source code must retain the above
- copyright notice, this list of conditions and the following
- disclaimer.
-
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials
- provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
- TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
- THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
-
- ***********************************************************************/
-
-"use strict";
-
-function DEFNODE(type, props, methods, base) {
- if (arguments.length < 4) base = AST_Node;
- if (!props) props = [];
- else props = props.split(/\s+/);
- var self_props = props;
- if (base && base.PROPS)
- props = props.concat(base.PROPS);
- var code = "return function AST_" + type + "(props){ if (props) { ";
- for (var i = props.length; --i >= 0;) {
- code += "this." + props[i] + " = props." + props[i] + ";";
- }
- var proto = base && new base;
- if (proto && proto.initialize || (methods && methods.initialize))
- code += "this.initialize();";
- code += "}}";
- var ctor = new Function(code)();
- if (proto) {
- ctor.prototype = proto;
- ctor.BASE = base;
- }
- if (base) base.SUBCLASSES.push(ctor);
- ctor.prototype.CTOR = ctor;
- ctor.PROPS = props || null;
- ctor.SELF_PROPS = self_props;
- ctor.SUBCLASSES = [];
- if (type) {
- ctor.prototype.TYPE = ctor.TYPE = type;
- }
- if (methods) for (i in methods) if (methods.hasOwnProperty(i)) {
- if (/^\$/.test(i)) {
- ctor[i.substr(1)] = methods[i];
- } else {
- ctor.prototype[i] = methods[i];
- }
- }
- ctor.DEFMETHOD = function(name, method) {
- this.prototype[name] = method;
- };
- return ctor;
-};
-
-var AST_Token = DEFNODE("Token", "type value line col pos endpos nlb comments_before file", {
-}, null);
-
-var AST_Node = DEFNODE("Node", "start end", {
- clone: function() {
- return new this.CTOR(this);
- },
- $documentation: "Base class of all AST nodes",
- $propdoc: {
- start: "[AST_Token] The first token of this node",
- end: "[AST_Token] The last token of this node"
- },
- _walk: function(visitor) {
- return visitor._visit(this);
- },
- walk: function(visitor) {
- return this._walk(visitor); // not sure the indirection will be any help
- }
-}, null);
-
-AST_Node.warn_function = null;
-AST_Node.warn = function(txt, props) {
- if (AST_Node.warn_function)
- AST_Node.warn_function(string_template(txt, props));
-};
-
-/* -----[ statements ]----- */
-
-var AST_Statement = DEFNODE("Statement", null, {
- $documentation: "Base class of all statements",
-});
-
-var AST_Debugger = DEFNODE("Debugger", null, {
- $documentation: "Represents a debugger statement",
-}, AST_Statement);
-
-var AST_Directive = DEFNODE("Directive", "value scope", {
- $documentation: "Represents a directive, like \"use strict\";",
- $propdoc: {
- value: "[string] The value of this directive as a plain string (it's not an AST_String!)",
- scope: "[AST_Scope/S] The scope that this directive affects"
- },
-}, AST_Statement);
-
-var AST_SimpleStatement = DEFNODE("SimpleStatement", "body", {
- $documentation: "A statement consisting of an expression, i.e. a = 1 + 2",
- $propdoc: {
- body: "[AST_Node] an expression node (should not be instanceof AST_Statement)"
- },
- _walk: function(visitor) {
- return visitor._visit(this, function(){
- this.body._walk(visitor);
- });
- }
-}, AST_Statement);
-
-function walk_body(node, visitor) {
- if (node.body instanceof AST_Statement) {
- node.body._walk(visitor);
- }
- else node.body.forEach(function(stat){
- stat._walk(visitor);
- });
-};
-
-var AST_Block = DEFNODE("Block", "body", {
- $documentation: "A body of statements (usually bracketed)",
- $propdoc: {
- body: "[AST_Statement*] an array of statements"
- },
- _walk: function(visitor) {
- return visitor._visit(this, function(){
- walk_body(this, visitor);
- });
- }
-}, AST_Statement);
-
-var AST_BlockStatement = DEFNODE("BlockStatement", null, {
- $documentation: "A block statement",
-}, AST_Block);
-
-var AST_EmptyStatement = DEFNODE("EmptyStatement", null, {
- $documentation: "The empty statement (empty block or simply a semicolon)",
- _walk: function(visitor) {
- return visitor._visit(this);
- }
-}, AST_Statement);
-
-var AST_StatementWithBody = DEFNODE("StatementWithBody", "body", {
- $documentation: "Base class for all statements that contain one nested body: `For`, `ForIn`, `Do`, `While`, `With`",
- $propdoc: {
- body: "[AST_Statement] the body; this should always be present, even if it's an AST_EmptyStatement"
- },
- _walk: function(visitor) {
- return visitor._visit(this, function(){
- this.body._walk(visitor);
- });
- }
-}, AST_Statement);
-
-var AST_LabeledStatement = DEFNODE("LabeledStatement", "label", {
- $documentation: "Statement with a label",
- $propdoc: {
- label: "[AST_Label] a label definition"
- },
- _walk: function(visitor) {
- return visitor._visit(this, function(){
- this.label._walk(visitor);
- this.body._walk(visitor);
- });
- }
-}, AST_StatementWithBody);
-
-var AST_IterationStatement = DEFNODE("IterationStatement", null, {
- $documentation: "Internal class. All loops inherit from it."
-}, AST_StatementWithBody);
-
-var AST_DWLoop = DEFNODE("DWLoop", "condition", {
- $documentation: "Base class for do/while statements",
- $propdoc: {
- condition: "[AST_Node] the loop condition. Should not be instanceof AST_Statement"
- },
- _walk: function(visitor) {
- return visitor._visit(this, function(){
- this.condition._walk(visitor);
- this.body._walk(visitor);
- });
- }
-}, AST_IterationStatement);
-
-var AST_Do = DEFNODE("Do", null, {
- $documentation: "A `do` statement",
-}, AST_DWLoop);
-
-var AST_While = DEFNODE("While", null, {
- $documentation: "A `while` statement",
-}, AST_DWLoop);
-
-var AST_For = DEFNODE("For", "init condition step", {
- $documentation: "A `for` statement",
- $propdoc: {
- init: "[AST_Node?] the `for` initialization code, or null if empty",
- condition: "[AST_Node?] the `for` termination clause, or null if empty",
- step: "[AST_Node?] the `for` update clause, or null if empty"
- },
- _walk: function(visitor) {
- return visitor._visit(this, function(){
- if (this.init) this.init._walk(visitor);
- if (this.condition) this.condition._walk(visitor);
- if (this.step) this.step._walk(visitor);
- this.body._walk(visitor);
- });
- }
-}, AST_IterationStatement);
-
-var AST_ForIn = DEFNODE("ForIn", "init name object", {
- $documentation: "A `for ... in` statement",
- $propdoc: {
- init: "[AST_Node] the `for/in` initialization code",
- name: "[AST_SymbolRef?] the loop variable, only if `init` is AST_Var",
- object: "[AST_Node] the object that we're looping through"
- },
- _walk: function(visitor) {
- return visitor._visit(this, function(){
- this.init._walk(visitor);
- this.object._walk(visitor);
- this.body._walk(visitor);
- });
- }
-}, AST_IterationStatement);
-
-var AST_With = DEFNODE("With", "expression", {
- $documentation: "A `with` statement",
- $propdoc: {
- expression: "[AST_Node] the `with` expression"
- },
- _walk: function(visitor) {
- return visitor._visit(this, function(){
- this.expression._walk(visitor);
- this.body._walk(visitor);
- });
- }
-}, AST_StatementWithBody);
-
-/* -----[ scope and functions ]----- */
-
-var AST_Scope = DEFNODE("Scope", "directives variables functions uses_with uses_eval parent_scope enclosed cname", {
- $documentation: "Base class for all statements introducing a lexical scope",
- $propdoc: {
- directives: "[string*/S] an array of directives declared in this scope",
- variables: "[Object/S] a map of name -> SymbolDef for all variables/functions defined in this scope",
- functions: "[Object/S] like `variables`, but only lists function declarations",
- uses_with: "[boolean/S] tells whether this scope uses the `with` statement",
- uses_eval: "[boolean/S] tells whether this scope contains a direct call to the global `eval`",
- parent_scope: "[AST_Scope?/S] link to the parent scope",
- enclosed: "[SymbolDef*/S] a list of all symbol definitions that are accessed from this scope or any subscopes",
- cname: "[integer/S] current index for mangling variables (used internally by the mangler)",
- },
-}, AST_Block);
-
-var AST_Toplevel = DEFNODE("Toplevel", "globals", {
- $documentation: "The toplevel scope",
- $propdoc: {
- globals: "[Object/S] a map of name -> SymbolDef for all undeclared names",
- },
- wrap_enclose: function(arg_parameter_pairs) {
- var self = this;
- var args = [];
- var parameters = [];
-
- arg_parameter_pairs.forEach(function(pair) {
- var split = pair.split(":");
-
- args.push(split[0]);
- parameters.push(split[1]);
- });
-
- var wrapped_tl = "(function(" + parameters.join(",") + "){ '$ORIG'; })(" + args.join(",") + ")";
- wrapped_tl = parse(wrapped_tl);
- wrapped_tl = wrapped_tl.transform(new TreeTransformer(function before(node){
- if (node instanceof AST_Directive && node.value == "$ORIG") {
- return MAP.splice(self.body);
- }
- }));
- return wrapped_tl;
- },
- wrap_commonjs: function(name, export_all) {
- var self = this;
- var to_export = [];
- if (export_all) {
- self.figure_out_scope();
- self.walk(new TreeWalker(function(node){
- if (node instanceof AST_SymbolDeclaration && node.definition().global) {
- if (!find_if(function(n){ return n.name == node.name }, to_export))
- to_export.push(node);
- }
- }));
- }
- var wrapped_tl = "(function(exports, global){ global['" + name + "'] = exports; '$ORIG'; '$EXPORTS'; }({}, (function(){return this}())))";
- wrapped_tl = parse(wrapped_tl);
- wrapped_tl = wrapped_tl.transform(new TreeTransformer(function before(node){
- if (node instanceof AST_SimpleStatement) {
- node = node.body;
- if (node instanceof AST_String) switch (node.getValue()) {
- case "$ORIG":
- return MAP.splice(self.body);
- case "$EXPORTS":
- var body = [];
- to_export.forEach(function(sym){
- body.push(new AST_SimpleStatement({
- body: new AST_Assign({
- left: new AST_Sub({
- expression: new AST_SymbolRef({ name: "exports" }),
- property: new AST_String({ value: sym.name }),
- }),
- operator: "=",
- right: new AST_SymbolRef(sym),
- }),
- }));
- });
- return MAP.splice(body);
- }
- }
- }));
- return wrapped_tl;
- }
-}, AST_Scope);
-
-var AST_Lambda = DEFNODE("Lambda", "name argnames uses_arguments", {
- $documentation: "Base class for functions",
- $propdoc: {
- name: "[AST_SymbolDeclaration?] the name of this function",
- argnames: "[AST_SymbolFunarg*] array of function arguments",
- uses_arguments: "[boolean/S] tells whether this function accesses the arguments array"
- },
- _walk: function(visitor) {
- return visitor._visit(this, function(){
- if (this.name) this.name._walk(visitor);
- this.argnames.forEach(function(arg){
- arg._walk(visitor);
- });
- walk_body(this, visitor);
- });
- }
-}, AST_Scope);
-
-var AST_Accessor = DEFNODE("Accessor", null, {
- $documentation: "A setter/getter function. The `name` property is always null."
-}, AST_Lambda);
-
-var AST_Function = DEFNODE("Function", null, {
- $documentation: "A function expression"
-}, AST_Lambda);
-
-var AST_Defun = DEFNODE("Defun", null, {
- $documentation: "A function definition"
-}, AST_Lambda);
-
-/* -----[ JUMPS ]----- */
-
-var AST_Jump = DEFNODE("Jump", null, {
- $documentation: "Base class for “jumps” (for now that's `return`, `throw`, `break` and `continue`)"
-}, AST_Statement);
-
-var AST_Exit = DEFNODE("Exit", "value", {
- $documentation: "Base class for “exits” (`return` and `throw`)",
- $propdoc: {
- value: "[AST_Node?] the value returned or thrown by this statement; could be null for AST_Return"
- },
- _walk: function(visitor) {
- return visitor._visit(this, this.value && function(){
- this.value._walk(visitor);
- });
- }
-}, AST_Jump);
-
-var AST_Return = DEFNODE("Return", null, {
- $documentation: "A `return` statement"
-}, AST_Exit);
-
-var AST_Throw = DEFNODE("Throw", null, {
- $documentation: "A `throw` statement"
-}, AST_Exit);
-
-var AST_LoopControl = DEFNODE("LoopControl", "label", {
- $documentation: "Base class for loop control statements (`break` and `continue`)",
- $propdoc: {
- label: "[AST_LabelRef?] the label, or null if none",
- },
- _walk: function(visitor) {
- return visitor._visit(this, this.label && function(){
- this.label._walk(visitor);
- });
- }
-}, AST_Jump);
-
-var AST_Break = DEFNODE("Break", null, {
- $documentation: "A `break` statement"
-}, AST_LoopControl);
-
-var AST_Continue = DEFNODE("Continue", null, {
- $documentation: "A `continue` statement"
-}, AST_LoopControl);
-
-/* -----[ IF ]----- */
-
-var AST_If = DEFNODE("If", "condition alternative", {
- $documentation: "A `if` statement",
- $propdoc: {
- condition: "[AST_Node] the `if` condition",
- alternative: "[AST_Statement?] the `else` part, or null if not present"
- },
- _walk: function(visitor) {
- return visitor._visit(this, function(){
- this.condition._walk(visitor);
- this.body._walk(visitor);
- if (this.alternative) this.alternative._walk(visitor);
- });
- }
-}, AST_StatementWithBody);
-
-/* -----[ SWITCH ]----- */
-
-var AST_Switch = DEFNODE("Switch", "expression", {
- $documentation: "A `switch` statement",
- $propdoc: {
- expression: "[AST_Node] the `switch` “discriminant”"
- },
- _walk: function(visitor) {
- return visitor._visit(this, function(){
- this.expression._walk(visitor);
- walk_body(this, visitor);
- });
- }
-}, AST_Block);
-
-var AST_SwitchBranch = DEFNODE("SwitchBranch", null, {
- $documentation: "Base class for `switch` branches",
-}, AST_Block);
-
-var AST_Default = DEFNODE("Default", null, {
- $documentation: "A `default` switch branch",
-}, AST_SwitchBranch);
-
-var AST_Case = DEFNODE("Case", "expression", {
- $documentation: "A `case` switch branch",
- $propdoc: {
- expression: "[AST_Node] the `case` expression"
- },
- _walk: function(visitor) {
- return visitor._visit(this, function(){
- this.expression._walk(visitor);
- walk_body(this, visitor);
- });
- }
-}, AST_SwitchBranch);
-
-/* -----[ EXCEPTIONS ]----- */
-
-var AST_Try = DEFNODE("Try", "bcatch bfinally", {
- $documentation: "A `try` statement",
- $propdoc: {
- bcatch: "[AST_Catch?] the catch block, or null if not present",
- bfinally: "[AST_Finally?] the finally block, or null if not present"
- },
- _walk: function(visitor) {
- return visitor._visit(this, function(){
- walk_body(this, visitor);
- if (this.bcatch) this.bcatch._walk(visitor);
- if (this.bfinally) this.bfinally._walk(visitor);
- });
- }
-}, AST_Block);
-
-var AST_Catch = DEFNODE("Catch", "argname", {
- $documentation: "A `catch` node; only makes sense as part of a `try` statement",
- $propdoc: {
- argname: "[AST_SymbolCatch] symbol for the exception"
- },
- _walk: function(visitor) {
- return visitor._visit(this, function(){
- this.argname._walk(visitor);
- walk_body(this, visitor);
- });
- }
-}, AST_Block);
-
-var AST_Finally = DEFNODE("Finally", null, {
- $documentation: "A `finally` node; only makes sense as part of a `try` statement"
-}, AST_Block);
-
-/* -----[ VAR/CONST ]----- */
-
-var AST_Definitions = DEFNODE("Definitions", "definitions", {
- $documentation: "Base class for `var` or `const` nodes (variable declarations/initializations)",
- $propdoc: {
- definitions: "[AST_VarDef*] array of variable definitions"
- },
- _walk: function(visitor) {
- return visitor._visit(this, function(){
- this.definitions.forEach(function(def){
- def._walk(visitor);
- });
- });
- }
-}, AST_Statement);
-
-var AST_Var = DEFNODE("Var", null, {
- $documentation: "A `var` statement"
-}, AST_Definitions);
-
-var AST_Const = DEFNODE("Const", null, {
- $documentation: "A `const` statement"
-}, AST_Definitions);
-
-var AST_VarDef = DEFNODE("VarDef", "name value", {
- $documentation: "A variable declaration; only appears in a AST_Definitions node",
- $propdoc: {
- name: "[AST_SymbolVar|AST_SymbolConst] name of the variable",
- value: "[AST_Node?] initializer, or null of there's no initializer"
- },
- _walk: function(visitor) {
- return visitor._visit(this, function(){
- this.name._walk(visitor);
- if (this.value) this.value._walk(visitor);
- });
- }
-});
-
-/* -----[ OTHER ]----- */
-
-var AST_Call = DEFNODE("Call", "expression args", {
- $documentation: "A function call expression",
- $propdoc: {
- expression: "[AST_Node] expression to invoke as function",
- args: "[AST_Node*] array of arguments"
- },
- _walk: function(visitor) {
- return visitor._visit(this, function(){
- this.expression._walk(visitor);
- this.args.forEach(function(arg){
- arg._walk(visitor);
- });
- });
- }
-});
-
-var AST_New = DEFNODE("New", null, {
- $documentation: "An object instantiation. Derives from a function call since it has exactly the same properties"
-}, AST_Call);
-
-var AST_Seq = DEFNODE("Seq", "car cdr", {
- $documentation: "A sequence expression (two comma-separated expressions)",
- $propdoc: {
- car: "[AST_Node] first element in sequence",
- cdr: "[AST_Node] second element in sequence"
- },
- $cons: function(x, y) {
- var seq = new AST_Seq(x);
- seq.car = x;
- seq.cdr = y;
- return seq;
- },
- $from_array: function(array) {
- if (array.length == 0) return null;
- if (array.length == 1) return array[0].clone();
- var list = null;
- for (var i = array.length; --i >= 0;) {
- list = AST_Seq.cons(array[i], list);
- }
- var p = list;
- while (p) {
- if (p.cdr && !p.cdr.cdr) {
- p.cdr = p.cdr.car;
- break;
- }
- p = p.cdr;
- }
- return list;
- },
- to_array: function() {
- var p = this, a = [];
- while (p) {
- a.push(p.car);
- if (p.cdr && !(p.cdr instanceof AST_Seq)) {
- a.push(p.cdr);
- break;
- }
- p = p.cdr;
- }
- return a;
- },
- add: function(node) {
- var p = this;
- while (p) {
- if (!(p.cdr instanceof AST_Seq)) {
- var cell = AST_Seq.cons(p.cdr, node);
- return p.cdr = cell;
- }
- p = p.cdr;
- }
- },
- _walk: function(visitor) {
- return visitor._visit(this, function(){
- this.car._walk(visitor);
- if (this.cdr) this.cdr._walk(visitor);
- });
- }
-});
-
-var AST_PropAccess = DEFNODE("PropAccess", "expression property", {
- $documentation: "Base class for property access expressions, i.e. `a.foo` or `a[\"foo\"]`",
- $propdoc: {
- expression: "[AST_Node] the “container” expression",
- property: "[AST_Node|string] the property to access. For AST_Dot this is always a plain string, while for AST_Sub it's an arbitrary AST_Node"
- }
-});
-
-var AST_Dot = DEFNODE("Dot", null, {
- $documentation: "A dotted property access expression",
- _walk: function(visitor) {
- return visitor._visit(this, function(){
- this.expression._walk(visitor);
- });
- }
-}, AST_PropAccess);
-
-var AST_Sub = DEFNODE("Sub", null, {
- $documentation: "Index-style property access, i.e. `a[\"foo\"]`",
- _walk: function(visitor) {
- return visitor._visit(this, function(){
- this.expression._walk(visitor);
- this.property._walk(visitor);
- });
- }
-}, AST_PropAccess);
-
-var AST_Unary = DEFNODE("Unary", "operator expression", {
- $documentation: "Base class for unary expressions",
- $propdoc: {
- operator: "[string] the operator",
- expression: "[AST_Node] expression that this unary operator applies to"
- },
- _walk: function(visitor) {
- return visitor._visit(this, function(){
- this.expression._walk(visitor);
- });
- }
-});
-
-var AST_UnaryPrefix = DEFNODE("UnaryPrefix", null, {
- $documentation: "Unary prefix expression, i.e. `typeof i` or `++i`"
-}, AST_Unary);
-
-var AST_UnaryPostfix = DEFNODE("UnaryPostfix", null, {
- $documentation: "Unary postfix expression, i.e. `i++`"
-}, AST_Unary);
-
-var AST_Binary = DEFNODE("Binary", "left operator right", {
- $documentation: "Binary expression, i.e. `a + b`",
- $propdoc: {
- left: "[AST_Node] left-hand side expression",
- operator: "[string] the operator",
- right: "[AST_Node] right-hand side expression"
- },
- _walk: function(visitor) {
- return visitor._visit(this, function(){
- this.left._walk(visitor);
- this.right._walk(visitor);
- });
- }
-});
-
-var AST_Conditional = DEFNODE("Conditional", "condition consequent alternative", {
- $documentation: "Conditional expression using the ternary operator, i.e. `a ? b : c`",
- $propdoc: {
- condition: "[AST_Node]",
- consequent: "[AST_Node]",
- alternative: "[AST_Node]"
- },
- _walk: function(visitor) {
- return visitor._visit(this, function(){
- this.condition._walk(visitor);
- this.consequent._walk(visitor);
- this.alternative._walk(visitor);
- });
- }
-});
-
-var AST_Assign = DEFNODE("Assign", null, {
- $documentation: "An assignment expression — `a = b + 5`",
-}, AST_Binary);
-
-/* -----[ LITERALS ]----- */
-
-var AST_Array = DEFNODE("Array", "elements", {
- $documentation: "An array literal",
- $propdoc: {
- elements: "[AST_Node*] array of elements"
- },
- _walk: function(visitor) {
- return visitor._visit(this, function(){
- this.elements.forEach(function(el){
- el._walk(visitor);
- });
- });
- }
-});
-
-var AST_Object = DEFNODE("Object", "properties", {
- $documentation: "An object literal",
- $propdoc: {
- properties: "[AST_ObjectProperty*] array of properties"
- },
- _walk: function(visitor) {
- return visitor._visit(this, function(){
- this.properties.forEach(function(prop){
- prop._walk(visitor);
- });
- });
- }
-});
-
-var AST_ObjectProperty = DEFNODE("ObjectProperty", "key value", {
- $documentation: "Base class for literal object properties",
- $propdoc: {
- key: "[string] the property name converted to a string for ObjectKeyVal. For setters and getters this is an arbitrary AST_Node.",
- value: "[AST_Node] property value. For setters and getters this is an AST_Function."
- },
- _walk: function(visitor) {
- return visitor._visit(this, function(){
- this.value._walk(visitor);
- });
- }
-});
-
-var AST_ObjectKeyVal = DEFNODE("ObjectKeyVal", null, {
- $documentation: "A key: value object property",
-}, AST_ObjectProperty);
-
-var AST_ObjectSetter = DEFNODE("ObjectSetter", null, {
- $documentation: "An object setter property",
-}, AST_ObjectProperty);
-
-var AST_ObjectGetter = DEFNODE("ObjectGetter", null, {
- $documentation: "An object getter property",
-}, AST_ObjectProperty);
-
-var AST_Symbol = DEFNODE("Symbol", "scope name thedef", {
- $propdoc: {
- name: "[string] name of this symbol",
- scope: "[AST_Scope/S] the current scope (not necessarily the definition scope)",
- thedef: "[SymbolDef/S] the definition of this symbol"
- },
- $documentation: "Base class for all symbols",
-});
-
-var AST_SymbolAccessor = DEFNODE("SymbolAccessor", null, {
- $documentation: "The name of a property accessor (setter/getter function)"
-}, AST_Symbol);
-
-var AST_SymbolDeclaration = DEFNODE("SymbolDeclaration", "init", {
- $documentation: "A declaration symbol (symbol in var/const, function name or argument, symbol in catch)",
- $propdoc: {
- init: "[AST_Node*/S] array of initializers for this declaration."
- }
-}, AST_Symbol);
-
-var AST_SymbolVar = DEFNODE("SymbolVar", null, {
- $documentation: "Symbol defining a variable",
-}, AST_SymbolDeclaration);
-
-var AST_SymbolConst = DEFNODE("SymbolConst", null, {
- $documentation: "A constant declaration"
-}, AST_SymbolDeclaration);
-
-var AST_SymbolFunarg = DEFNODE("SymbolFunarg", null, {
- $documentation: "Symbol naming a function argument",
-}, AST_SymbolVar);
-
-var AST_SymbolDefun = DEFNODE("SymbolDefun", null, {
- $documentation: "Symbol defining a function",
-}, AST_SymbolDeclaration);
-
-var AST_SymbolLambda = DEFNODE("SymbolLambda", null, {
- $documentation: "Symbol naming a function expression",
-}, AST_SymbolDeclaration);
-
-var AST_SymbolCatch = DEFNODE("SymbolCatch", null, {
- $documentation: "Symbol naming the exception in catch",
-}, AST_SymbolDeclaration);
-
-var AST_Label = DEFNODE("Label", "references", {
- $documentation: "Symbol naming a label (declaration)",
- $propdoc: {
- references: "[AST_LoopControl*] a list of nodes referring to this label"
- },
- initialize: function() {
- this.references = [];
- this.thedef = this;
- }
-}, AST_Symbol);
-
-var AST_SymbolRef = DEFNODE("SymbolRef", null, {
- $documentation: "Reference to some symbol (not definition/declaration)",
-}, AST_Symbol);
-
-var AST_LabelRef = DEFNODE("LabelRef", null, {
- $documentation: "Reference to a label symbol",
-}, AST_Symbol);
-
-var AST_This = DEFNODE("This", null, {
- $documentation: "The `this` symbol",
-}, AST_Symbol);
-
-var AST_Constant = DEFNODE("Constant", null, {
- $documentation: "Base class for all constants",
- getValue: function() {
- return this.value;
- }
-});
-
-var AST_String = DEFNODE("String", "value", {
- $documentation: "A string literal",
- $propdoc: {
- value: "[string] the contents of this string"
- }
-}, AST_Constant);
-
-var AST_Number = DEFNODE("Number", "value", {
- $documentation: "A number literal",
- $propdoc: {
- value: "[number] the numeric value"
- }
-}, AST_Constant);
-
-var AST_RegExp = DEFNODE("RegExp", "value", {
- $documentation: "A regexp literal",
- $propdoc: {
- value: "[RegExp] the actual regexp"
- }
-}, AST_Constant);
-
-var AST_Atom = DEFNODE("Atom", null, {
- $documentation: "Base class for atoms",
-}, AST_Constant);
-
-var AST_Null = DEFNODE("Null", null, {
- $documentation: "The `null` atom",
- value: null
-}, AST_Atom);
-
-var AST_NaN = DEFNODE("NaN", null, {
- $documentation: "The impossible value",
- value: 0/0
-}, AST_Atom);
-
-var AST_Undefined = DEFNODE("Undefined", null, {
- $documentation: "The `undefined` value",
- value: (function(){}())
-}, AST_Atom);
-
-var AST_Hole = DEFNODE("Hole", null, {
- $documentation: "A hole in an array",
- value: (function(){}())
-}, AST_Atom);
-
-var AST_Infinity = DEFNODE("Infinity", null, {
- $documentation: "The `Infinity` value",
- value: 1/0
-}, AST_Atom);
-
-var AST_Boolean = DEFNODE("Boolean", null, {
- $documentation: "Base class for booleans",
-}, AST_Atom);
-
-var AST_False = DEFNODE("False", null, {
- $documentation: "The `false` atom",
- value: false
-}, AST_Boolean);
-
-var AST_True = DEFNODE("True", null, {
- $documentation: "The `true` atom",
- value: true
-}, AST_Boolean);
-
-/* -----[ TreeWalker ]----- */
-
-function TreeWalker(callback) {
- this.visit = callback;
- this.stack = [];
-};
-TreeWalker.prototype = {
- _visit: function(node, descend) {
- this.stack.push(node);
- var ret = this.visit(node, descend ? function(){
- descend.call(node);
- } : noop);
- if (!ret && descend) {
- descend.call(node);
- }
- this.stack.pop();
- return ret;
- },
- parent: function(n) {
- return this.stack[this.stack.length - 2 - (n || 0)];
- },
- push: function (node) {
- this.stack.push(node);
- },
- pop: function() {
- return this.stack.pop();
- },
- self: function() {
- return this.stack[this.stack.length - 1];
- },
- find_parent: function(type) {
- var stack = this.stack;
- for (var i = stack.length; --i >= 0;) {
- var x = stack[i];
- if (x instanceof type) return x;
- }
- },
- has_directive: function(type) {
- return this.find_parent(AST_Scope).has_directive(type);
- },
- in_boolean_context: function() {
- var stack = this.stack;
- var i = stack.length, self = stack[--i];
- while (i > 0) {
- var p = stack[--i];
- if ((p instanceof AST_If && p.condition === self) ||
- (p instanceof AST_Conditional && p.condition === self) ||
- (p instanceof AST_DWLoop && p.condition === self) ||
- (p instanceof AST_For && p.condition === self) ||
- (p instanceof AST_UnaryPrefix && p.operator == "!" && p.expression === self))
- {
- return true;
- }
- if (!(p instanceof AST_Binary && (p.operator == "&&" || p.operator == "||")))
- return false;
- self = p;
- }
- },
- loopcontrol_target: function(label) {
- var stack = this.stack;
- if (label) for (var i = stack.length; --i >= 0;) {
- var x = stack[i];
- if (x instanceof AST_LabeledStatement && x.label.name == label.name) {
- return x.body;
- }
- } else for (var i = stack.length; --i >= 0;) {
- var x = stack[i];
- if (x instanceof AST_Switch || x instanceof AST_IterationStatement)
- return x;
- }
- }
-};
diff --git a/builder/node_modules/uglify-js/lib/compress.js b/builder/node_modules/uglify-js/lib/compress.js
deleted file mode 100644
index b589aca5..00000000
--- a/builder/node_modules/uglify-js/lib/compress.js
+++ /dev/null
@@ -1,2374 +0,0 @@
-/***********************************************************************
-
- A JavaScript tokenizer / parser / beautifier / compressor.
- https://github.com/mishoo/UglifyJS2
-
- -------------------------------- (C) ---------------------------------
-
- Author: Mihai Bazon
-
- http://mihai.bazon.net/blog
-
- Distributed under the BSD license:
-
- Copyright 2012 (c) Mihai Bazon
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- * Redistributions of source code must retain the above
- copyright notice, this list of conditions and the following
- disclaimer.
-
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials
- provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
- TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
- THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
-
- ***********************************************************************/
-
-"use strict";
-
-function Compressor(options, false_by_default) {
- if (!(this instanceof Compressor))
- return new Compressor(options, false_by_default);
- TreeTransformer.call(this, this.before, this.after);
- this.options = defaults(options, {
- sequences : !false_by_default,
- properties : !false_by_default,
- dead_code : !false_by_default,
- drop_debugger : !false_by_default,
- unsafe : false,
- unsafe_comps : false,
- conditionals : !false_by_default,
- comparisons : !false_by_default,
- evaluate : !false_by_default,
- booleans : !false_by_default,
- loops : !false_by_default,
- unused : !false_by_default,
- hoist_funs : !false_by_default,
- keep_fargs : false,
- hoist_vars : false,
- if_return : !false_by_default,
- join_vars : !false_by_default,
- cascade : !false_by_default,
- side_effects : !false_by_default,
- pure_getters : false,
- pure_funcs : null,
- negate_iife : !false_by_default,
- screw_ie8 : false,
- drop_console : false,
- angular : false,
-
- warnings : true,
- global_defs : {}
- }, true);
-};
-
-Compressor.prototype = new TreeTransformer;
-merge(Compressor.prototype, {
- option: function(key) { return this.options[key] },
- warn: function() {
- if (this.options.warnings)
- AST_Node.warn.apply(AST_Node, arguments);
- },
- before: function(node, descend, in_list) {
- if (node._squeezed) return node;
- var was_scope = false;
- if (node instanceof AST_Scope) {
- node = node.hoist_declarations(this);
- was_scope = true;
- }
- descend(node, this);
- node = node.optimize(this);
- if (was_scope && node instanceof AST_Scope) {
- node.drop_unused(this);
- descend(node, this);
- }
- node._squeezed = true;
- return node;
- }
-});
-
-(function(){
-
- function OPT(node, optimizer) {
- node.DEFMETHOD("optimize", function(compressor){
- var self = this;
- if (self._optimized) return self;
- var opt = optimizer(self, compressor);
- opt._optimized = true;
- if (opt === self) return opt;
- return opt.transform(compressor);
- });
- };
-
- OPT(AST_Node, function(self, compressor){
- return self;
- });
-
- AST_Node.DEFMETHOD("equivalent_to", function(node){
- // XXX: this is a rather expensive way to test two node's equivalence:
- return this.print_to_string() == node.print_to_string();
- });
-
- function make_node(ctor, orig, props) {
- if (!props) props = {};
- if (orig) {
- if (!props.start) props.start = orig.start;
- if (!props.end) props.end = orig.end;
- }
- return new ctor(props);
- };
-
- function make_node_from_constant(compressor, val, orig) {
- // XXX: WIP.
- // if (val instanceof AST_Node) return val.transform(new TreeTransformer(null, function(node){
- // if (node instanceof AST_SymbolRef) {
- // var scope = compressor.find_parent(AST_Scope);
- // var def = scope.find_variable(node);
- // node.thedef = def;
- // return node;
- // }
- // })).transform(compressor);
-
- if (val instanceof AST_Node) return val.transform(compressor);
- switch (typeof val) {
- case "string":
- return make_node(AST_String, orig, {
- value: val
- }).optimize(compressor);
- case "number":
- return make_node(isNaN(val) ? AST_NaN : AST_Number, orig, {
- value: val
- }).optimize(compressor);
- case "boolean":
- return make_node(val ? AST_True : AST_False, orig).optimize(compressor);
- case "undefined":
- return make_node(AST_Undefined, orig).optimize(compressor);
- default:
- if (val === null) {
- return make_node(AST_Null, orig).optimize(compressor);
- }
- if (val instanceof RegExp) {
- return make_node(AST_RegExp, orig).optimize(compressor);
- }
- throw new Error(string_template("Can't handle constant of type: {type}", {
- type: typeof val
- }));
- }
- };
-
- function as_statement_array(thing) {
- if (thing === null) return [];
- if (thing instanceof AST_BlockStatement) return thing.body;
- if (thing instanceof AST_EmptyStatement) return [];
- if (thing instanceof AST_Statement) return [ thing ];
- throw new Error("Can't convert thing to statement array");
- };
-
- function is_empty(thing) {
- if (thing === null) return true;
- if (thing instanceof AST_EmptyStatement) return true;
- if (thing instanceof AST_BlockStatement) return thing.body.length == 0;
- return false;
- };
-
- function loop_body(x) {
- if (x instanceof AST_Switch) return x;
- if (x instanceof AST_For || x instanceof AST_ForIn || x instanceof AST_DWLoop) {
- return (x.body instanceof AST_BlockStatement ? x.body : x);
- }
- return x;
- };
-
- function tighten_body(statements, compressor) {
- var CHANGED;
- do {
- CHANGED = false;
- if (compressor.option("angular")) {
- statements = process_for_angular(statements);
- }
- statements = eliminate_spurious_blocks(statements);
- if (compressor.option("dead_code")) {
- statements = eliminate_dead_code(statements, compressor);
- }
- if (compressor.option("if_return")) {
- statements = handle_if_return(statements, compressor);
- }
- if (compressor.option("sequences")) {
- statements = sequencesize(statements, compressor);
- }
- if (compressor.option("join_vars")) {
- statements = join_consecutive_vars(statements, compressor);
- }
- } while (CHANGED);
-
- if (compressor.option("negate_iife")) {
- negate_iifes(statements, compressor);
- }
-
- return statements;
-
- function process_for_angular(statements) {
- function make_injector(func, name) {
- return make_node(AST_SimpleStatement, func, {
- body: make_node(AST_Assign, func, {
- operator: "=",
- left: make_node(AST_Dot, name, {
- expression: make_node(AST_SymbolRef, name, name),
- property: "$inject"
- }),
- right: make_node(AST_Array, func, {
- elements: func.argnames.map(function(sym){
- return make_node(AST_String, sym, { value: sym.name });
- })
- })
- })
- });
- }
- return statements.reduce(function(a, stat){
- a.push(stat);
- var token = stat.start;
- var comments = token.comments_before;
- if (comments && comments.length > 0) {
- var last = comments.pop();
- if (/@ngInject/.test(last.value)) {
- // case 1: defun
- if (stat instanceof AST_Defun) {
- a.push(make_injector(stat, stat.name));
- }
- else if (stat instanceof AST_Definitions) {
- stat.definitions.forEach(function(def){
- if (def.value && def.value instanceof AST_Lambda) {
- a.push(make_injector(def.value, def.name));
- }
- });
- }
- else {
- compressor.warn("Unknown statement marked with @ngInject [{file}:{line},{col}]", token);
- }
- }
- }
- return a;
- }, []);
- }
-
- function eliminate_spurious_blocks(statements) {
- var seen_dirs = [];
- return statements.reduce(function(a, stat){
- if (stat instanceof AST_BlockStatement) {
- CHANGED = true;
- a.push.apply(a, eliminate_spurious_blocks(stat.body));
- } else if (stat instanceof AST_EmptyStatement) {
- CHANGED = true;
- } else if (stat instanceof AST_Directive) {
- if (seen_dirs.indexOf(stat.value) < 0) {
- a.push(stat);
- seen_dirs.push(stat.value);
- } else {
- CHANGED = true;
- }
- } else {
- a.push(stat);
- }
- return a;
- }, []);
- };
-
- function handle_if_return(statements, compressor) {
- var self = compressor.self();
- var in_lambda = self instanceof AST_Lambda;
- var ret = [];
- loop: for (var i = statements.length; --i >= 0;) {
- var stat = statements[i];
- switch (true) {
- case (in_lambda && stat instanceof AST_Return && !stat.value && ret.length == 0):
- CHANGED = true;
- // note, ret.length is probably always zero
- // because we drop unreachable code before this
- // step. nevertheless, it's good to check.
- continue loop;
- case stat instanceof AST_If:
- if (stat.body instanceof AST_Return) {
- //---
- // pretty silly case, but:
- // if (foo()) return; return; ==> foo(); return;
- if (((in_lambda && ret.length == 0)
- || (ret[0] instanceof AST_Return && !ret[0].value))
- && !stat.body.value && !stat.alternative) {
- CHANGED = true;
- var cond = make_node(AST_SimpleStatement, stat.condition, {
- body: stat.condition
- });
- ret.unshift(cond);
- continue loop;
- }
- //---
- // if (foo()) return x; return y; ==> return foo() ? x : y;
- if (ret[0] instanceof AST_Return && stat.body.value && ret[0].value && !stat.alternative) {
- CHANGED = true;
- stat = stat.clone();
- stat.alternative = ret[0];
- ret[0] = stat.transform(compressor);
- continue loop;
- }
- //---
- // if (foo()) return x; [ return ; ] ==> return foo() ? x : undefined;
- if ((ret.length == 0 || ret[0] instanceof AST_Return) && stat.body.value && !stat.alternative && in_lambda) {
- CHANGED = true;
- stat = stat.clone();
- stat.alternative = ret[0] || make_node(AST_Return, stat, {
- value: make_node(AST_Undefined, stat)
- });
- ret[0] = stat.transform(compressor);
- continue loop;
- }
- //---
- // if (foo()) return; [ else x... ]; y... ==> if (!foo()) { x...; y... }
- if (!stat.body.value && in_lambda) {
- CHANGED = true;
- stat = stat.clone();
- stat.condition = stat.condition.negate(compressor);
- stat.body = make_node(AST_BlockStatement, stat, {
- body: as_statement_array(stat.alternative).concat(ret)
- });
- stat.alternative = null;
- ret = [ stat.transform(compressor) ];
- continue loop;
- }
- //---
- if (ret.length == 1 && in_lambda && ret[0] instanceof AST_SimpleStatement
- && (!stat.alternative || stat.alternative instanceof AST_SimpleStatement)) {
- CHANGED = true;
- ret.push(make_node(AST_Return, ret[0], {
- value: make_node(AST_Undefined, ret[0])
- }).transform(compressor));
- ret = as_statement_array(stat.alternative).concat(ret);
- ret.unshift(stat);
- continue loop;
- }
- }
-
- var ab = aborts(stat.body);
- var lct = ab instanceof AST_LoopControl ? compressor.loopcontrol_target(ab.label) : null;
- if (ab && ((ab instanceof AST_Return && !ab.value && in_lambda)
- || (ab instanceof AST_Continue && self === loop_body(lct))
- || (ab instanceof AST_Break && lct instanceof AST_BlockStatement && self === lct))) {
- if (ab.label) {
- remove(ab.label.thedef.references, ab);
- }
- CHANGED = true;
- var body = as_statement_array(stat.body).slice(0, -1);
- stat = stat.clone();
- stat.condition = stat.condition.negate(compressor);
- stat.body = make_node(AST_BlockStatement, stat, {
- body: as_statement_array(stat.alternative).concat(ret)
- });
- stat.alternative = make_node(AST_BlockStatement, stat, {
- body: body
- });
- ret = [ stat.transform(compressor) ];
- continue loop;
- }
-
- var ab = aborts(stat.alternative);
- var lct = ab instanceof AST_LoopControl ? compressor.loopcontrol_target(ab.label) : null;
- if (ab && ((ab instanceof AST_Return && !ab.value && in_lambda)
- || (ab instanceof AST_Continue && self === loop_body(lct))
- || (ab instanceof AST_Break && lct instanceof AST_BlockStatement && self === lct))) {
- if (ab.label) {
- remove(ab.label.thedef.references, ab);
- }
- CHANGED = true;
- stat = stat.clone();
- stat.body = make_node(AST_BlockStatement, stat.body, {
- body: as_statement_array(stat.body).concat(ret)
- });
- stat.alternative = make_node(AST_BlockStatement, stat.alternative, {
- body: as_statement_array(stat.alternative).slice(0, -1)
- });
- ret = [ stat.transform(compressor) ];
- continue loop;
- }
-
- ret.unshift(stat);
- break;
- default:
- ret.unshift(stat);
- break;
- }
- }
- return ret;
- };
-
- function eliminate_dead_code(statements, compressor) {
- var has_quit = false;
- var orig = statements.length;
- var self = compressor.self();
- statements = statements.reduce(function(a, stat){
- if (has_quit) {
- extract_declarations_from_unreachable_code(compressor, stat, a);
- } else {
- if (stat instanceof AST_LoopControl) {
- var lct = compressor.loopcontrol_target(stat.label);
- if ((stat instanceof AST_Break
- && lct instanceof AST_BlockStatement
- && loop_body(lct) === self) || (stat instanceof AST_Continue
- && loop_body(lct) === self)) {
- if (stat.label) {
- remove(stat.label.thedef.references, stat);
- }
- } else {
- a.push(stat);
- }
- } else {
- a.push(stat);
- }
- if (aborts(stat)) has_quit = true;
- }
- return a;
- }, []);
- CHANGED = statements.length != orig;
- return statements;
- };
-
- function sequencesize(statements, compressor) {
- if (statements.length < 2) return statements;
- var seq = [], ret = [];
- function push_seq() {
- seq = AST_Seq.from_array(seq);
- if (seq) ret.push(make_node(AST_SimpleStatement, seq, {
- body: seq
- }));
- seq = [];
- };
- statements.forEach(function(stat){
- if (stat instanceof AST_SimpleStatement) seq.push(stat.body);
- else push_seq(), ret.push(stat);
- });
- push_seq();
- ret = sequencesize_2(ret, compressor);
- CHANGED = ret.length != statements.length;
- return ret;
- };
-
- function sequencesize_2(statements, compressor) {
- function cons_seq(right) {
- ret.pop();
- var left = prev.body;
- if (left instanceof AST_Seq) {
- left.add(right);
- } else {
- left = AST_Seq.cons(left, right);
- }
- return left.transform(compressor);
- };
- var ret = [], prev = null;
- statements.forEach(function(stat){
- if (prev) {
- if (stat instanceof AST_For) {
- var opera = {};
- try {
- prev.body.walk(new TreeWalker(function(node){
- if (node instanceof AST_Binary && node.operator == "in")
- throw opera;
- }));
- if (stat.init && !(stat.init instanceof AST_Definitions)) {
- stat.init = cons_seq(stat.init);
- }
- else if (!stat.init) {
- stat.init = prev.body;
- ret.pop();
- }
- } catch(ex) {
- if (ex !== opera) throw ex;
- }
- }
- else if (stat instanceof AST_If) {
- stat.condition = cons_seq(stat.condition);
- }
- else if (stat instanceof AST_With) {
- stat.expression = cons_seq(stat.expression);
- }
- else if (stat instanceof AST_Exit && stat.value) {
- stat.value = cons_seq(stat.value);
- }
- else if (stat instanceof AST_Exit) {
- stat.value = cons_seq(make_node(AST_Undefined, stat));
- }
- else if (stat instanceof AST_Switch) {
- stat.expression = cons_seq(stat.expression);
- }
- }
- ret.push(stat);
- prev = stat instanceof AST_SimpleStatement ? stat : null;
- });
- return ret;
- };
-
- function join_consecutive_vars(statements, compressor) {
- var prev = null;
- return statements.reduce(function(a, stat){
- if (stat instanceof AST_Definitions && prev && prev.TYPE == stat.TYPE) {
- prev.definitions = prev.definitions.concat(stat.definitions);
- CHANGED = true;
- }
- else if (stat instanceof AST_For
- && prev instanceof AST_Definitions
- && (!stat.init || stat.init.TYPE == prev.TYPE)) {
- CHANGED = true;
- a.pop();
- if (stat.init) {
- stat.init.definitions = prev.definitions.concat(stat.init.definitions);
- } else {
- stat.init = prev;
- }
- a.push(stat);
- prev = stat;
- }
- else {
- prev = stat;
- a.push(stat);
- }
- return a;
- }, []);
- };
-
- function negate_iifes(statements, compressor) {
- statements.forEach(function(stat){
- if (stat instanceof AST_SimpleStatement) {
- stat.body = (function transform(thing) {
- return thing.transform(new TreeTransformer(function(node){
- if (node instanceof AST_Call && node.expression instanceof AST_Function) {
- return make_node(AST_UnaryPrefix, node, {
- operator: "!",
- expression: node
- });
- }
- else if (node instanceof AST_Call) {
- node.expression = transform(node.expression);
- }
- else if (node instanceof AST_Seq) {
- node.car = transform(node.car);
- }
- else if (node instanceof AST_Conditional) {
- var expr = transform(node.condition);
- if (expr !== node.condition) {
- // it has been negated, reverse
- node.condition = expr;
- var tmp = node.consequent;
- node.consequent = node.alternative;
- node.alternative = tmp;
- }
- }
- return node;
- }));
- })(stat.body);
- }
- });
- };
-
- };
-
- function extract_declarations_from_unreachable_code(compressor, stat, target) {
- compressor.warn("Dropping unreachable code [{file}:{line},{col}]", stat.start);
- stat.walk(new TreeWalker(function(node){
- if (node instanceof AST_Definitions) {
- compressor.warn("Declarations in unreachable code! [{file}:{line},{col}]", node.start);
- node.remove_initializers();
- target.push(node);
- return true;
- }
- if (node instanceof AST_Defun) {
- target.push(node);
- return true;
- }
- if (node instanceof AST_Scope) {
- return true;
- }
- }));
- };
-
- /* -----[ boolean/negation helpers ]----- */
-
- // methods to determine whether an expression has a boolean result type
- (function (def){
- var unary_bool = [ "!", "delete" ];
- var binary_bool = [ "in", "instanceof", "==", "!=", "===", "!==", "<", "<=", ">=", ">" ];
- def(AST_Node, function(){ return false });
- def(AST_UnaryPrefix, function(){
- return member(this.operator, unary_bool);
- });
- def(AST_Binary, function(){
- return member(this.operator, binary_bool) ||
- ( (this.operator == "&&" || this.operator == "||") &&
- this.left.is_boolean() && this.right.is_boolean() );
- });
- def(AST_Conditional, function(){
- return this.consequent.is_boolean() && this.alternative.is_boolean();
- });
- def(AST_Assign, function(){
- return this.operator == "=" && this.right.is_boolean();
- });
- def(AST_Seq, function(){
- return this.cdr.is_boolean();
- });
- def(AST_True, function(){ return true });
- def(AST_False, function(){ return true });
- })(function(node, func){
- node.DEFMETHOD("is_boolean", func);
- });
-
- // methods to determine if an expression has a string result type
- (function (def){
- def(AST_Node, function(){ return false });
- def(AST_String, function(){ return true });
- def(AST_UnaryPrefix, function(){
- return this.operator == "typeof";
- });
- def(AST_Binary, function(compressor){
- return this.operator == "+" &&
- (this.left.is_string(compressor) || this.right.is_string(compressor));
- });
- def(AST_Assign, function(compressor){
- return (this.operator == "=" || this.operator == "+=") && this.right.is_string(compressor);
- });
- def(AST_Seq, function(compressor){
- return this.cdr.is_string(compressor);
- });
- def(AST_Conditional, function(compressor){
- return this.consequent.is_string(compressor) && this.alternative.is_string(compressor);
- });
- def(AST_Call, function(compressor){
- return compressor.option("unsafe")
- && this.expression instanceof AST_SymbolRef
- && this.expression.name == "String"
- && this.expression.undeclared();
- });
- })(function(node, func){
- node.DEFMETHOD("is_string", func);
- });
-
- function best_of(ast1, ast2) {
- return ast1.print_to_string().length >
- ast2.print_to_string().length
- ? ast2 : ast1;
- };
-
- // methods to evaluate a constant expression
- (function (def){
- // The evaluate method returns an array with one or two
- // elements. If the node has been successfully reduced to a
- // constant, then the second element tells us the value;
- // otherwise the second element is missing. The first element
- // of the array is always an AST_Node descendant; if
- // evaluation was successful it's a node that represents the
- // constant; otherwise it's the original or a replacement node.
- AST_Node.DEFMETHOD("evaluate", function(compressor){
- if (!compressor.option("evaluate")) return [ this ];
- try {
- var val = this._eval(compressor);
- return [ best_of(make_node_from_constant(compressor, val, this), this), val ];
- } catch(ex) {
- if (ex !== def) throw ex;
- return [ this ];
- }
- });
- def(AST_Statement, function(){
- throw new Error(string_template("Cannot evaluate a statement [{file}:{line},{col}]", this.start));
- });
- def(AST_Function, function(){
- // XXX: AST_Function inherits from AST_Scope, which itself
- // inherits from AST_Statement; however, an AST_Function
- // isn't really a statement. This could byte in other
- // places too. :-( Wish JS had multiple inheritance.
- throw def;
- });
- function ev(node, compressor) {
- if (!compressor) throw new Error("Compressor must be passed");
-
- return node._eval(compressor);
- };
- def(AST_Node, function(){
- throw def; // not constant
- });
- def(AST_Constant, function(){
- return this.getValue();
- });
- def(AST_UnaryPrefix, function(compressor){
- var e = this.expression;
- switch (this.operator) {
- case "!": return !ev(e, compressor);
- case "typeof":
- // Function would be evaluated to an array and so typeof would
- // incorrectly return 'object'. Hence making is a special case.
- if (e instanceof AST_Function) return typeof function(){};
-
- e = ev(e, compressor);
-
- // typeof returns "object" or "function" on different platforms
- // so cannot evaluate reliably
- if (e instanceof RegExp) throw def;
-
- return typeof e;
- case "void": return void ev(e, compressor);
- case "~": return ~ev(e, compressor);
- case "-":
- e = ev(e, compressor);
- if (e === 0) throw def;
- return -e;
- case "+": return +ev(e, compressor);
- }
- throw def;
- });
- def(AST_Binary, function(c){
- var left = this.left, right = this.right;
- switch (this.operator) {
- case "&&" : return ev(left, c) && ev(right, c);
- case "||" : return ev(left, c) || ev(right, c);
- case "|" : return ev(left, c) | ev(right, c);
- case "&" : return ev(left, c) & ev(right, c);
- case "^" : return ev(left, c) ^ ev(right, c);
- case "+" : return ev(left, c) + ev(right, c);
- case "*" : return ev(left, c) * ev(right, c);
- case "/" : return ev(left, c) / ev(right, c);
- case "%" : return ev(left, c) % ev(right, c);
- case "-" : return ev(left, c) - ev(right, c);
- case "<<" : return ev(left, c) << ev(right, c);
- case ">>" : return ev(left, c) >> ev(right, c);
- case ">>>" : return ev(left, c) >>> ev(right, c);
- case "==" : return ev(left, c) == ev(right, c);
- case "===" : return ev(left, c) === ev(right, c);
- case "!=" : return ev(left, c) != ev(right, c);
- case "!==" : return ev(left, c) !== ev(right, c);
- case "<" : return ev(left, c) < ev(right, c);
- case "<=" : return ev(left, c) <= ev(right, c);
- case ">" : return ev(left, c) > ev(right, c);
- case ">=" : return ev(left, c) >= ev(right, c);
- case "in" : return ev(left, c) in ev(right, c);
- case "instanceof" : return ev(left, c) instanceof ev(right, c);
- }
- throw def;
- });
- def(AST_Conditional, function(compressor){
- return ev(this.condition, compressor)
- ? ev(this.consequent, compressor)
- : ev(this.alternative, compressor);
- });
- def(AST_SymbolRef, function(compressor){
- var d = this.definition();
- if (d && d.constant && d.init) return ev(d.init, compressor);
- throw def;
- });
- })(function(node, func){
- node.DEFMETHOD("_eval", func);
- });
-
- // method to negate an expression
- (function(def){
- function basic_negation(exp) {
- return make_node(AST_UnaryPrefix, exp, {
- operator: "!",
- expression: exp
- });
- };
- def(AST_Node, function(){
- return basic_negation(this);
- });
- def(AST_Statement, function(){
- throw new Error("Cannot negate a statement");
- });
- def(AST_Function, function(){
- return basic_negation(this);
- });
- def(AST_UnaryPrefix, function(){
- if (this.operator == "!")
- return this.expression;
- return basic_negation(this);
- });
- def(AST_Seq, function(compressor){
- var self = this.clone();
- self.cdr = self.cdr.negate(compressor);
- return self;
- });
- def(AST_Conditional, function(compressor){
- var self = this.clone();
- self.consequent = self.consequent.negate(compressor);
- self.alternative = self.alternative.negate(compressor);
- return best_of(basic_negation(this), self);
- });
- def(AST_Binary, function(compressor){
- var self = this.clone(), op = this.operator;
- if (compressor.option("unsafe_comps")) {
- switch (op) {
- case "<=" : self.operator = ">" ; return self;
- case "<" : self.operator = ">=" ; return self;
- case ">=" : self.operator = "<" ; return self;
- case ">" : self.operator = "<=" ; return self;
- }
- }
- switch (op) {
- case "==" : self.operator = "!="; return self;
- case "!=" : self.operator = "=="; return self;
- case "===": self.operator = "!=="; return self;
- case "!==": self.operator = "==="; return self;
- case "&&":
- self.operator = "||";
- self.left = self.left.negate(compressor);
- self.right = self.right.negate(compressor);
- return best_of(basic_negation(this), self);
- case "||":
- self.operator = "&&";
- self.left = self.left.negate(compressor);
- self.right = self.right.negate(compressor);
- return best_of(basic_negation(this), self);
- }
- return basic_negation(this);
- });
- })(function(node, func){
- node.DEFMETHOD("negate", function(compressor){
- return func.call(this, compressor);
- });
- });
-
- // determine if expression has side effects
- (function(def){
- def(AST_Node, function(compressor){ return true });
-
- def(AST_EmptyStatement, function(compressor){ return false });
- def(AST_Constant, function(compressor){ return false });
- def(AST_This, function(compressor){ return false });
-
- def(AST_Call, function(compressor){
- var pure = compressor.option("pure_funcs");
- if (!pure) return true;
- return pure.indexOf(this.expression.print_to_string()) < 0;
- });
-
- def(AST_Block, function(compressor){
- for (var i = this.body.length; --i >= 0;) {
- if (this.body[i].has_side_effects(compressor))
- return true;
- }
- return false;
- });
-
- def(AST_SimpleStatement, function(compressor){
- return this.body.has_side_effects(compressor);
- });
- def(AST_Defun, function(compressor){ return true });
- def(AST_Function, function(compressor){ return false });
- def(AST_Binary, function(compressor){
- return this.left.has_side_effects(compressor)
- || this.right.has_side_effects(compressor);
- });
- def(AST_Assign, function(compressor){ return true });
- def(AST_Conditional, function(compressor){
- return this.condition.has_side_effects(compressor)
- || this.consequent.has_side_effects(compressor)
- || this.alternative.has_side_effects(compressor);
- });
- def(AST_Unary, function(compressor){
- return this.operator == "delete"
- || this.operator == "++"
- || this.operator == "--"
- || this.expression.has_side_effects(compressor);
- });
- def(AST_SymbolRef, function(compressor){ return false });
- def(AST_Object, function(compressor){
- for (var i = this.properties.length; --i >= 0;)
- if (this.properties[i].has_side_effects(compressor))
- return true;
- return false;
- });
- def(AST_ObjectProperty, function(compressor){
- return this.value.has_side_effects(compressor);
- });
- def(AST_Array, function(compressor){
- for (var i = this.elements.length; --i >= 0;)
- if (this.elements[i].has_side_effects(compressor))
- return true;
- return false;
- });
- def(AST_Dot, function(compressor){
- if (!compressor.option("pure_getters")) return true;
- return this.expression.has_side_effects(compressor);
- });
- def(AST_Sub, function(compressor){
- if (!compressor.option("pure_getters")) return true;
- return this.expression.has_side_effects(compressor)
- || this.property.has_side_effects(compressor);
- });
- def(AST_PropAccess, function(compressor){
- return !compressor.option("pure_getters");
- });
- def(AST_Seq, function(compressor){
- return this.car.has_side_effects(compressor)
- || this.cdr.has_side_effects(compressor);
- });
- })(function(node, func){
- node.DEFMETHOD("has_side_effects", func);
- });
-
- // tell me if a statement aborts
- function aborts(thing) {
- return thing && thing.aborts();
- };
- (function(def){
- def(AST_Statement, function(){ return null });
- def(AST_Jump, function(){ return this });
- function block_aborts(){
- var n = this.body.length;
- return n > 0 && aborts(this.body[n - 1]);
- };
- def(AST_BlockStatement, block_aborts);
- def(AST_SwitchBranch, block_aborts);
- def(AST_If, function(){
- return this.alternative && aborts(this.body) && aborts(this.alternative);
- });
- })(function(node, func){
- node.DEFMETHOD("aborts", func);
- });
-
- /* -----[ optimizers ]----- */
-
- OPT(AST_Directive, function(self, compressor){
- if (self.scope.has_directive(self.value) !== self.scope) {
- return make_node(AST_EmptyStatement, self);
- }
- return self;
- });
-
- OPT(AST_Debugger, function(self, compressor){
- if (compressor.option("drop_debugger"))
- return make_node(AST_EmptyStatement, self);
- return self;
- });
-
- OPT(AST_LabeledStatement, function(self, compressor){
- if (self.body instanceof AST_Break
- && compressor.loopcontrol_target(self.body.label) === self.body) {
- return make_node(AST_EmptyStatement, self);
- }
- return self.label.references.length == 0 ? self.body : self;
- });
-
- OPT(AST_Block, function(self, compressor){
- self.body = tighten_body(self.body, compressor);
- return self;
- });
-
- OPT(AST_BlockStatement, function(self, compressor){
- self.body = tighten_body(self.body, compressor);
- switch (self.body.length) {
- case 1: return self.body[0];
- case 0: return make_node(AST_EmptyStatement, self);
- }
- return self;
- });
-
- AST_Scope.DEFMETHOD("drop_unused", function(compressor){
- var self = this;
- if (compressor.option("unused")
- && !(self instanceof AST_Toplevel)
- && !self.uses_eval
- ) {
- var in_use = [];
- var initializations = new Dictionary();
- // pass 1: find out which symbols are directly used in
- // this scope (not in nested scopes).
- var scope = this;
- var tw = new TreeWalker(function(node, descend){
- if (node !== self) {
- if (node instanceof AST_Defun) {
- initializations.add(node.name.name, node);
- return true; // don't go in nested scopes
- }
- if (node instanceof AST_Definitions && scope === self) {
- node.definitions.forEach(function(def){
- if (def.value) {
- initializations.add(def.name.name, def.value);
- if (def.value.has_side_effects(compressor)) {
- def.value.walk(tw);
- }
- }
- });
- return true;
- }
- if (node instanceof AST_SymbolRef) {
- push_uniq(in_use, node.definition());
- return true;
- }
- if (node instanceof AST_Scope) {
- var save_scope = scope;
- scope = node;
- descend();
- scope = save_scope;
- return true;
- }
- }
- });
- self.walk(tw);
- // pass 2: for every used symbol we need to walk its
- // initialization code to figure out if it uses other
- // symbols (that may not be in_use).
- for (var i = 0; i < in_use.length; ++i) {
- in_use[i].orig.forEach(function(decl){
- // undeclared globals will be instanceof AST_SymbolRef
- var init = initializations.get(decl.name);
- if (init) init.forEach(function(init){
- var tw = new TreeWalker(function(node){
- if (node instanceof AST_SymbolRef) {
- push_uniq(in_use, node.definition());
- }
- });
- init.walk(tw);
- });
- });
- }
- // pass 3: we should drop declarations not in_use
- var tt = new TreeTransformer(
- function before(node, descend, in_list) {
- if (node instanceof AST_Lambda && !(node instanceof AST_Accessor)) {
- if (!compressor.option("keep_fargs")) {
- for (var a = node.argnames, i = a.length; --i >= 0;) {
- var sym = a[i];
- if (sym.unreferenced()) {
- a.pop();
- compressor.warn("Dropping unused function argument {name} [{file}:{line},{col}]", {
- name : sym.name,
- file : sym.start.file,
- line : sym.start.line,
- col : sym.start.col
- });
- }
- else break;
- }
- }
- }
- if (node instanceof AST_Defun && node !== self) {
- if (!member(node.name.definition(), in_use)) {
- compressor.warn("Dropping unused function {name} [{file}:{line},{col}]", {
- name : node.name.name,
- file : node.name.start.file,
- line : node.name.start.line,
- col : node.name.start.col
- });
- return make_node(AST_EmptyStatement, node);
- }
- return node;
- }
- if (node instanceof AST_Definitions && !(tt.parent() instanceof AST_ForIn)) {
- var def = node.definitions.filter(function(def){
- if (member(def.name.definition(), in_use)) return true;
- var w = {
- name : def.name.name,
- file : def.name.start.file,
- line : def.name.start.line,
- col : def.name.start.col
- };
- if (def.value && def.value.has_side_effects(compressor)) {
- def._unused_side_effects = true;
- compressor.warn("Side effects in initialization of unused variable {name} [{file}:{line},{col}]", w);
- return true;
- }
- compressor.warn("Dropping unused variable {name} [{file}:{line},{col}]", w);
- return false;
- });
- // place uninitialized names at the start
- def = mergeSort(def, function(a, b){
- if (!a.value && b.value) return -1;
- if (!b.value && a.value) return 1;
- return 0;
- });
- // for unused names whose initialization has
- // side effects, we can cascade the init. code
- // into the next one, or next statement.
- var side_effects = [];
- for (var i = 0; i < def.length;) {
- var x = def[i];
- if (x._unused_side_effects) {
- side_effects.push(x.value);
- def.splice(i, 1);
- } else {
- if (side_effects.length > 0) {
- side_effects.push(x.value);
- x.value = AST_Seq.from_array(side_effects);
- side_effects = [];
- }
- ++i;
- }
- }
- if (side_effects.length > 0) {
- side_effects = make_node(AST_BlockStatement, node, {
- body: [ make_node(AST_SimpleStatement, node, {
- body: AST_Seq.from_array(side_effects)
- }) ]
- });
- } else {
- side_effects = null;
- }
- if (def.length == 0 && !side_effects) {
- return make_node(AST_EmptyStatement, node);
- }
- if (def.length == 0) {
- return side_effects;
- }
- node.definitions = def;
- if (side_effects) {
- side_effects.body.unshift(node);
- node = side_effects;
- }
- return node;
- }
- if (node instanceof AST_For) {
- descend(node, this);
-
- if (node.init instanceof AST_BlockStatement) {
- // certain combination of unused name + side effect leads to:
- // https://github.com/mishoo/UglifyJS2/issues/44
- // that's an invalid AST.
- // We fix it at this stage by moving the `var` outside the `for`.
-
- var body = node.init.body.slice(0, -1);
- node.init = node.init.body.slice(-1)[0].body;
- body.push(node);
-
- return in_list ? MAP.splice(body) : make_node(AST_BlockStatement, node, {
- body: body
- });
- }
- }
- if (node instanceof AST_Scope && node !== self)
- return node;
- }
- );
- self.transform(tt);
- }
- });
-
- AST_Scope.DEFMETHOD("hoist_declarations", function(compressor){
- var hoist_funs = compressor.option("hoist_funs");
- var hoist_vars = compressor.option("hoist_vars");
- var self = this;
- if (hoist_funs || hoist_vars) {
- var dirs = [];
- var hoisted = [];
- var vars = new Dictionary(), vars_found = 0, var_decl = 0;
- // let's count var_decl first, we seem to waste a lot of
- // space if we hoist `var` when there's only one.
- self.walk(new TreeWalker(function(node){
- if (node instanceof AST_Scope && node !== self)
- return true;
- if (node instanceof AST_Var) {
- ++var_decl;
- return true;
- }
- }));
- hoist_vars = hoist_vars && var_decl > 1;
- var tt = new TreeTransformer(
- function before(node) {
- if (node !== self) {
- if (node instanceof AST_Directive) {
- dirs.push(node);
- return make_node(AST_EmptyStatement, node);
- }
- if (node instanceof AST_Defun && hoist_funs) {
- hoisted.push(node);
- return make_node(AST_EmptyStatement, node);
- }
- if (node instanceof AST_Var && hoist_vars) {
- node.definitions.forEach(function(def){
- vars.set(def.name.name, def);
- ++vars_found;
- });
- var seq = node.to_assignments();
- var p = tt.parent();
- if (p instanceof AST_ForIn && p.init === node) {
- if (seq == null) return node.definitions[0].name;
- return seq;
- }
- if (p instanceof AST_For && p.init === node) {
- return seq;
- }
- if (!seq) return make_node(AST_EmptyStatement, node);
- return make_node(AST_SimpleStatement, node, {
- body: seq
- });
- }
- if (node instanceof AST_Scope)
- return node; // to avoid descending in nested scopes
- }
- }
- );
- self = self.transform(tt);
- if (vars_found > 0) {
- // collect only vars which don't show up in self's arguments list
- var defs = [];
- vars.each(function(def, name){
- if (self instanceof AST_Lambda
- && find_if(function(x){ return x.name == def.name.name },
- self.argnames)) {
- vars.del(name);
- } else {
- def = def.clone();
- def.value = null;
- defs.push(def);
- vars.set(name, def);
- }
- });
- if (defs.length > 0) {
- // try to merge in assignments
- for (var i = 0; i < self.body.length;) {
- if (self.body[i] instanceof AST_SimpleStatement) {
- var expr = self.body[i].body, sym, assign;
- if (expr instanceof AST_Assign
- && expr.operator == "="
- && (sym = expr.left) instanceof AST_Symbol
- && vars.has(sym.name))
- {
- var def = vars.get(sym.name);
- if (def.value) break;
- def.value = expr.right;
- remove(defs, def);
- defs.push(def);
- self.body.splice(i, 1);
- continue;
- }
- if (expr instanceof AST_Seq
- && (assign = expr.car) instanceof AST_Assign
- && assign.operator == "="
- && (sym = assign.left) instanceof AST_Symbol
- && vars.has(sym.name))
- {
- var def = vars.get(sym.name);
- if (def.value) break;
- def.value = assign.right;
- remove(defs, def);
- defs.push(def);
- self.body[i].body = expr.cdr;
- continue;
- }
- }
- if (self.body[i] instanceof AST_EmptyStatement) {
- self.body.splice(i, 1);
- continue;
- }
- if (self.body[i] instanceof AST_BlockStatement) {
- var tmp = [ i, 1 ].concat(self.body[i].body);
- self.body.splice.apply(self.body, tmp);
- continue;
- }
- break;
- }
- defs = make_node(AST_Var, self, {
- definitions: defs
- });
- hoisted.push(defs);
- };
- }
- self.body = dirs.concat(hoisted, self.body);
- }
- return self;
- });
-
- OPT(AST_SimpleStatement, function(self, compressor){
- if (compressor.option("side_effects")) {
- if (!self.body.has_side_effects(compressor)) {
- compressor.warn("Dropping side-effect-free statement [{file}:{line},{col}]", self.start);
- return make_node(AST_EmptyStatement, self);
- }
- }
- return self;
- });
-
- OPT(AST_DWLoop, function(self, compressor){
- var cond = self.condition.evaluate(compressor);
- self.condition = cond[0];
- if (!compressor.option("loops")) return self;
- if (cond.length > 1) {
- if (cond[1]) {
- return make_node(AST_For, self, {
- body: self.body
- });
- } else if (self instanceof AST_While) {
- if (compressor.option("dead_code")) {
- var a = [];
- extract_declarations_from_unreachable_code(compressor, self.body, a);
- return make_node(AST_BlockStatement, self, { body: a });
- }
- }
- }
- return self;
- });
-
- function if_break_in_loop(self, compressor) {
- function drop_it(rest) {
- rest = as_statement_array(rest);
- if (self.body instanceof AST_BlockStatement) {
- self.body = self.body.clone();
- self.body.body = rest.concat(self.body.body.slice(1));
- self.body = self.body.transform(compressor);
- } else {
- self.body = make_node(AST_BlockStatement, self.body, {
- body: rest
- }).transform(compressor);
- }
- if_break_in_loop(self, compressor);
- }
- var first = self.body instanceof AST_BlockStatement ? self.body.body[0] : self.body;
- if (first instanceof AST_If) {
- if (first.body instanceof AST_Break
- && compressor.loopcontrol_target(first.body.label) === self) {
- if (self.condition) {
- self.condition = make_node(AST_Binary, self.condition, {
- left: self.condition,
- operator: "&&",
- right: first.condition.negate(compressor),
- });
- } else {
- self.condition = first.condition.negate(compressor);
- }
- drop_it(first.alternative);
- }
- else if (first.alternative instanceof AST_Break
- && compressor.loopcontrol_target(first.alternative.label) === self) {
- if (self.condition) {
- self.condition = make_node(AST_Binary, self.condition, {
- left: self.condition,
- operator: "&&",
- right: first.condition,
- });
- } else {
- self.condition = first.condition;
- }
- drop_it(first.body);
- }
- }
- };
-
- OPT(AST_While, function(self, compressor) {
- if (!compressor.option("loops")) return self;
- self = AST_DWLoop.prototype.optimize.call(self, compressor);
- if (self instanceof AST_While) {
- if_break_in_loop(self, compressor);
- self = make_node(AST_For, self, self).transform(compressor);
- }
- return self;
- });
-
- OPT(AST_For, function(self, compressor){
- var cond = self.condition;
- if (cond) {
- cond = cond.evaluate(compressor);
- self.condition = cond[0];
- }
- if (!compressor.option("loops")) return self;
- if (cond) {
- if (cond.length > 1 && !cond[1]) {
- if (compressor.option("dead_code")) {
- var a = [];
- if (self.init instanceof AST_Statement) {
- a.push(self.init);
- }
- else if (self.init) {
- a.push(make_node(AST_SimpleStatement, self.init, {
- body: self.init
- }));
- }
- extract_declarations_from_unreachable_code(compressor, self.body, a);
- return make_node(AST_BlockStatement, self, { body: a });
- }
- }
- }
- if_break_in_loop(self, compressor);
- return self;
- });
-
- OPT(AST_If, function(self, compressor){
- if (!compressor.option("conditionals")) return self;
- // if condition can be statically determined, warn and drop
- // one of the blocks. note, statically determined implies
- // “has no side effects”; also it doesn't work for cases like
- // `x && true`, though it probably should.
- var cond = self.condition.evaluate(compressor);
- self.condition = cond[0];
- if (cond.length > 1) {
- if (cond[1]) {
- compressor.warn("Condition always true [{file}:{line},{col}]", self.condition.start);
- if (compressor.option("dead_code")) {
- var a = [];
- if (self.alternative) {
- extract_declarations_from_unreachable_code(compressor, self.alternative, a);
- }
- a.push(self.body);
- return make_node(AST_BlockStatement, self, { body: a }).transform(compressor);
- }
- } else {
- compressor.warn("Condition always false [{file}:{line},{col}]", self.condition.start);
- if (compressor.option("dead_code")) {
- var a = [];
- extract_declarations_from_unreachable_code(compressor, self.body, a);
- if (self.alternative) a.push(self.alternative);
- return make_node(AST_BlockStatement, self, { body: a }).transform(compressor);
- }
- }
- }
- if (is_empty(self.alternative)) self.alternative = null;
- var negated = self.condition.negate(compressor);
- var negated_is_best = best_of(self.condition, negated) === negated;
- if (self.alternative && negated_is_best) {
- negated_is_best = false; // because we already do the switch here.
- self.condition = negated;
- var tmp = self.body;
- self.body = self.alternative || make_node(AST_EmptyStatement);
- self.alternative = tmp;
- }
- if (is_empty(self.body) && is_empty(self.alternative)) {
- return make_node(AST_SimpleStatement, self.condition, {
- body: self.condition
- }).transform(compressor);
- }
- if (self.body instanceof AST_SimpleStatement
- && self.alternative instanceof AST_SimpleStatement) {
- return make_node(AST_SimpleStatement, self, {
- body: make_node(AST_Conditional, self, {
- condition : self.condition,
- consequent : self.body.body,
- alternative : self.alternative.body
- })
- }).transform(compressor);
- }
- if (is_empty(self.alternative) && self.body instanceof AST_SimpleStatement) {
- if (negated_is_best) return make_node(AST_SimpleStatement, self, {
- body: make_node(AST_Binary, self, {
- operator : "||",
- left : negated,
- right : self.body.body
- })
- }).transform(compressor);
- return make_node(AST_SimpleStatement, self, {
- body: make_node(AST_Binary, self, {
- operator : "&&",
- left : self.condition,
- right : self.body.body
- })
- }).transform(compressor);
- }
- if (self.body instanceof AST_EmptyStatement
- && self.alternative
- && self.alternative instanceof AST_SimpleStatement) {
- return make_node(AST_SimpleStatement, self, {
- body: make_node(AST_Binary, self, {
- operator : "||",
- left : self.condition,
- right : self.alternative.body
- })
- }).transform(compressor);
- }
- if (self.body instanceof AST_Exit
- && self.alternative instanceof AST_Exit
- && self.body.TYPE == self.alternative.TYPE) {
- return make_node(self.body.CTOR, self, {
- value: make_node(AST_Conditional, self, {
- condition : self.condition,
- consequent : self.body.value || make_node(AST_Undefined, self.body).optimize(compressor),
- alternative : self.alternative.value || make_node(AST_Undefined, self.alternative).optimize(compressor)
- })
- }).transform(compressor);
- }
- if (self.body instanceof AST_If
- && !self.body.alternative
- && !self.alternative) {
- self.condition = make_node(AST_Binary, self.condition, {
- operator: "&&",
- left: self.condition,
- right: self.body.condition
- }).transform(compressor);
- self.body = self.body.body;
- }
- if (aborts(self.body)) {
- if (self.alternative) {
- var alt = self.alternative;
- self.alternative = null;
- return make_node(AST_BlockStatement, self, {
- body: [ self, alt ]
- }).transform(compressor);
- }
- }
- if (aborts(self.alternative)) {
- var body = self.body;
- self.body = self.alternative;
- self.condition = negated_is_best ? negated : self.condition.negate(compressor);
- self.alternative = null;
- return make_node(AST_BlockStatement, self, {
- body: [ self, body ]
- }).transform(compressor);
- }
- return self;
- });
-
- OPT(AST_Switch, function(self, compressor){
- if (self.body.length == 0 && compressor.option("conditionals")) {
- return make_node(AST_SimpleStatement, self, {
- body: self.expression
- }).transform(compressor);
- }
- for(;;) {
- var last_branch = self.body[self.body.length - 1];
- if (last_branch) {
- var stat = last_branch.body[last_branch.body.length - 1]; // last statement
- if (stat instanceof AST_Break && loop_body(compressor.loopcontrol_target(stat.label)) === self)
- last_branch.body.pop();
- if (last_branch instanceof AST_Default && last_branch.body.length == 0) {
- self.body.pop();
- continue;
- }
- }
- break;
- }
- var exp = self.expression.evaluate(compressor);
- out: if (exp.length == 2) try {
- // constant expression
- self.expression = exp[0];
- if (!compressor.option("dead_code")) break out;
- var value = exp[1];
- var in_if = false;
- var in_block = false;
- var started = false;
- var stopped = false;
- var ruined = false;
- var tt = new TreeTransformer(function(node, descend, in_list){
- if (node instanceof AST_Lambda || node instanceof AST_SimpleStatement) {
- // no need to descend these node types
- return node;
- }
- else if (node instanceof AST_Switch && node === self) {
- node = node.clone();
- descend(node, this);
- return ruined ? node : make_node(AST_BlockStatement, node, {
- body: node.body.reduce(function(a, branch){
- return a.concat(branch.body);
- }, [])
- }).transform(compressor);
- }
- else if (node instanceof AST_If || node instanceof AST_Try) {
- var save = in_if;
- in_if = !in_block;
- descend(node, this);
- in_if = save;
- return node;
- }
- else if (node instanceof AST_StatementWithBody || node instanceof AST_Switch) {
- var save = in_block;
- in_block = true;
- descend(node, this);
- in_block = save;
- return node;
- }
- else if (node instanceof AST_Break && this.loopcontrol_target(node.label) === self) {
- if (in_if) {
- ruined = true;
- return node;
- }
- if (in_block) return node;
- stopped = true;
- return in_list ? MAP.skip : make_node(AST_EmptyStatement, node);
- }
- else if (node instanceof AST_SwitchBranch && this.parent() === self) {
- if (stopped) return MAP.skip;
- if (node instanceof AST_Case) {
- var exp = node.expression.evaluate(compressor);
- if (exp.length < 2) {
- // got a case with non-constant expression, baling out
- throw self;
- }
- if (exp[1] === value || started) {
- started = true;
- if (aborts(node)) stopped = true;
- descend(node, this);
- return node;
- }
- return MAP.skip;
- }
- descend(node, this);
- return node;
- }
- });
- tt.stack = compressor.stack.slice(); // so that's able to see parent nodes
- self = self.transform(tt);
- } catch(ex) {
- if (ex !== self) throw ex;
- }
- return self;
- });
-
- OPT(AST_Case, function(self, compressor){
- self.body = tighten_body(self.body, compressor);
- return self;
- });
-
- OPT(AST_Try, function(self, compressor){
- self.body = tighten_body(self.body, compressor);
- return self;
- });
-
- AST_Definitions.DEFMETHOD("remove_initializers", function(){
- this.definitions.forEach(function(def){ def.value = null });
- });
-
- AST_Definitions.DEFMETHOD("to_assignments", function(){
- var assignments = this.definitions.reduce(function(a, def){
- if (def.value) {
- var name = make_node(AST_SymbolRef, def.name, def.name);
- a.push(make_node(AST_Assign, def, {
- operator : "=",
- left : name,
- right : def.value
- }));
- }
- return a;
- }, []);
- if (assignments.length == 0) return null;
- return AST_Seq.from_array(assignments);
- });
-
- OPT(AST_Definitions, function(self, compressor){
- if (self.definitions.length == 0)
- return make_node(AST_EmptyStatement, self);
- return self;
- });
-
- OPT(AST_Function, function(self, compressor){
- self = AST_Lambda.prototype.optimize.call(self, compressor);
- if (compressor.option("unused")) {
- if (self.name && self.name.unreferenced()) {
- self.name = null;
- }
- }
- return self;
- });
-
- OPT(AST_Call, function(self, compressor){
- if (compressor.option("unsafe")) {
- var exp = self.expression;
- if (exp instanceof AST_SymbolRef && exp.undeclared()) {
- switch (exp.name) {
- case "Array":
- if (self.args.length != 1) {
- return make_node(AST_Array, self, {
- elements: self.args
- }).transform(compressor);
- }
- break;
- case "Object":
- if (self.args.length == 0) {
- return make_node(AST_Object, self, {
- properties: []
- });
- }
- break;
- case "String":
- if (self.args.length == 0) return make_node(AST_String, self, {
- value: ""
- });
- if (self.args.length <= 1) return make_node(AST_Binary, self, {
- left: self.args[0],
- operator: "+",
- right: make_node(AST_String, self, { value: "" })
- }).transform(compressor);
- break;
- case "Number":
- if (self.args.length == 0) return make_node(AST_Number, self, {
- value: 0
- });
- if (self.args.length == 1) return make_node(AST_UnaryPrefix, self, {
- expression: self.args[0],
- operator: "+"
- }).transform(compressor);
- case "Boolean":
- if (self.args.length == 0) return make_node(AST_False, self);
- if (self.args.length == 1) return make_node(AST_UnaryPrefix, self, {
- expression: make_node(AST_UnaryPrefix, null, {
- expression: self.args[0],
- operator: "!"
- }),
- operator: "!"
- }).transform(compressor);
- break;
- case "Function":
- if (all(self.args, function(x){ return x instanceof AST_String })) {
- // quite a corner-case, but we can handle it:
- // https://github.com/mishoo/UglifyJS2/issues/203
- // if the code argument is a constant, then we can minify it.
- try {
- var code = "(function(" + self.args.slice(0, -1).map(function(arg){
- return arg.value;
- }).join(",") + "){" + self.args[self.args.length - 1].value + "})()";
- var ast = parse(code);
- ast.figure_out_scope({ screw_ie8: compressor.option("screw_ie8") });
- var comp = new Compressor(compressor.options);
- ast = ast.transform(comp);
- ast.figure_out_scope({ screw_ie8: compressor.option("screw_ie8") });
- ast.mangle_names();
- var fun;
- try {
- ast.walk(new TreeWalker(function(node){
- if (node instanceof AST_Lambda) {
- fun = node;
- throw ast;
- }
- }));
- } catch(ex) {
- if (ex !== ast) throw ex;
- };
- var args = fun.argnames.map(function(arg, i){
- return make_node(AST_String, self.args[i], {
- value: arg.print_to_string()
- });
- });
- var code = OutputStream();
- AST_BlockStatement.prototype._codegen.call(fun, fun, code);
- code = code.toString().replace(/^\{|\}$/g, "");
- args.push(make_node(AST_String, self.args[self.args.length - 1], {
- value: code
- }));
- self.args = args;
- return self;
- } catch(ex) {
- if (ex instanceof JS_Parse_Error) {
- compressor.warn("Error parsing code passed to new Function [{file}:{line},{col}]", self.args[self.args.length - 1].start);
- compressor.warn(ex.toString());
- } else {
- console.log(ex);
- throw ex;
- }
- }
- }
- break;
- }
- }
- else if (exp instanceof AST_Dot && exp.property == "toString" && self.args.length == 0) {
- return make_node(AST_Binary, self, {
- left: make_node(AST_String, self, { value: "" }),
- operator: "+",
- right: exp.expression
- }).transform(compressor);
- }
- else if (exp instanceof AST_Dot && exp.expression instanceof AST_Array && exp.property == "join") EXIT: {
- var separator = self.args.length == 0 ? "," : self.args[0].evaluate(compressor)[1];
- if (separator == null) break EXIT; // not a constant
- var elements = exp.expression.elements.reduce(function(a, el){
- el = el.evaluate(compressor);
- if (a.length == 0 || el.length == 1) {
- a.push(el);
- } else {
- var last = a[a.length - 1];
- if (last.length == 2) {
- // it's a constant
- var val = "" + last[1] + separator + el[1];
- a[a.length - 1] = [ make_node_from_constant(compressor, val, last[0]), val ];
- } else {
- a.push(el);
- }
- }
- return a;
- }, []);
- if (elements.length == 0) return make_node(AST_String, self, { value: "" });
- if (elements.length == 1) return elements[0][0];
- if (separator == "") {
- var first;
- if (elements[0][0] instanceof AST_String
- || elements[1][0] instanceof AST_String) {
- first = elements.shift()[0];
- } else {
- first = make_node(AST_String, self, { value: "" });
- }
- return elements.reduce(function(prev, el){
- return make_node(AST_Binary, el[0], {
- operator : "+",
- left : prev,
- right : el[0],
- });
- }, first).transform(compressor);
- }
- // need this awkward cloning to not affect original element
- // best_of will decide which one to get through.
- var node = self.clone();
- node.expression = node.expression.clone();
- node.expression.expression = node.expression.expression.clone();
- node.expression.expression.elements = elements.map(function(el){
- return el[0];
- });
- return best_of(self, node);
- }
- }
- if (compressor.option("side_effects")) {
- if (self.expression instanceof AST_Function
- && self.args.length == 0
- && !AST_Block.prototype.has_side_effects.call(self.expression, compressor)) {
- return make_node(AST_Undefined, self).transform(compressor);
- }
- }
- if (compressor.option("drop_console")) {
- if (self.expression instanceof AST_PropAccess &&
- self.expression.expression instanceof AST_SymbolRef &&
- self.expression.expression.name == "console" &&
- self.expression.expression.undeclared()) {
- return make_node(AST_Undefined, self).transform(compressor);
- }
- }
- return self.evaluate(compressor)[0];
- });
-
- OPT(AST_New, function(self, compressor){
- if (compressor.option("unsafe")) {
- var exp = self.expression;
- if (exp instanceof AST_SymbolRef && exp.undeclared()) {
- switch (exp.name) {
- case "Object":
- case "RegExp":
- case "Function":
- case "Error":
- case "Array":
- return make_node(AST_Call, self, self).transform(compressor);
- }
- }
- }
- return self;
- });
-
- OPT(AST_Seq, function(self, compressor){
- if (!compressor.option("side_effects"))
- return self;
- if (!self.car.has_side_effects(compressor)) {
- // we shouldn't compress (1,eval)(something) to
- // eval(something) because that changes the meaning of
- // eval (becomes lexical instead of global).
- var p;
- if (!(self.cdr instanceof AST_SymbolRef
- && self.cdr.name == "eval"
- && self.cdr.undeclared()
- && (p = compressor.parent()) instanceof AST_Call
- && p.expression === self)) {
- return self.cdr;
- }
- }
- if (compressor.option("cascade")) {
- if (self.car instanceof AST_Assign
- && !self.car.left.has_side_effects(compressor)) {
- if (self.car.left.equivalent_to(self.cdr)) {
- return self.car;
- }
- if (self.cdr instanceof AST_Call
- && self.cdr.expression.equivalent_to(self.car.left)) {
- self.cdr.expression = self.car;
- return self.cdr;
- }
- }
- if (!self.car.has_side_effects(compressor)
- && !self.cdr.has_side_effects(compressor)
- && self.car.equivalent_to(self.cdr)) {
- return self.car;
- }
- }
- if (self.cdr instanceof AST_UnaryPrefix
- && self.cdr.operator == "void"
- && !self.cdr.expression.has_side_effects(compressor)) {
- self.cdr.operator = self.car;
- return self.cdr;
- }
- if (self.cdr instanceof AST_Undefined) {
- return make_node(AST_UnaryPrefix, self, {
- operator : "void",
- expression : self.car
- });
- }
- return self;
- });
-
- AST_Unary.DEFMETHOD("lift_sequences", function(compressor){
- if (compressor.option("sequences")) {
- if (this.expression instanceof AST_Seq) {
- var seq = this.expression;
- var x = seq.to_array();
- this.expression = x.pop();
- x.push(this);
- seq = AST_Seq.from_array(x).transform(compressor);
- return seq;
- }
- }
- return this;
- });
-
- OPT(AST_UnaryPostfix, function(self, compressor){
- return self.lift_sequences(compressor);
- });
-
- OPT(AST_UnaryPrefix, function(self, compressor){
- self = self.lift_sequences(compressor);
- var e = self.expression;
- if (compressor.option("booleans") && compressor.in_boolean_context()) {
- switch (self.operator) {
- case "!":
- if (e instanceof AST_UnaryPrefix && e.operator == "!") {
- // !!foo ==> foo, if we're in boolean context
- return e.expression;
- }
- break;
- case "typeof":
- // typeof always returns a non-empty string, thus it's
- // always true in booleans
- compressor.warn("Boolean expression always true [{file}:{line},{col}]", self.start);
- return make_node(AST_True, self);
- }
- if (e instanceof AST_Binary && self.operator == "!") {
- self = best_of(self, e.negate(compressor));
- }
- }
- return self.evaluate(compressor)[0];
- });
-
- function has_side_effects_or_prop_access(node, compressor) {
- var save_pure_getters = compressor.option("pure_getters");
- compressor.options.pure_getters = false;
- var ret = node.has_side_effects(compressor);
- compressor.options.pure_getters = save_pure_getters;
- return ret;
- }
-
- AST_Binary.DEFMETHOD("lift_sequences", function(compressor){
- if (compressor.option("sequences")) {
- if (this.left instanceof AST_Seq) {
- var seq = this.left;
- var x = seq.to_array();
- this.left = x.pop();
- x.push(this);
- seq = AST_Seq.from_array(x).transform(compressor);
- return seq;
- }
- if (this.right instanceof AST_Seq
- && this instanceof AST_Assign
- && !has_side_effects_or_prop_access(this.left, compressor)) {
- var seq = this.right;
- var x = seq.to_array();
- this.right = x.pop();
- x.push(this);
- seq = AST_Seq.from_array(x).transform(compressor);
- return seq;
- }
- }
- return this;
- });
-
- var commutativeOperators = makePredicate("== === != !== * & | ^");
-
- OPT(AST_Binary, function(self, compressor){
- var reverse = compressor.has_directive("use asm") ? noop
- : function(op, force) {
- if (force || !(self.left.has_side_effects(compressor) || self.right.has_side_effects(compressor))) {
- if (op) self.operator = op;
- var tmp = self.left;
- self.left = self.right;
- self.right = tmp;
- }
- };
- if (commutativeOperators(self.operator)) {
- if (self.right instanceof AST_Constant
- && !(self.left instanceof AST_Constant)) {
- // if right is a constant, whatever side effects the
- // left side might have could not influence the
- // result. hence, force switch.
-
- if (!(self.left instanceof AST_Binary
- && PRECEDENCE[self.left.operator] >= PRECEDENCE[self.operator])) {
- reverse(null, true);
- }
- }
- if (/^[!=]==?$/.test(self.operator)) {
- if (self.left instanceof AST_SymbolRef && self.right instanceof AST_Conditional) {
- if (self.right.consequent instanceof AST_SymbolRef
- && self.right.consequent.definition() === self.left.definition()) {
- if (/^==/.test(self.operator)) return self.right.condition;
- if (/^!=/.test(self.operator)) return self.right.condition.negate(compressor);
- }
- if (self.right.alternative instanceof AST_SymbolRef
- && self.right.alternative.definition() === self.left.definition()) {
- if (/^==/.test(self.operator)) return self.right.condition.negate(compressor);
- if (/^!=/.test(self.operator)) return self.right.condition;
- }
- }
- if (self.right instanceof AST_SymbolRef && self.left instanceof AST_Conditional) {
- if (self.left.consequent instanceof AST_SymbolRef
- && self.left.consequent.definition() === self.right.definition()) {
- if (/^==/.test(self.operator)) return self.left.condition;
- if (/^!=/.test(self.operator)) return self.left.condition.negate(compressor);
- }
- if (self.left.alternative instanceof AST_SymbolRef
- && self.left.alternative.definition() === self.right.definition()) {
- if (/^==/.test(self.operator)) return self.left.condition.negate(compressor);
- if (/^!=/.test(self.operator)) return self.left.condition;
- }
- }
- }
- }
- self = self.lift_sequences(compressor);
- if (compressor.option("comparisons")) switch (self.operator) {
- case "===":
- case "!==":
- if ((self.left.is_string(compressor) && self.right.is_string(compressor)) ||
- (self.left.is_boolean() && self.right.is_boolean())) {
- self.operator = self.operator.substr(0, 2);
- }
- // XXX: intentionally falling down to the next case
- case "==":
- case "!=":
- if (self.left instanceof AST_String
- && self.left.value == "undefined"
- && self.right instanceof AST_UnaryPrefix
- && self.right.operator == "typeof"
- && compressor.option("unsafe")) {
- if (!(self.right.expression instanceof AST_SymbolRef)
- || !self.right.expression.undeclared()) {
- self.right = self.right.expression;
- self.left = make_node(AST_Undefined, self.left).optimize(compressor);
- if (self.operator.length == 2) self.operator += "=";
- }
- }
- break;
- }
- if (compressor.option("booleans") && compressor.in_boolean_context()) switch (self.operator) {
- case "&&":
- var ll = self.left.evaluate(compressor);
- var rr = self.right.evaluate(compressor);
- if ((ll.length > 1 && !ll[1]) || (rr.length > 1 && !rr[1])) {
- compressor.warn("Boolean && always false [{file}:{line},{col}]", self.start);
- return make_node(AST_False, self);
- }
- if (ll.length > 1 && ll[1]) {
- return rr[0];
- }
- if (rr.length > 1 && rr[1]) {
- return ll[0];
- }
- break;
- case "||":
- var ll = self.left.evaluate(compressor);
- var rr = self.right.evaluate(compressor);
- if ((ll.length > 1 && ll[1]) || (rr.length > 1 && rr[1])) {
- compressor.warn("Boolean || always true [{file}:{line},{col}]", self.start);
- return make_node(AST_True, self);
- }
- if (ll.length > 1 && !ll[1]) {
- return rr[0];
- }
- if (rr.length > 1 && !rr[1]) {
- return ll[0];
- }
- break;
- case "+":
- var ll = self.left.evaluate(compressor);
- var rr = self.right.evaluate(compressor);
- if ((ll.length > 1 && ll[0] instanceof AST_String && ll[1]) ||
- (rr.length > 1 && rr[0] instanceof AST_String && rr[1])) {
- compressor.warn("+ in boolean context always true [{file}:{line},{col}]", self.start);
- return make_node(AST_True, self);
- }
- break;
- }
- if (compressor.option("comparisons")) {
- if (!(compressor.parent() instanceof AST_Binary)
- || compressor.parent() instanceof AST_Assign) {
- var negated = make_node(AST_UnaryPrefix, self, {
- operator: "!",
- expression: self.negate(compressor)
- });
- self = best_of(self, negated);
- }
- switch (self.operator) {
- case "<": reverse(">"); break;
- case "<=": reverse(">="); break;
- }
- }
- if (self.operator == "+" && self.right instanceof AST_String
- && self.right.getValue() === "" && self.left instanceof AST_Binary
- && self.left.operator == "+" && self.left.is_string(compressor)) {
- return self.left;
- }
- if (compressor.option("evaluate")) {
- if (self.operator == "+") {
- if (self.left instanceof AST_Constant
- && self.right instanceof AST_Binary
- && self.right.operator == "+"
- && self.right.left instanceof AST_Constant
- && self.right.is_string(compressor)) {
- self = make_node(AST_Binary, self, {
- operator: "+",
- left: make_node(AST_String, null, {
- value: "" + self.left.getValue() + self.right.left.getValue(),
- start: self.left.start,
- end: self.right.left.end
- }),
- right: self.right.right
- });
- }
- if (self.right instanceof AST_Constant
- && self.left instanceof AST_Binary
- && self.left.operator == "+"
- && self.left.right instanceof AST_Constant
- && self.left.is_string(compressor)) {
- self = make_node(AST_Binary, self, {
- operator: "+",
- left: self.left.left,
- right: make_node(AST_String, null, {
- value: "" + self.left.right.getValue() + self.right.getValue(),
- start: self.left.right.start,
- end: self.right.end
- })
- });
- }
- if (self.left instanceof AST_Binary
- && self.left.operator == "+"
- && self.left.is_string(compressor)
- && self.left.right instanceof AST_Constant
- && self.right instanceof AST_Binary
- && self.right.operator == "+"
- && self.right.left instanceof AST_Constant
- && self.right.is_string(compressor)) {
- self = make_node(AST_Binary, self, {
- operator: "+",
- left: make_node(AST_Binary, self.left, {
- operator: "+",
- left: self.left.left,
- right: make_node(AST_String, null, {
- value: "" + self.left.right.getValue() + self.right.left.getValue(),
- start: self.left.right.start,
- end: self.right.left.end
- })
- }),
- right: self.right.right
- });
- }
- }
- }
- // x * (y * z) ==> x * y * z
- if (self.right instanceof AST_Binary
- && self.right.operator == self.operator
- && (self.operator == "*" || self.operator == "&&" || self.operator == "||"))
- {
- self.left = make_node(AST_Binary, self.left, {
- operator : self.operator,
- left : self.left,
- right : self.right.left
- });
- self.right = self.right.right;
- return self.transform(compressor);
- }
- return self.evaluate(compressor)[0];
- });
-
- OPT(AST_SymbolRef, function(self, compressor){
- if (self.undeclared()) {
- var defines = compressor.option("global_defs");
- if (defines && defines.hasOwnProperty(self.name)) {
- return make_node_from_constant(compressor, defines[self.name], self);
- }
- switch (self.name) {
- case "undefined":
- return make_node(AST_Undefined, self);
- case "NaN":
- return make_node(AST_NaN, self);
- case "Infinity":
- return make_node(AST_Infinity, self);
- }
- }
- return self;
- });
-
- OPT(AST_Undefined, function(self, compressor){
- if (compressor.option("unsafe")) {
- var scope = compressor.find_parent(AST_Scope);
- var undef = scope.find_variable("undefined");
- if (undef) {
- var ref = make_node(AST_SymbolRef, self, {
- name : "undefined",
- scope : scope,
- thedef : undef
- });
- ref.reference();
- return ref;
- }
- }
- return self;
- });
-
- var ASSIGN_OPS = [ '+', '-', '/', '*', '%', '>>', '<<', '>>>', '|', '^', '&' ];
- OPT(AST_Assign, function(self, compressor){
- self = self.lift_sequences(compressor);
- if (self.operator == "="
- && self.left instanceof AST_SymbolRef
- && self.right instanceof AST_Binary
- && self.right.left instanceof AST_SymbolRef
- && self.right.left.name == self.left.name
- && member(self.right.operator, ASSIGN_OPS)) {
- self.operator = self.right.operator + "=";
- self.right = self.right.right;
- }
- return self;
- });
-
- OPT(AST_Conditional, function(self, compressor){
- if (!compressor.option("conditionals")) return self;
- if (self.condition instanceof AST_Seq) {
- var car = self.condition.car;
- self.condition = self.condition.cdr;
- return AST_Seq.cons(car, self);
- }
- var cond = self.condition.evaluate(compressor);
- if (cond.length > 1) {
- if (cond[1]) {
- compressor.warn("Condition always true [{file}:{line},{col}]", self.start);
- return self.consequent;
- } else {
- compressor.warn("Condition always false [{file}:{line},{col}]", self.start);
- return self.alternative;
- }
- }
- var negated = cond[0].negate(compressor);
- if (best_of(cond[0], negated) === negated) {
- self = make_node(AST_Conditional, self, {
- condition: negated,
- consequent: self.alternative,
- alternative: self.consequent
- });
- }
- var consequent = self.consequent;
- var alternative = self.alternative;
- if (consequent instanceof AST_Assign
- && alternative instanceof AST_Assign
- && consequent.operator == alternative.operator
- && consequent.left.equivalent_to(alternative.left)
- ) {
- /*
- * Stuff like this:
- * if (foo) exp = something; else exp = something_else;
- * ==>
- * exp = foo ? something : something_else;
- */
- return make_node(AST_Assign, self, {
- operator: consequent.operator,
- left: consequent.left,
- right: make_node(AST_Conditional, self, {
- condition: self.condition,
- consequent: consequent.right,
- alternative: alternative.right
- })
- });
- }
- if (consequent instanceof AST_Call
- && alternative.TYPE === consequent.TYPE
- && consequent.args.length == alternative.args.length
- && consequent.expression.equivalent_to(alternative.expression)) {
- if (consequent.args.length == 0) {
- return make_node(AST_Seq, self, {
- car: self.condition,
- cdr: consequent
- });
- }
- if (consequent.args.length == 1) {
- consequent.args[0] = make_node(AST_Conditional, self, {
- condition: self.condition,
- consequent: consequent.args[0],
- alternative: alternative.args[0]
- });
- return consequent;
- }
- }
- // x?y?z:a:a --> x&&y?z:a
- if (consequent instanceof AST_Conditional
- && consequent.alternative.equivalent_to(alternative)) {
- return make_node(AST_Conditional, self, {
- condition: make_node(AST_Binary, self, {
- left: self.condition,
- operator: "&&",
- right: consequent.condition
- }),
- consequent: consequent.consequent,
- alternative: alternative
- });
- }
- return self;
- });
-
- OPT(AST_Boolean, function(self, compressor){
- if (compressor.option("booleans")) {
- var p = compressor.parent();
- if (p instanceof AST_Binary && (p.operator == "=="
- || p.operator == "!=")) {
- compressor.warn("Non-strict equality against boolean: {operator} {value} [{file}:{line},{col}]", {
- operator : p.operator,
- value : self.value,
- file : p.start.file,
- line : p.start.line,
- col : p.start.col,
- });
- return make_node(AST_Number, self, {
- value: +self.value
- });
- }
- return make_node(AST_UnaryPrefix, self, {
- operator: "!",
- expression: make_node(AST_Number, self, {
- value: 1 - self.value
- })
- });
- }
- return self;
- });
-
- OPT(AST_Sub, function(self, compressor){
- var prop = self.property;
- if (prop instanceof AST_String && compressor.option("properties")) {
- prop = prop.getValue();
- if (RESERVED_WORDS(prop) ? compressor.option("screw_ie8") : is_identifier_string(prop)) {
- return make_node(AST_Dot, self, {
- expression : self.expression,
- property : prop
- });
- }
- var v = parseFloat(prop);
- if (!isNaN(v) && v.toString() == prop) {
- self.property = make_node(AST_Number, self.property, {
- value: v
- });
- }
- }
- return self;
- });
-
- function literals_in_boolean_context(self, compressor) {
- if (compressor.option("booleans") && compressor.in_boolean_context()) {
- return make_node(AST_True, self);
- }
- return self;
- };
- OPT(AST_Array, literals_in_boolean_context);
- OPT(AST_Object, literals_in_boolean_context);
- OPT(AST_RegExp, literals_in_boolean_context);
-
-})();
diff --git a/builder/node_modules/uglify-js/lib/mozilla-ast.js b/builder/node_modules/uglify-js/lib/mozilla-ast.js
deleted file mode 100644
index d7950942..00000000
--- a/builder/node_modules/uglify-js/lib/mozilla-ast.js
+++ /dev/null
@@ -1,267 +0,0 @@
-/***********************************************************************
-
- A JavaScript tokenizer / parser / beautifier / compressor.
- https://github.com/mishoo/UglifyJS2
-
- -------------------------------- (C) ---------------------------------
-
- Author: Mihai Bazon
-
- http://mihai.bazon.net/blog
-
- Distributed under the BSD license:
-
- Copyright 2012 (c) Mihai Bazon
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- * Redistributions of source code must retain the above
- copyright notice, this list of conditions and the following
- disclaimer.
-
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials
- provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
- TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
- THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
-
- ***********************************************************************/
-
-"use strict";
-
-(function(){
-
- var MOZ_TO_ME = {
- TryStatement : function(M) {
- return new AST_Try({
- start : my_start_token(M),
- end : my_end_token(M),
- body : from_moz(M.block).body,
- bcatch : from_moz(M.handlers[0]),
- bfinally : M.finalizer ? new AST_Finally(from_moz(M.finalizer)) : null
- });
- },
- CatchClause : function(M) {
- return new AST_Catch({
- start : my_start_token(M),
- end : my_end_token(M),
- argname : from_moz(M.param),
- body : from_moz(M.body).body
- });
- },
- ObjectExpression : function(M) {
- return new AST_Object({
- start : my_start_token(M),
- end : my_end_token(M),
- properties : M.properties.map(function(prop){
- var key = prop.key;
- var name = key.type == "Identifier" ? key.name : key.value;
- var args = {
- start : my_start_token(key),
- end : my_end_token(prop.value),
- key : name,
- value : from_moz(prop.value)
- };
- switch (prop.kind) {
- case "init":
- return new AST_ObjectKeyVal(args);
- case "set":
- args.value.name = from_moz(key);
- return new AST_ObjectSetter(args);
- case "get":
- args.value.name = from_moz(key);
- return new AST_ObjectGetter(args);
- }
- })
- });
- },
- SequenceExpression : function(M) {
- return AST_Seq.from_array(M.expressions.map(from_moz));
- },
- MemberExpression : function(M) {
- return new (M.computed ? AST_Sub : AST_Dot)({
- start : my_start_token(M),
- end : my_end_token(M),
- property : M.computed ? from_moz(M.property) : M.property.name,
- expression : from_moz(M.object)
- });
- },
- SwitchCase : function(M) {
- return new (M.test ? AST_Case : AST_Default)({
- start : my_start_token(M),
- end : my_end_token(M),
- expression : from_moz(M.test),
- body : M.consequent.map(from_moz)
- });
- },
- Literal : function(M) {
- var val = M.value, args = {
- start : my_start_token(M),
- end : my_end_token(M)
- };
- if (val === null) return new AST_Null(args);
- switch (typeof val) {
- case "string":
- args.value = val;
- return new AST_String(args);
- case "number":
- args.value = val;
- return new AST_Number(args);
- case "boolean":
- return new (val ? AST_True : AST_False)(args);
- default:
- args.value = val;
- return new AST_RegExp(args);
- }
- },
- UnaryExpression: From_Moz_Unary,
- UpdateExpression: From_Moz_Unary,
- Identifier: function(M) {
- var p = FROM_MOZ_STACK[FROM_MOZ_STACK.length - 2];
- return new (M.name == "this" ? AST_This
- : p.type == "LabeledStatement" ? AST_Label
- : p.type == "VariableDeclarator" && p.id === M ? (p.kind == "const" ? AST_SymbolConst : AST_SymbolVar)
- : p.type == "FunctionExpression" ? (p.id === M ? AST_SymbolLambda : AST_SymbolFunarg)
- : p.type == "FunctionDeclaration" ? (p.id === M ? AST_SymbolDefun : AST_SymbolFunarg)
- : p.type == "CatchClause" ? AST_SymbolCatch
- : p.type == "BreakStatement" || p.type == "ContinueStatement" ? AST_LabelRef
- : AST_SymbolRef)({
- start : my_start_token(M),
- end : my_end_token(M),
- name : M.name
- });
- }
- };
-
- function From_Moz_Unary(M) {
- var prefix = "prefix" in M ? M.prefix
- : M.type == "UnaryExpression" ? true : false;
- return new (prefix ? AST_UnaryPrefix : AST_UnaryPostfix)({
- start : my_start_token(M),
- end : my_end_token(M),
- operator : M.operator,
- expression : from_moz(M.argument)
- });
- };
-
- var ME_TO_MOZ = {};
-
- map("Node", AST_Node);
- map("Program", AST_Toplevel, "body@body");
- map("Function", AST_Function, "id>name, params@argnames, body%body");
- map("EmptyStatement", AST_EmptyStatement);
- map("BlockStatement", AST_BlockStatement, "body@body");
- map("ExpressionStatement", AST_SimpleStatement, "expression>body");
- map("IfStatement", AST_If, "test>condition, consequent>body, alternate>alternative");
- map("LabeledStatement", AST_LabeledStatement, "label>label, body>body");
- map("BreakStatement", AST_Break, "label>label");
- map("ContinueStatement", AST_Continue, "label>label");
- map("WithStatement", AST_With, "object>expression, body>body");
- map("SwitchStatement", AST_Switch, "discriminant>expression, cases@body");
- map("ReturnStatement", AST_Return, "argument>value");
- map("ThrowStatement", AST_Throw, "argument>value");
- map("WhileStatement", AST_While, "test>condition, body>body");
- map("DoWhileStatement", AST_Do, "test>condition, body>body");
- map("ForStatement", AST_For, "init>init, test>condition, update>step, body>body");
- map("ForInStatement", AST_ForIn, "left>init, right>object, body>body");
- map("DebuggerStatement", AST_Debugger);
- map("FunctionDeclaration", AST_Defun, "id>name, params@argnames, body%body");
- map("VariableDeclaration", AST_Var, "declarations@definitions");
- map("VariableDeclarator", AST_VarDef, "id>name, init>value");
-
- map("ThisExpression", AST_This);
- map("ArrayExpression", AST_Array, "elements@elements");
- map("FunctionExpression", AST_Function, "id>name, params@argnames, body%body");
- map("BinaryExpression", AST_Binary, "operator=operator, left>left, right>right");
- map("AssignmentExpression", AST_Assign, "operator=operator, left>left, right>right");
- map("LogicalExpression", AST_Binary, "operator=operator, left>left, right>right");
- map("ConditionalExpression", AST_Conditional, "test>condition, consequent>consequent, alternate>alternative");
- map("NewExpression", AST_New, "callee>expression, arguments@args");
- map("CallExpression", AST_Call, "callee>expression, arguments@args");
-
- /* -----[ tools ]----- */
-
- function my_start_token(moznode) {
- return new AST_Token({
- file : moznode.loc && moznode.loc.source,
- line : moznode.loc && moznode.loc.start.line,
- col : moznode.loc && moznode.loc.start.column,
- pos : moznode.start,
- endpos : moznode.start
- });
- };
-
- function my_end_token(moznode) {
- return new AST_Token({
- file : moznode.loc && moznode.loc.source,
- line : moznode.loc && moznode.loc.end.line,
- col : moznode.loc && moznode.loc.end.column,
- pos : moznode.end,
- endpos : moznode.end
- });
- };
-
- function map(moztype, mytype, propmap) {
- var moz_to_me = "function From_Moz_" + moztype + "(M){\n";
- moz_to_me += "return new mytype({\n" +
- "start: my_start_token(M),\n" +
- "end: my_end_token(M)";
-
- if (propmap) propmap.split(/\s*,\s*/).forEach(function(prop){
- var m = /([a-z0-9$_]+)(=|@|>|%)([a-z0-9$_]+)/i.exec(prop);
- if (!m) throw new Error("Can't understand property map: " + prop);
- var moz = "M." + m[1], how = m[2], my = m[3];
- moz_to_me += ",\n" + my + ": ";
- if (how == "@") {
- moz_to_me += moz + ".map(from_moz)";
- } else if (how == ">") {
- moz_to_me += "from_moz(" + moz + ")";
- } else if (how == "=") {
- moz_to_me += moz;
- } else if (how == "%") {
- moz_to_me += "from_moz(" + moz + ").body";
- } else throw new Error("Can't understand operator in propmap: " + prop);
- });
- moz_to_me += "\n})}";
-
- // moz_to_me = parse(moz_to_me).print_to_string({ beautify: true });
- // console.log(moz_to_me);
-
- moz_to_me = new Function("mytype", "my_start_token", "my_end_token", "from_moz", "return(" + moz_to_me + ")")(
- mytype, my_start_token, my_end_token, from_moz
- );
- return MOZ_TO_ME[moztype] = moz_to_me;
- };
-
- var FROM_MOZ_STACK = null;
-
- function from_moz(node) {
- FROM_MOZ_STACK.push(node);
- var ret = node != null ? MOZ_TO_ME[node.type](node) : null;
- FROM_MOZ_STACK.pop();
- return ret;
- };
-
- AST_Node.from_mozilla_ast = function(node){
- var save_stack = FROM_MOZ_STACK;
- FROM_MOZ_STACK = [];
- var ast = from_moz(node);
- FROM_MOZ_STACK = save_stack;
- return ast;
- };
-
-})();
diff --git a/builder/node_modules/uglify-js/lib/output.js b/builder/node_modules/uglify-js/lib/output.js
deleted file mode 100644
index adbc9a41..00000000
--- a/builder/node_modules/uglify-js/lib/output.js
+++ /dev/null
@@ -1,1300 +0,0 @@
-/***********************************************************************
-
- A JavaScript tokenizer / parser / beautifier / compressor.
- https://github.com/mishoo/UglifyJS2
-
- -------------------------------- (C) ---------------------------------
-
- Author: Mihai Bazon
-
- http://mihai.bazon.net/blog
-
- Distributed under the BSD license:
-
- Copyright 2012 (c) Mihai Bazon
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- * Redistributions of source code must retain the above
- copyright notice, this list of conditions and the following
- disclaimer.
-
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials
- provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
- TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
- THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
-
- ***********************************************************************/
-
-"use strict";
-
-function OutputStream(options) {
-
- options = defaults(options, {
- indent_start : 0,
- indent_level : 4,
- quote_keys : false,
- space_colon : true,
- ascii_only : false,
- unescape_regexps : false,
- inline_script : false,
- width : 80,
- max_line_len : 32000,
- beautify : false,
- source_map : null,
- bracketize : false,
- semicolons : true,
- comments : false,
- preserve_line : false,
- screw_ie8 : false,
- preamble : null,
- }, true);
-
- var indentation = 0;
- var current_col = 0;
- var current_line = 1;
- var current_pos = 0;
- var OUTPUT = "";
-
- function to_ascii(str, identifier) {
- return str.replace(/[\u0080-\uffff]/g, function(ch) {
- var code = ch.charCodeAt(0).toString(16);
- if (code.length <= 2 && !identifier) {
- while (code.length < 2) code = "0" + code;
- return "\\x" + code;
- } else {
- while (code.length < 4) code = "0" + code;
- return "\\u" + code;
- }
- });
- };
-
- function make_string(str) {
- var dq = 0, sq = 0;
- str = str.replace(/[\\\b\f\n\r\t\x22\x27\u2028\u2029\0]/g, function(s){
- switch (s) {
- case "\\": return "\\\\";
- case "\b": return "\\b";
- case "\f": return "\\f";
- case "\n": return "\\n";
- case "\r": return "\\r";
- case "\u2028": return "\\u2028";
- case "\u2029": return "\\u2029";
- case '"': ++dq; return '"';
- case "'": ++sq; return "'";
- case "\0": return "\\x00";
- }
- return s;
- });
- if (options.ascii_only) str = to_ascii(str);
- if (dq > sq) return "'" + str.replace(/\x27/g, "\\'") + "'";
- else return '"' + str.replace(/\x22/g, '\\"') + '"';
- };
-
- function encode_string(str) {
- var ret = make_string(str);
- if (options.inline_script)
- ret = ret.replace(/<\x2fscript([>\/\t\n\f\r ])/gi, "<\\/script$1");
- return ret;
- };
-
- function make_name(name) {
- name = name.toString();
- if (options.ascii_only)
- name = to_ascii(name, true);
- return name;
- };
-
- function make_indent(back) {
- return repeat_string(" ", options.indent_start + indentation - back * options.indent_level);
- };
-
- /* -----[ beautification/minification ]----- */
-
- var might_need_space = false;
- var might_need_semicolon = false;
- var last = null;
-
- function last_char() {
- return last.charAt(last.length - 1);
- };
-
- function maybe_newline() {
- if (options.max_line_len && current_col > options.max_line_len)
- print("\n");
- };
-
- var requireSemicolonChars = makePredicate("( [ + * / - , .");
-
- function print(str) {
- str = String(str);
- var ch = str.charAt(0);
- if (might_need_semicolon) {
- if ((!ch || ";}".indexOf(ch) < 0) && !/[;]$/.test(last)) {
- if (options.semicolons || requireSemicolonChars(ch)) {
- OUTPUT += ";";
- current_col++;
- current_pos++;
- } else {
- OUTPUT += "\n";
- current_pos++;
- current_line++;
- current_col = 0;
- }
- if (!options.beautify)
- might_need_space = false;
- }
- might_need_semicolon = false;
- maybe_newline();
- }
-
- if (!options.beautify && options.preserve_line && stack[stack.length - 1]) {
- var target_line = stack[stack.length - 1].start.line;
- while (current_line < target_line) {
- OUTPUT += "\n";
- current_pos++;
- current_line++;
- current_col = 0;
- might_need_space = false;
- }
- }
-
- if (might_need_space) {
- var prev = last_char();
- if ((is_identifier_char(prev)
- && (is_identifier_char(ch) || ch == "\\"))
- || (/^[\+\-\/]$/.test(ch) && ch == prev))
- {
- OUTPUT += " ";
- current_col++;
- current_pos++;
- }
- might_need_space = false;
- }
- var a = str.split(/\r?\n/), n = a.length - 1;
- current_line += n;
- if (n == 0) {
- current_col += a[n].length;
- } else {
- current_col = a[n].length;
- }
- current_pos += str.length;
- last = str;
- OUTPUT += str;
- };
-
- var space = options.beautify ? function() {
- print(" ");
- } : function() {
- might_need_space = true;
- };
-
- var indent = options.beautify ? function(half) {
- if (options.beautify) {
- print(make_indent(half ? 0.5 : 0));
- }
- } : noop;
-
- var with_indent = options.beautify ? function(col, cont) {
- if (col === true) col = next_indent();
- var save_indentation = indentation;
- indentation = col;
- var ret = cont();
- indentation = save_indentation;
- return ret;
- } : function(col, cont) { return cont() };
-
- var newline = options.beautify ? function() {
- print("\n");
- } : noop;
-
- var semicolon = options.beautify ? function() {
- print(";");
- } : function() {
- might_need_semicolon = true;
- };
-
- function force_semicolon() {
- might_need_semicolon = false;
- print(";");
- };
-
- function next_indent() {
- return indentation + options.indent_level;
- };
-
- function with_block(cont) {
- var ret;
- print("{");
- newline();
- with_indent(next_indent(), function(){
- ret = cont();
- });
- indent();
- print("}");
- return ret;
- };
-
- function with_parens(cont) {
- print("(");
- //XXX: still nice to have that for argument lists
- //var ret = with_indent(current_col, cont);
- var ret = cont();
- print(")");
- return ret;
- };
-
- function with_square(cont) {
- print("[");
- //var ret = with_indent(current_col, cont);
- var ret = cont();
- print("]");
- return ret;
- };
-
- function comma() {
- print(",");
- space();
- };
-
- function colon() {
- print(":");
- if (options.space_colon) space();
- };
-
- var add_mapping = options.source_map ? function(token, name) {
- try {
- if (token) options.source_map.add(
- token.file || "?",
- current_line, current_col,
- token.line, token.col,
- (!name && token.type == "name") ? token.value : name
- );
- } catch(ex) {
- AST_Node.warn("Couldn't figure out mapping for {file}:{line},{col} → {cline},{ccol} [{name}]", {
- file: token.file,
- line: token.line,
- col: token.col,
- cline: current_line,
- ccol: current_col,
- name: name || ""
- })
- }
- } : noop;
-
- function get() {
- return OUTPUT;
- };
-
- if (options.preamble) {
- print(options.preamble.replace(/\r\n?|[\n\u2028\u2029]|\s*$/g, "\n"));
- }
-
- var stack = [];
- return {
- get : get,
- toString : get,
- indent : indent,
- indentation : function() { return indentation },
- current_width : function() { return current_col - indentation },
- should_break : function() { return options.width && this.current_width() >= options.width },
- newline : newline,
- print : print,
- space : space,
- comma : comma,
- colon : colon,
- last : function() { return last },
- semicolon : semicolon,
- force_semicolon : force_semicolon,
- to_ascii : to_ascii,
- print_name : function(name) { print(make_name(name)) },
- print_string : function(str) { print(encode_string(str)) },
- next_indent : next_indent,
- with_indent : with_indent,
- with_block : with_block,
- with_parens : with_parens,
- with_square : with_square,
- add_mapping : add_mapping,
- option : function(opt) { return options[opt] },
- line : function() { return current_line },
- col : function() { return current_col },
- pos : function() { return current_pos },
- push_node : function(node) { stack.push(node) },
- pop_node : function() { return stack.pop() },
- stack : function() { return stack },
- parent : function(n) {
- return stack[stack.length - 2 - (n || 0)];
- }
- };
-
-};
-
-/* -----[ code generators ]----- */
-
-(function(){
-
- /* -----[ utils ]----- */
-
- function DEFPRINT(nodetype, generator) {
- nodetype.DEFMETHOD("_codegen", generator);
- };
-
- AST_Node.DEFMETHOD("print", function(stream, force_parens){
- var self = this, generator = self._codegen;
- function doit() {
- self.add_comments(stream);
- self.add_source_map(stream);
- generator(self, stream);
- }
- stream.push_node(self);
- if (force_parens || self.needs_parens(stream)) {
- stream.with_parens(doit);
- } else {
- doit();
- }
- stream.pop_node();
- });
-
- AST_Node.DEFMETHOD("print_to_string", function(options){
- var s = OutputStream(options);
- this.print(s);
- return s.get();
- });
-
- /* -----[ comments ]----- */
-
- AST_Node.DEFMETHOD("add_comments", function(output){
- var c = output.option("comments"), self = this;
- if (c) {
- var start = self.start;
- if (start && !start._comments_dumped) {
- start._comments_dumped = true;
- var comments = start.comments_before || [];
-
- // XXX: ugly fix for https://github.com/mishoo/UglifyJS2/issues/112
- // and https://github.com/mishoo/UglifyJS2/issues/372
- if (self instanceof AST_Exit && self.value) {
- self.value.walk(new TreeWalker(function(node){
- if (node.start && node.start.comments_before) {
- comments = comments.concat(node.start.comments_before);
- node.start.comments_before = [];
- }
- if (node instanceof AST_Function ||
- node instanceof AST_Array ||
- node instanceof AST_Object)
- {
- return true; // don't go inside.
- }
- }));
- }
-
- if (c.test) {
- comments = comments.filter(function(comment){
- return c.test(comment.value);
- });
- } else if (typeof c == "function") {
- comments = comments.filter(function(comment){
- return c(self, comment);
- });
- }
- comments.forEach(function(c){
- if (/comment[134]/.test(c.type)) {
- output.print("//" + c.value + "\n");
- output.indent();
- }
- else if (c.type == "comment2") {
- output.print("/*" + c.value + "*/");
- if (start.nlb) {
- output.print("\n");
- output.indent();
- } else {
- output.space();
- }
- }
- });
- }
- }
- });
-
- /* -----[ PARENTHESES ]----- */
-
- function PARENS(nodetype, func) {
- nodetype.DEFMETHOD("needs_parens", func);
- };
-
- PARENS(AST_Node, function(){
- return false;
- });
-
- // a function expression needs parens around it when it's provably
- // the first token to appear in a statement.
- PARENS(AST_Function, function(output){
- return first_in_statement(output);
- });
-
- // same goes for an object literal, because otherwise it would be
- // interpreted as a block of code.
- PARENS(AST_Object, function(output){
- return first_in_statement(output);
- });
-
- PARENS(AST_Unary, function(output){
- var p = output.parent();
- return p instanceof AST_PropAccess && p.expression === this;
- });
-
- PARENS(AST_Seq, function(output){
- var p = output.parent();
- return p instanceof AST_Call // (foo, bar)() or foo(1, (2, 3), 4)
- || p instanceof AST_Unary // !(foo, bar, baz)
- || p instanceof AST_Binary // 1 + (2, 3) + 4 ==> 8
- || p instanceof AST_VarDef // var a = (1, 2), b = a + a; ==> b == 4
- || p instanceof AST_PropAccess // (1, {foo:2}).foo or (1, {foo:2})["foo"] ==> 2
- || p instanceof AST_Array // [ 1, (2, 3), 4 ] ==> [ 1, 3, 4 ]
- || p instanceof AST_ObjectProperty // { foo: (1, 2) }.foo ==> 2
- || p instanceof AST_Conditional /* (false, true) ? (a = 10, b = 20) : (c = 30)
- * ==> 20 (side effect, set a := 10 and b := 20) */
- ;
- });
-
- PARENS(AST_Binary, function(output){
- var p = output.parent();
- // (foo && bar)()
- if (p instanceof AST_Call && p.expression === this)
- return true;
- // typeof (foo && bar)
- if (p instanceof AST_Unary)
- return true;
- // (foo && bar)["prop"], (foo && bar).prop
- if (p instanceof AST_PropAccess && p.expression === this)
- return true;
- // this deals with precedence: 3 * (2 + 1)
- if (p instanceof AST_Binary) {
- var po = p.operator, pp = PRECEDENCE[po];
- var so = this.operator, sp = PRECEDENCE[so];
- if (pp > sp
- || (pp == sp
- && this === p.right)) {
- return true;
- }
- }
- });
-
- PARENS(AST_PropAccess, function(output){
- var p = output.parent();
- if (p instanceof AST_New && p.expression === this) {
- // i.e. new (foo.bar().baz)
- //
- // if there's one call into this subtree, then we need
- // parens around it too, otherwise the call will be
- // interpreted as passing the arguments to the upper New
- // expression.
- try {
- this.walk(new TreeWalker(function(node){
- if (node instanceof AST_Call) throw p;
- }));
- } catch(ex) {
- if (ex !== p) throw ex;
- return true;
- }
- }
- });
-
- PARENS(AST_Call, function(output){
- var p = output.parent(), p1;
- if (p instanceof AST_New && p.expression === this)
- return true;
-
- // workaround for Safari bug.
- // https://bugs.webkit.org/show_bug.cgi?id=123506
- return this.expression instanceof AST_Function
- && p instanceof AST_PropAccess
- && p.expression === this
- && (p1 = output.parent(1)) instanceof AST_Assign
- && p1.left === p;
- });
-
- PARENS(AST_New, function(output){
- var p = output.parent();
- if (no_constructor_parens(this, output)
- && (p instanceof AST_PropAccess // (new Date).getTime(), (new Date)["getTime"]()
- || p instanceof AST_Call && p.expression === this)) // (new foo)(bar)
- return true;
- });
-
- PARENS(AST_Number, function(output){
- var p = output.parent();
- if (this.getValue() < 0 && p instanceof AST_PropAccess && p.expression === this)
- return true;
- });
-
- PARENS(AST_NaN, function(output){
- var p = output.parent();
- if (p instanceof AST_PropAccess && p.expression === this)
- return true;
- });
-
- function assign_and_conditional_paren_rules(output) {
- var p = output.parent();
- // !(a = false) → true
- if (p instanceof AST_Unary)
- return true;
- // 1 + (a = 2) + 3 → 6, side effect setting a = 2
- if (p instanceof AST_Binary && !(p instanceof AST_Assign))
- return true;
- // (a = func)() —or— new (a = Object)()
- if (p instanceof AST_Call && p.expression === this)
- return true;
- // (a = foo) ? bar : baz
- if (p instanceof AST_Conditional && p.condition === this)
- return true;
- // (a = foo)["prop"] —or— (a = foo).prop
- if (p instanceof AST_PropAccess && p.expression === this)
- return true;
- };
-
- PARENS(AST_Assign, assign_and_conditional_paren_rules);
- PARENS(AST_Conditional, assign_and_conditional_paren_rules);
-
- /* -----[ PRINTERS ]----- */
-
- DEFPRINT(AST_Directive, function(self, output){
- output.print_string(self.value);
- output.semicolon();
- });
- DEFPRINT(AST_Debugger, function(self, output){
- output.print("debugger");
- output.semicolon();
- });
-
- /* -----[ statements ]----- */
-
- function display_body(body, is_toplevel, output) {
- var last = body.length - 1;
- body.forEach(function(stmt, i){
- if (!(stmt instanceof AST_EmptyStatement)) {
- output.indent();
- stmt.print(output);
- if (!(i == last && is_toplevel)) {
- output.newline();
- if (is_toplevel) output.newline();
- }
- }
- });
- };
-
- AST_StatementWithBody.DEFMETHOD("_do_print_body", function(output){
- force_statement(this.body, output);
- });
-
- DEFPRINT(AST_Statement, function(self, output){
- self.body.print(output);
- output.semicolon();
- });
- DEFPRINT(AST_Toplevel, function(self, output){
- display_body(self.body, true, output);
- output.print("");
- });
- DEFPRINT(AST_LabeledStatement, function(self, output){
- self.label.print(output);
- output.colon();
- self.body.print(output);
- });
- DEFPRINT(AST_SimpleStatement, function(self, output){
- self.body.print(output);
- output.semicolon();
- });
- function print_bracketed(body, output) {
- if (body.length > 0) output.with_block(function(){
- display_body(body, false, output);
- });
- else output.print("{}");
- };
- DEFPRINT(AST_BlockStatement, function(self, output){
- print_bracketed(self.body, output);
- });
- DEFPRINT(AST_EmptyStatement, function(self, output){
- output.semicolon();
- });
- DEFPRINT(AST_Do, function(self, output){
- output.print("do");
- output.space();
- self._do_print_body(output);
- output.space();
- output.print("while");
- output.space();
- output.with_parens(function(){
- self.condition.print(output);
- });
- output.semicolon();
- });
- DEFPRINT(AST_While, function(self, output){
- output.print("while");
- output.space();
- output.with_parens(function(){
- self.condition.print(output);
- });
- output.space();
- self._do_print_body(output);
- });
- DEFPRINT(AST_For, function(self, output){
- output.print("for");
- output.space();
- output.with_parens(function(){
- if (self.init) {
- if (self.init instanceof AST_Definitions) {
- self.init.print(output);
- } else {
- parenthesize_for_noin(self.init, output, true);
- }
- output.print(";");
- output.space();
- } else {
- output.print(";");
- }
- if (self.condition) {
- self.condition.print(output);
- output.print(";");
- output.space();
- } else {
- output.print(";");
- }
- if (self.step) {
- self.step.print(output);
- }
- });
- output.space();
- self._do_print_body(output);
- });
- DEFPRINT(AST_ForIn, function(self, output){
- output.print("for");
- output.space();
- output.with_parens(function(){
- self.init.print(output);
- output.space();
- output.print("in");
- output.space();
- self.object.print(output);
- });
- output.space();
- self._do_print_body(output);
- });
- DEFPRINT(AST_With, function(self, output){
- output.print("with");
- output.space();
- output.with_parens(function(){
- self.expression.print(output);
- });
- output.space();
- self._do_print_body(output);
- });
-
- /* -----[ functions ]----- */
- AST_Lambda.DEFMETHOD("_do_print", function(output, nokeyword){
- var self = this;
- if (!nokeyword) {
- output.print("function");
- }
- if (self.name) {
- output.space();
- self.name.print(output);
- }
- output.with_parens(function(){
- self.argnames.forEach(function(arg, i){
- if (i) output.comma();
- arg.print(output);
- });
- });
- output.space();
- print_bracketed(self.body, output);
- });
- DEFPRINT(AST_Lambda, function(self, output){
- self._do_print(output);
- });
-
- /* -----[ exits ]----- */
- AST_Exit.DEFMETHOD("_do_print", function(output, kind){
- output.print(kind);
- if (this.value) {
- output.space();
- this.value.print(output);
- }
- output.semicolon();
- });
- DEFPRINT(AST_Return, function(self, output){
- self._do_print(output, "return");
- });
- DEFPRINT(AST_Throw, function(self, output){
- self._do_print(output, "throw");
- });
-
- /* -----[ loop control ]----- */
- AST_LoopControl.DEFMETHOD("_do_print", function(output, kind){
- output.print(kind);
- if (this.label) {
- output.space();
- this.label.print(output);
- }
- output.semicolon();
- });
- DEFPRINT(AST_Break, function(self, output){
- self._do_print(output, "break");
- });
- DEFPRINT(AST_Continue, function(self, output){
- self._do_print(output, "continue");
- });
-
- /* -----[ if ]----- */
- function make_then(self, output) {
- if (output.option("bracketize")) {
- make_block(self.body, output);
- return;
- }
- // The squeezer replaces "block"-s that contain only a single
- // statement with the statement itself; technically, the AST
- // is correct, but this can create problems when we output an
- // IF having an ELSE clause where the THEN clause ends in an
- // IF *without* an ELSE block (then the outer ELSE would refer
- // to the inner IF). This function checks for this case and
- // adds the block brackets if needed.
- if (!self.body)
- return output.force_semicolon();
- if (self.body instanceof AST_Do
- && !output.option("screw_ie8")) {
- // https://github.com/mishoo/UglifyJS/issues/#issue/57 IE
- // croaks with "syntax error" on code like this: if (foo)
- // do ... while(cond); else ... we need block brackets
- // around do/while
- make_block(self.body, output);
- return;
- }
- var b = self.body;
- while (true) {
- if (b instanceof AST_If) {
- if (!b.alternative) {
- make_block(self.body, output);
- return;
- }
- b = b.alternative;
- }
- else if (b instanceof AST_StatementWithBody) {
- b = b.body;
- }
- else break;
- }
- force_statement(self.body, output);
- };
- DEFPRINT(AST_If, function(self, output){
- output.print("if");
- output.space();
- output.with_parens(function(){
- self.condition.print(output);
- });
- output.space();
- if (self.alternative) {
- make_then(self, output);
- output.space();
- output.print("else");
- output.space();
- force_statement(self.alternative, output);
- } else {
- self._do_print_body(output);
- }
- });
-
- /* -----[ switch ]----- */
- DEFPRINT(AST_Switch, function(self, output){
- output.print("switch");
- output.space();
- output.with_parens(function(){
- self.expression.print(output);
- });
- output.space();
- if (self.body.length > 0) output.with_block(function(){
- self.body.forEach(function(stmt, i){
- if (i) output.newline();
- output.indent(true);
- stmt.print(output);
- });
- });
- else output.print("{}");
- });
- AST_SwitchBranch.DEFMETHOD("_do_print_body", function(output){
- if (this.body.length > 0) {
- output.newline();
- this.body.forEach(function(stmt){
- output.indent();
- stmt.print(output);
- output.newline();
- });
- }
- });
- DEFPRINT(AST_Default, function(self, output){
- output.print("default:");
- self._do_print_body(output);
- });
- DEFPRINT(AST_Case, function(self, output){
- output.print("case");
- output.space();
- self.expression.print(output);
- output.print(":");
- self._do_print_body(output);
- });
-
- /* -----[ exceptions ]----- */
- DEFPRINT(AST_Try, function(self, output){
- output.print("try");
- output.space();
- print_bracketed(self.body, output);
- if (self.bcatch) {
- output.space();
- self.bcatch.print(output);
- }
- if (self.bfinally) {
- output.space();
- self.bfinally.print(output);
- }
- });
- DEFPRINT(AST_Catch, function(self, output){
- output.print("catch");
- output.space();
- output.with_parens(function(){
- self.argname.print(output);
- });
- output.space();
- print_bracketed(self.body, output);
- });
- DEFPRINT(AST_Finally, function(self, output){
- output.print("finally");
- output.space();
- print_bracketed(self.body, output);
- });
-
- /* -----[ var/const ]----- */
- AST_Definitions.DEFMETHOD("_do_print", function(output, kind){
- output.print(kind);
- output.space();
- this.definitions.forEach(function(def, i){
- if (i) output.comma();
- def.print(output);
- });
- var p = output.parent();
- var in_for = p instanceof AST_For || p instanceof AST_ForIn;
- var avoid_semicolon = in_for && p.init === this;
- if (!avoid_semicolon)
- output.semicolon();
- });
- DEFPRINT(AST_Var, function(self, output){
- self._do_print(output, "var");
- });
- DEFPRINT(AST_Const, function(self, output){
- self._do_print(output, "const");
- });
-
- function parenthesize_for_noin(node, output, noin) {
- if (!noin) node.print(output);
- else try {
- // need to take some precautions here:
- // https://github.com/mishoo/UglifyJS2/issues/60
- node.walk(new TreeWalker(function(node){
- if (node instanceof AST_Binary && node.operator == "in")
- throw output;
- }));
- node.print(output);
- } catch(ex) {
- if (ex !== output) throw ex;
- node.print(output, true);
- }
- };
-
- DEFPRINT(AST_VarDef, function(self, output){
- self.name.print(output);
- if (self.value) {
- output.space();
- output.print("=");
- output.space();
- var p = output.parent(1);
- var noin = p instanceof AST_For || p instanceof AST_ForIn;
- parenthesize_for_noin(self.value, output, noin);
- }
- });
-
- /* -----[ other expressions ]----- */
- DEFPRINT(AST_Call, function(self, output){
- self.expression.print(output);
- if (self instanceof AST_New && no_constructor_parens(self, output))
- return;
- output.with_parens(function(){
- self.args.forEach(function(expr, i){
- if (i) output.comma();
- expr.print(output);
- });
- });
- });
- DEFPRINT(AST_New, function(self, output){
- output.print("new");
- output.space();
- AST_Call.prototype._codegen(self, output);
- });
-
- AST_Seq.DEFMETHOD("_do_print", function(output){
- this.car.print(output);
- if (this.cdr) {
- output.comma();
- if (output.should_break()) {
- output.newline();
- output.indent();
- }
- this.cdr.print(output);
- }
- });
- DEFPRINT(AST_Seq, function(self, output){
- self._do_print(output);
- // var p = output.parent();
- // if (p instanceof AST_Statement) {
- // output.with_indent(output.next_indent(), function(){
- // self._do_print(output);
- // });
- // } else {
- // self._do_print(output);
- // }
- });
- DEFPRINT(AST_Dot, function(self, output){
- var expr = self.expression;
- expr.print(output);
- if (expr instanceof AST_Number && expr.getValue() >= 0) {
- if (!/[xa-f.]/i.test(output.last())) {
- output.print(".");
- }
- }
- output.print(".");
- // the name after dot would be mapped about here.
- output.add_mapping(self.end);
- output.print_name(self.property);
- });
- DEFPRINT(AST_Sub, function(self, output){
- self.expression.print(output);
- output.print("[");
- self.property.print(output);
- output.print("]");
- });
- DEFPRINT(AST_UnaryPrefix, function(self, output){
- var op = self.operator;
- output.print(op);
- if (/^[a-z]/i.test(op))
- output.space();
- self.expression.print(output);
- });
- DEFPRINT(AST_UnaryPostfix, function(self, output){
- self.expression.print(output);
- output.print(self.operator);
- });
- DEFPRINT(AST_Binary, function(self, output){
- self.left.print(output);
- output.space();
- output.print(self.operator);
- if (self.operator == "<"
- && self.right instanceof AST_UnaryPrefix
- && self.right.operator == "!"
- && self.right.expression instanceof AST_UnaryPrefix
- && self.right.expression.operator == "--") {
- // space is mandatory to avoid outputting ") && S.newline_before) {
- forward(3);
- return skip_line_comment("comment4");
- }
- }
- var ch = peek();
- if (!ch) return token("eof");
- var code = ch.charCodeAt(0);
- switch (code) {
- case 34: case 39: return read_string();
- case 46: return handle_dot();
- case 47: return handle_slash();
- }
- if (is_digit(code)) return read_num();
- if (PUNC_CHARS(ch)) return token("punc", next());
- if (OPERATOR_CHARS(ch)) return read_operator();
- if (code == 92 || is_identifier_start(code)) return read_word();
- parse_error("Unexpected character '" + ch + "'");
- };
-
- next_token.context = function(nc) {
- if (nc) S = nc;
- return S;
- };
-
- return next_token;
-
-};
-
-/* -----[ Parser (constants) ]----- */
-
-var UNARY_PREFIX = makePredicate([
- "typeof",
- "void",
- "delete",
- "--",
- "++",
- "!",
- "~",
- "-",
- "+"
-]);
-
-var UNARY_POSTFIX = makePredicate([ "--", "++" ]);
-
-var ASSIGNMENT = makePredicate([ "=", "+=", "-=", "/=", "*=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&=" ]);
-
-var PRECEDENCE = (function(a, ret){
- for (var i = 0; i < a.length; ++i) {
- var b = a[i];
- for (var j = 0; j < b.length; ++j) {
- ret[b[j]] = i + 1;
- }
- }
- return ret;
-})(
- [
- ["||"],
- ["&&"],
- ["|"],
- ["^"],
- ["&"],
- ["==", "===", "!=", "!=="],
- ["<", ">", "<=", ">=", "in", "instanceof"],
- [">>", "<<", ">>>"],
- ["+", "-"],
- ["*", "/", "%"]
- ],
- {}
-);
-
-var STATEMENTS_WITH_LABELS = array_to_hash([ "for", "do", "while", "switch" ]);
-
-var ATOMIC_START_TOKEN = array_to_hash([ "atom", "num", "string", "regexp", "name" ]);
-
-/* -----[ Parser ]----- */
-
-function parse($TEXT, options) {
-
- options = defaults(options, {
- strict : false,
- filename : null,
- toplevel : null,
- expression : false,
- html5_comments : true,
- });
-
- var S = {
- input : (typeof $TEXT == "string"
- ? tokenizer($TEXT, options.filename,
- options.html5_comments)
- : $TEXT),
- token : null,
- prev : null,
- peeked : null,
- in_function : 0,
- in_directives : true,
- in_loop : 0,
- labels : []
- };
-
- S.token = next();
-
- function is(type, value) {
- return is_token(S.token, type, value);
- };
-
- function peek() { return S.peeked || (S.peeked = S.input()); };
-
- function next() {
- S.prev = S.token;
- if (S.peeked) {
- S.token = S.peeked;
- S.peeked = null;
- } else {
- S.token = S.input();
- }
- S.in_directives = S.in_directives && (
- S.token.type == "string" || is("punc", ";")
- );
- return S.token;
- };
-
- function prev() {
- return S.prev;
- };
-
- function croak(msg, line, col, pos) {
- var ctx = S.input.context();
- js_error(msg,
- ctx.filename,
- line != null ? line : ctx.tokline,
- col != null ? col : ctx.tokcol,
- pos != null ? pos : ctx.tokpos);
- };
-
- function token_error(token, msg) {
- croak(msg, token.line, token.col);
- };
-
- function unexpected(token) {
- if (token == null)
- token = S.token;
- token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")");
- };
-
- function expect_token(type, val) {
- if (is(type, val)) {
- return next();
- }
- token_error(S.token, "Unexpected token " + S.token.type + " «" + S.token.value + "»" + ", expected " + type + " «" + val + "»");
- };
-
- function expect(punc) { return expect_token("punc", punc); };
-
- function can_insert_semicolon() {
- return !options.strict && (
- S.token.nlb || is("eof") || is("punc", "}")
- );
- };
-
- function semicolon() {
- if (is("punc", ";")) next();
- else if (!can_insert_semicolon()) unexpected();
- };
-
- function parenthesised() {
- expect("(");
- var exp = expression(true);
- expect(")");
- return exp;
- };
-
- function embed_tokens(parser) {
- return function() {
- var start = S.token;
- var expr = parser();
- var end = prev();
- expr.start = start;
- expr.end = end;
- return expr;
- };
- };
-
- function handle_regexp() {
- if (is("operator", "/") || is("operator", "/=")) {
- S.peeked = null;
- S.token = S.input(S.token.value.substr(1)); // force regexp
- }
- };
-
- var statement = embed_tokens(function() {
- var tmp;
- handle_regexp();
- switch (S.token.type) {
- case "string":
- var dir = S.in_directives, stat = simple_statement();
- // XXXv2: decide how to fix directives
- if (dir && stat.body instanceof AST_String && !is("punc", ","))
- return new AST_Directive({ value: stat.body.value });
- return stat;
- case "num":
- case "regexp":
- case "operator":
- case "atom":
- return simple_statement();
-
- case "name":
- return is_token(peek(), "punc", ":")
- ? labeled_statement()
- : simple_statement();
-
- case "punc":
- switch (S.token.value) {
- case "{":
- return new AST_BlockStatement({
- start : S.token,
- body : block_(),
- end : prev()
- });
- case "[":
- case "(":
- return simple_statement();
- case ";":
- next();
- return new AST_EmptyStatement();
- default:
- unexpected();
- }
-
- case "keyword":
- switch (tmp = S.token.value, next(), tmp) {
- case "break":
- return break_cont(AST_Break);
-
- case "continue":
- return break_cont(AST_Continue);
-
- case "debugger":
- semicolon();
- return new AST_Debugger();
-
- case "do":
- return new AST_Do({
- body : in_loop(statement),
- condition : (expect_token("keyword", "while"), tmp = parenthesised(), semicolon(), tmp)
- });
-
- case "while":
- return new AST_While({
- condition : parenthesised(),
- body : in_loop(statement)
- });
-
- case "for":
- return for_();
-
- case "function":
- return function_(AST_Defun);
-
- case "if":
- return if_();
-
- case "return":
- if (S.in_function == 0)
- croak("'return' outside of function");
- return new AST_Return({
- value: ( is("punc", ";")
- ? (next(), null)
- : can_insert_semicolon()
- ? null
- : (tmp = expression(true), semicolon(), tmp) )
- });
-
- case "switch":
- return new AST_Switch({
- expression : parenthesised(),
- body : in_loop(switch_body_)
- });
-
- case "throw":
- if (S.token.nlb)
- croak("Illegal newline after 'throw'");
- return new AST_Throw({
- value: (tmp = expression(true), semicolon(), tmp)
- });
-
- case "try":
- return try_();
-
- case "var":
- return tmp = var_(), semicolon(), tmp;
-
- case "const":
- return tmp = const_(), semicolon(), tmp;
-
- case "with":
- return new AST_With({
- expression : parenthesised(),
- body : statement()
- });
-
- default:
- unexpected();
- }
- }
- });
-
- function labeled_statement() {
- var label = as_symbol(AST_Label);
- if (find_if(function(l){ return l.name == label.name }, S.labels)) {
- // ECMA-262, 12.12: An ECMAScript program is considered
- // syntactically incorrect if it contains a
- // LabelledStatement that is enclosed by a
- // LabelledStatement with the same Identifier as label.
- croak("Label " + label.name + " defined twice");
- }
- expect(":");
- S.labels.push(label);
- var stat = statement();
- S.labels.pop();
- if (!(stat instanceof AST_IterationStatement)) {
- // check for `continue` that refers to this label.
- // those should be reported as syntax errors.
- // https://github.com/mishoo/UglifyJS2/issues/287
- label.references.forEach(function(ref){
- if (ref instanceof AST_Continue) {
- ref = ref.label.start;
- croak("Continue label `" + label.name + "` refers to non-IterationStatement.",
- ref.line, ref.col, ref.pos);
- }
- });
- }
- return new AST_LabeledStatement({ body: stat, label: label });
- };
-
- function simple_statement(tmp) {
- return new AST_SimpleStatement({ body: (tmp = expression(true), semicolon(), tmp) });
- };
-
- function break_cont(type) {
- var label = null, ldef;
- if (!can_insert_semicolon()) {
- label = as_symbol(AST_LabelRef, true);
- }
- if (label != null) {
- ldef = find_if(function(l){ return l.name == label.name }, S.labels);
- if (!ldef)
- croak("Undefined label " + label.name);
- label.thedef = ldef;
- }
- else if (S.in_loop == 0)
- croak(type.TYPE + " not inside a loop or switch");
- semicolon();
- var stat = new type({ label: label });
- if (ldef) ldef.references.push(stat);
- return stat;
- };
-
- function for_() {
- expect("(");
- var init = null;
- if (!is("punc", ";")) {
- init = is("keyword", "var")
- ? (next(), var_(true))
- : expression(true, true);
- if (is("operator", "in")) {
- if (init instanceof AST_Var && init.definitions.length > 1)
- croak("Only one variable declaration allowed in for..in loop");
- next();
- return for_in(init);
- }
- }
- return regular_for(init);
- };
-
- function regular_for(init) {
- expect(";");
- var test = is("punc", ";") ? null : expression(true);
- expect(";");
- var step = is("punc", ")") ? null : expression(true);
- expect(")");
- return new AST_For({
- init : init,
- condition : test,
- step : step,
- body : in_loop(statement)
- });
- };
-
- function for_in(init) {
- var lhs = init instanceof AST_Var ? init.definitions[0].name : null;
- var obj = expression(true);
- expect(")");
- return new AST_ForIn({
- init : init,
- name : lhs,
- object : obj,
- body : in_loop(statement)
- });
- };
-
- var function_ = function(ctor) {
- var in_statement = ctor === AST_Defun;
- var name = is("name") ? as_symbol(in_statement ? AST_SymbolDefun : AST_SymbolLambda) : null;
- if (in_statement && !name)
- unexpected();
- expect("(");
- return new ctor({
- name: name,
- argnames: (function(first, a){
- while (!is("punc", ")")) {
- if (first) first = false; else expect(",");
- a.push(as_symbol(AST_SymbolFunarg));
- }
- next();
- return a;
- })(true, []),
- body: (function(loop, labels){
- ++S.in_function;
- S.in_directives = true;
- S.in_loop = 0;
- S.labels = [];
- var a = block_();
- --S.in_function;
- S.in_loop = loop;
- S.labels = labels;
- return a;
- })(S.in_loop, S.labels)
- });
- };
-
- function if_() {
- var cond = parenthesised(), body = statement(), belse = null;
- if (is("keyword", "else")) {
- next();
- belse = statement();
- }
- return new AST_If({
- condition : cond,
- body : body,
- alternative : belse
- });
- };
-
- function block_() {
- expect("{");
- var a = [];
- while (!is("punc", "}")) {
- if (is("eof")) unexpected();
- a.push(statement());
- }
- next();
- return a;
- };
-
- function switch_body_() {
- expect("{");
- var a = [], cur = null, branch = null, tmp;
- while (!is("punc", "}")) {
- if (is("eof")) unexpected();
- if (is("keyword", "case")) {
- if (branch) branch.end = prev();
- cur = [];
- branch = new AST_Case({
- start : (tmp = S.token, next(), tmp),
- expression : expression(true),
- body : cur
- });
- a.push(branch);
- expect(":");
- }
- else if (is("keyword", "default")) {
- if (branch) branch.end = prev();
- cur = [];
- branch = new AST_Default({
- start : (tmp = S.token, next(), expect(":"), tmp),
- body : cur
- });
- a.push(branch);
- }
- else {
- if (!cur) unexpected();
- cur.push(statement());
- }
- }
- if (branch) branch.end = prev();
- next();
- return a;
- };
-
- function try_() {
- var body = block_(), bcatch = null, bfinally = null;
- if (is("keyword", "catch")) {
- var start = S.token;
- next();
- expect("(");
- var name = as_symbol(AST_SymbolCatch);
- expect(")");
- bcatch = new AST_Catch({
- start : start,
- argname : name,
- body : block_(),
- end : prev()
- });
- }
- if (is("keyword", "finally")) {
- var start = S.token;
- next();
- bfinally = new AST_Finally({
- start : start,
- body : block_(),
- end : prev()
- });
- }
- if (!bcatch && !bfinally)
- croak("Missing catch/finally blocks");
- return new AST_Try({
- body : body,
- bcatch : bcatch,
- bfinally : bfinally
- });
- };
-
- function vardefs(no_in, in_const) {
- var a = [];
- for (;;) {
- a.push(new AST_VarDef({
- start : S.token,
- name : as_symbol(in_const ? AST_SymbolConst : AST_SymbolVar),
- value : is("operator", "=") ? (next(), expression(false, no_in)) : null,
- end : prev()
- }));
- if (!is("punc", ","))
- break;
- next();
- }
- return a;
- };
-
- var var_ = function(no_in) {
- return new AST_Var({
- start : prev(),
- definitions : vardefs(no_in, false),
- end : prev()
- });
- };
-
- var const_ = function() {
- return new AST_Const({
- start : prev(),
- definitions : vardefs(false, true),
- end : prev()
- });
- };
-
- var new_ = function() {
- var start = S.token;
- expect_token("operator", "new");
- var newexp = expr_atom(false), args;
- if (is("punc", "(")) {
- next();
- args = expr_list(")");
- } else {
- args = [];
- }
- return subscripts(new AST_New({
- start : start,
- expression : newexp,
- args : args,
- end : prev()
- }), true);
- };
-
- function as_atom_node() {
- var tok = S.token, ret;
- switch (tok.type) {
- case "name":
- case "keyword":
- ret = _make_symbol(AST_SymbolRef);
- break;
- case "num":
- ret = new AST_Number({ start: tok, end: tok, value: tok.value });
- break;
- case "string":
- ret = new AST_String({ start: tok, end: tok, value: tok.value });
- break;
- case "regexp":
- ret = new AST_RegExp({ start: tok, end: tok, value: tok.value });
- break;
- case "atom":
- switch (tok.value) {
- case "false":
- ret = new AST_False({ start: tok, end: tok });
- break;
- case "true":
- ret = new AST_True({ start: tok, end: tok });
- break;
- case "null":
- ret = new AST_Null({ start: tok, end: tok });
- break;
- }
- break;
- }
- next();
- return ret;
- };
-
- var expr_atom = function(allow_calls) {
- if (is("operator", "new")) {
- return new_();
- }
- var start = S.token;
- if (is("punc")) {
- switch (start.value) {
- case "(":
- next();
- var ex = expression(true);
- ex.start = start;
- ex.end = S.token;
- expect(")");
- return subscripts(ex, allow_calls);
- case "[":
- return subscripts(array_(), allow_calls);
- case "{":
- return subscripts(object_(), allow_calls);
- }
- unexpected();
- }
- if (is("keyword", "function")) {
- next();
- var func = function_(AST_Function);
- func.start = start;
- func.end = prev();
- return subscripts(func, allow_calls);
- }
- if (ATOMIC_START_TOKEN[S.token.type]) {
- return subscripts(as_atom_node(), allow_calls);
- }
- unexpected();
- };
-
- function expr_list(closing, allow_trailing_comma, allow_empty) {
- var first = true, a = [];
- while (!is("punc", closing)) {
- if (first) first = false; else expect(",");
- if (allow_trailing_comma && is("punc", closing)) break;
- if (is("punc", ",") && allow_empty) {
- a.push(new AST_Hole({ start: S.token, end: S.token }));
- } else {
- a.push(expression(false));
- }
- }
- next();
- return a;
- };
-
- var array_ = embed_tokens(function() {
- expect("[");
- return new AST_Array({
- elements: expr_list("]", !options.strict, true)
- });
- });
-
- var object_ = embed_tokens(function() {
- expect("{");
- var first = true, a = [];
- while (!is("punc", "}")) {
- if (first) first = false; else expect(",");
- if (!options.strict && is("punc", "}"))
- // allow trailing comma
- break;
- var start = S.token;
- var type = start.type;
- var name = as_property_name();
- if (type == "name" && !is("punc", ":")) {
- if (name == "get") {
- a.push(new AST_ObjectGetter({
- start : start,
- key : as_atom_node(),
- value : function_(AST_Accessor),
- end : prev()
- }));
- continue;
- }
- if (name == "set") {
- a.push(new AST_ObjectSetter({
- start : start,
- key : as_atom_node(),
- value : function_(AST_Accessor),
- end : prev()
- }));
- continue;
- }
- }
- expect(":");
- a.push(new AST_ObjectKeyVal({
- start : start,
- key : name,
- value : expression(false),
- end : prev()
- }));
- }
- next();
- return new AST_Object({ properties: a });
- });
-
- function as_property_name() {
- var tmp = S.token;
- next();
- switch (tmp.type) {
- case "num":
- case "string":
- case "name":
- case "operator":
- case "keyword":
- case "atom":
- return tmp.value;
- default:
- unexpected();
- }
- };
-
- function as_name() {
- var tmp = S.token;
- next();
- switch (tmp.type) {
- case "name":
- case "operator":
- case "keyword":
- case "atom":
- return tmp.value;
- default:
- unexpected();
- }
- };
-
- function _make_symbol(type) {
- var name = S.token.value;
- return new (name == "this" ? AST_This : type)({
- name : String(name),
- start : S.token,
- end : S.token
- });
- };
-
- function as_symbol(type, noerror) {
- if (!is("name")) {
- if (!noerror) croak("Name expected");
- return null;
- }
- var sym = _make_symbol(type);
- next();
- return sym;
- };
-
- var subscripts = function(expr, allow_calls) {
- var start = expr.start;
- if (is("punc", ".")) {
- next();
- return subscripts(new AST_Dot({
- start : start,
- expression : expr,
- property : as_name(),
- end : prev()
- }), allow_calls);
- }
- if (is("punc", "[")) {
- next();
- var prop = expression(true);
- expect("]");
- return subscripts(new AST_Sub({
- start : start,
- expression : expr,
- property : prop,
- end : prev()
- }), allow_calls);
- }
- if (allow_calls && is("punc", "(")) {
- next();
- return subscripts(new AST_Call({
- start : start,
- expression : expr,
- args : expr_list(")"),
- end : prev()
- }), true);
- }
- return expr;
- };
-
- var maybe_unary = function(allow_calls) {
- var start = S.token;
- if (is("operator") && UNARY_PREFIX(start.value)) {
- next();
- handle_regexp();
- var ex = make_unary(AST_UnaryPrefix, start.value, maybe_unary(allow_calls));
- ex.start = start;
- ex.end = prev();
- return ex;
- }
- var val = expr_atom(allow_calls);
- while (is("operator") && UNARY_POSTFIX(S.token.value) && !S.token.nlb) {
- val = make_unary(AST_UnaryPostfix, S.token.value, val);
- val.start = start;
- val.end = S.token;
- next();
- }
- return val;
- };
-
- function make_unary(ctor, op, expr) {
- if ((op == "++" || op == "--") && !is_assignable(expr))
- croak("Invalid use of " + op + " operator");
- return new ctor({ operator: op, expression: expr });
- };
-
- var expr_op = function(left, min_prec, no_in) {
- var op = is("operator") ? S.token.value : null;
- if (op == "in" && no_in) op = null;
- var prec = op != null ? PRECEDENCE[op] : null;
- if (prec != null && prec > min_prec) {
- next();
- var right = expr_op(maybe_unary(true), prec, no_in);
- return expr_op(new AST_Binary({
- start : left.start,
- left : left,
- operator : op,
- right : right,
- end : right.end
- }), min_prec, no_in);
- }
- return left;
- };
-
- function expr_ops(no_in) {
- return expr_op(maybe_unary(true), 0, no_in);
- };
-
- var maybe_conditional = function(no_in) {
- var start = S.token;
- var expr = expr_ops(no_in);
- if (is("operator", "?")) {
- next();
- var yes = expression(false);
- expect(":");
- return new AST_Conditional({
- start : start,
- condition : expr,
- consequent : yes,
- alternative : expression(false, no_in),
- end : prev()
- });
- }
- return expr;
- };
-
- function is_assignable(expr) {
- if (!options.strict) return true;
- if (expr instanceof AST_This) return false;
- return (expr instanceof AST_PropAccess || expr instanceof AST_Symbol);
- };
-
- var maybe_assign = function(no_in) {
- var start = S.token;
- var left = maybe_conditional(no_in), val = S.token.value;
- if (is("operator") && ASSIGNMENT(val)) {
- if (is_assignable(left)) {
- next();
- return new AST_Assign({
- start : start,
- left : left,
- operator : val,
- right : maybe_assign(no_in),
- end : prev()
- });
- }
- croak("Invalid assignment");
- }
- return left;
- };
-
- var expression = function(commas, no_in) {
- var start = S.token;
- var expr = maybe_assign(no_in);
- if (commas && is("punc", ",")) {
- next();
- return new AST_Seq({
- start : start,
- car : expr,
- cdr : expression(true, no_in),
- end : peek()
- });
- }
- return expr;
- };
-
- function in_loop(cont) {
- ++S.in_loop;
- var ret = cont();
- --S.in_loop;
- return ret;
- };
-
- if (options.expression) {
- return expression(true);
- }
-
- return (function(){
- var start = S.token;
- var body = [];
- while (!is("eof"))
- body.push(statement());
- var end = prev();
- var toplevel = options.toplevel;
- if (toplevel) {
- toplevel.body = toplevel.body.concat(body);
- toplevel.end = end;
- } else {
- toplevel = new AST_Toplevel({ start: start, body: body, end: end });
- }
- return toplevel;
- })();
-
-};
diff --git a/builder/node_modules/uglify-js/lib/scope.js b/builder/node_modules/uglify-js/lib/scope.js
deleted file mode 100644
index 1ce17fa6..00000000
--- a/builder/node_modules/uglify-js/lib/scope.js
+++ /dev/null
@@ -1,567 +0,0 @@
-/***********************************************************************
-
- A JavaScript tokenizer / parser / beautifier / compressor.
- https://github.com/mishoo/UglifyJS2
-
- -------------------------------- (C) ---------------------------------
-
- Author: Mihai Bazon
-
- http://mihai.bazon.net/blog
-
- Distributed under the BSD license:
-
- Copyright 2012 (c) Mihai Bazon
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- * Redistributions of source code must retain the above
- copyright notice, this list of conditions and the following
- disclaimer.
-
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials
- provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
- TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
- THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
-
- ***********************************************************************/
-
-"use strict";
-
-function SymbolDef(scope, index, orig) {
- this.name = orig.name;
- this.orig = [ orig ];
- this.scope = scope;
- this.references = [];
- this.global = false;
- this.mangled_name = null;
- this.undeclared = false;
- this.constant = false;
- this.index = index;
-};
-
-SymbolDef.prototype = {
- unmangleable: function(options) {
- return (this.global && !(options && options.toplevel))
- || this.undeclared
- || (!(options && options.eval) && (this.scope.uses_eval || this.scope.uses_with));
- },
- mangle: function(options) {
- if (!this.mangled_name && !this.unmangleable(options)) {
- var s = this.scope;
- if (!options.screw_ie8 && this.orig[0] instanceof AST_SymbolLambda)
- s = s.parent_scope;
- this.mangled_name = s.next_mangled(options, this);
- }
- }
-};
-
-AST_Toplevel.DEFMETHOD("figure_out_scope", function(options){
- options = defaults(options, {
- screw_ie8: false
- });
-
- // pass 1: setup scope chaining and handle definitions
- var self = this;
- var scope = self.parent_scope = null;
- var defun = null;
- var nesting = 0;
- var tw = new TreeWalker(function(node, descend){
- if (options.screw_ie8 && node instanceof AST_Catch) {
- var save_scope = scope;
- scope = new AST_Scope(node);
- scope.init_scope_vars(nesting);
- scope.parent_scope = save_scope;
- descend();
- scope = save_scope;
- return true;
- }
- if (node instanceof AST_Scope) {
- node.init_scope_vars(nesting);
- var save_scope = node.parent_scope = scope;
- var save_defun = defun;
- defun = scope = node;
- ++nesting; descend(); --nesting;
- scope = save_scope;
- defun = save_defun;
- return true; // don't descend again in TreeWalker
- }
- if (node instanceof AST_Directive) {
- node.scope = scope;
- push_uniq(scope.directives, node.value);
- return true;
- }
- if (node instanceof AST_With) {
- for (var s = scope; s; s = s.parent_scope)
- s.uses_with = true;
- return;
- }
- if (node instanceof AST_Symbol) {
- node.scope = scope;
- }
- if (node instanceof AST_SymbolLambda) {
- defun.def_function(node);
- }
- else if (node instanceof AST_SymbolDefun) {
- // Careful here, the scope where this should be defined is
- // the parent scope. The reason is that we enter a new
- // scope when we encounter the AST_Defun node (which is
- // instanceof AST_Scope) but we get to the symbol a bit
- // later.
- (node.scope = defun.parent_scope).def_function(node);
- }
- else if (node instanceof AST_SymbolVar
- || node instanceof AST_SymbolConst) {
- var def = defun.def_variable(node);
- def.constant = node instanceof AST_SymbolConst;
- def.init = tw.parent().value;
- }
- else if (node instanceof AST_SymbolCatch) {
- (options.screw_ie8 ? scope : defun)
- .def_variable(node);
- }
- });
- self.walk(tw);
-
- // pass 2: find back references and eval
- var func = null;
- var globals = self.globals = new Dictionary();
- var tw = new TreeWalker(function(node, descend){
- if (node instanceof AST_Lambda) {
- var prev_func = func;
- func = node;
- descend();
- func = prev_func;
- return true;
- }
- if (node instanceof AST_SymbolRef) {
- var name = node.name;
- var sym = node.scope.find_variable(name);
- if (!sym) {
- var g;
- if (globals.has(name)) {
- g = globals.get(name);
- } else {
- g = new SymbolDef(self, globals.size(), node);
- g.undeclared = true;
- g.global = true;
- globals.set(name, g);
- }
- node.thedef = g;
- if (name == "eval" && tw.parent() instanceof AST_Call) {
- for (var s = node.scope; s && !s.uses_eval; s = s.parent_scope)
- s.uses_eval = true;
- }
- if (func && name == "arguments") {
- func.uses_arguments = true;
- }
- } else {
- node.thedef = sym;
- }
- node.reference();
- return true;
- }
- });
- self.walk(tw);
-});
-
-AST_Scope.DEFMETHOD("init_scope_vars", function(nesting){
- this.directives = []; // contains the directives defined in this scope, i.e. "use strict"
- this.variables = new Dictionary(); // map name to AST_SymbolVar (variables defined in this scope; includes functions)
- this.functions = new Dictionary(); // map name to AST_SymbolDefun (functions defined in this scope)
- this.uses_with = false; // will be set to true if this or some nested scope uses the `with` statement
- this.uses_eval = false; // will be set to true if this or nested scope uses the global `eval`
- this.parent_scope = null; // the parent scope
- this.enclosed = []; // a list of variables from this or outer scope(s) that are referenced from this or inner scopes
- this.cname = -1; // the current index for mangling functions/variables
- this.nesting = nesting; // the nesting level of this scope (0 means toplevel)
-});
-
-AST_Scope.DEFMETHOD("strict", function(){
- return this.has_directive("use strict");
-});
-
-AST_Lambda.DEFMETHOD("init_scope_vars", function(){
- AST_Scope.prototype.init_scope_vars.apply(this, arguments);
- this.uses_arguments = false;
-});
-
-AST_SymbolRef.DEFMETHOD("reference", function() {
- var def = this.definition();
- def.references.push(this);
- var s = this.scope;
- while (s) {
- push_uniq(s.enclosed, def);
- if (s === def.scope) break;
- s = s.parent_scope;
- }
- this.frame = this.scope.nesting - def.scope.nesting;
-});
-
-AST_Scope.DEFMETHOD("find_variable", function(name){
- if (name instanceof AST_Symbol) name = name.name;
- return this.variables.get(name)
- || (this.parent_scope && this.parent_scope.find_variable(name));
-});
-
-AST_Scope.DEFMETHOD("has_directive", function(value){
- return this.parent_scope && this.parent_scope.has_directive(value)
- || (this.directives.indexOf(value) >= 0 ? this : null);
-});
-
-AST_Scope.DEFMETHOD("def_function", function(symbol){
- this.functions.set(symbol.name, this.def_variable(symbol));
-});
-
-AST_Scope.DEFMETHOD("def_variable", function(symbol){
- var def;
- if (!this.variables.has(symbol.name)) {
- def = new SymbolDef(this, this.variables.size(), symbol);
- this.variables.set(symbol.name, def);
- def.global = !this.parent_scope;
- } else {
- def = this.variables.get(symbol.name);
- def.orig.push(symbol);
- }
- return symbol.thedef = def;
-});
-
-AST_Scope.DEFMETHOD("next_mangled", function(options){
- var ext = this.enclosed;
- out: while (true) {
- var m = base54(++this.cname);
- if (!is_identifier(m)) continue; // skip over "do"
-
- // https://github.com/mishoo/UglifyJS2/issues/242 -- do not
- // shadow a name excepted from mangling.
- if (options.except.indexOf(m) >= 0) continue;
-
- // we must ensure that the mangled name does not shadow a name
- // from some parent scope that is referenced in this or in
- // inner scopes.
- for (var i = ext.length; --i >= 0;) {
- var sym = ext[i];
- var name = sym.mangled_name || (sym.unmangleable(options) && sym.name);
- if (m == name) continue out;
- }
- return m;
- }
-});
-
-AST_Function.DEFMETHOD("next_mangled", function(options, def){
- // #179, #326
- // in Safari strict mode, something like (function x(x){...}) is a syntax error;
- // a function expression's argument cannot shadow the function expression's name
-
- var tricky_def = def.orig[0] instanceof AST_SymbolFunarg && this.name && this.name.definition();
- while (true) {
- var name = AST_Lambda.prototype.next_mangled.call(this, options, def);
- if (!(tricky_def && tricky_def.mangled_name == name))
- return name;
- }
-});
-
-AST_Scope.DEFMETHOD("references", function(sym){
- if (sym instanceof AST_Symbol) sym = sym.definition();
- return this.enclosed.indexOf(sym) < 0 ? null : sym;
-});
-
-AST_Symbol.DEFMETHOD("unmangleable", function(options){
- return this.definition().unmangleable(options);
-});
-
-// property accessors are not mangleable
-AST_SymbolAccessor.DEFMETHOD("unmangleable", function(){
- return true;
-});
-
-// labels are always mangleable
-AST_Label.DEFMETHOD("unmangleable", function(){
- return false;
-});
-
-AST_Symbol.DEFMETHOD("unreferenced", function(){
- return this.definition().references.length == 0
- && !(this.scope.uses_eval || this.scope.uses_with);
-});
-
-AST_Symbol.DEFMETHOD("undeclared", function(){
- return this.definition().undeclared;
-});
-
-AST_LabelRef.DEFMETHOD("undeclared", function(){
- return false;
-});
-
-AST_Label.DEFMETHOD("undeclared", function(){
- return false;
-});
-
-AST_Symbol.DEFMETHOD("definition", function(){
- return this.thedef;
-});
-
-AST_Symbol.DEFMETHOD("global", function(){
- return this.definition().global;
-});
-
-AST_Toplevel.DEFMETHOD("_default_mangler_options", function(options){
- return defaults(options, {
- except : [],
- eval : false,
- sort : false,
- toplevel : false,
- screw_ie8 : false
- });
-});
-
-AST_Toplevel.DEFMETHOD("mangle_names", function(options){
- options = this._default_mangler_options(options);
- // We only need to mangle declaration nodes. Special logic wired
- // into the code generator will display the mangled name if it's
- // present (and for AST_SymbolRef-s it'll use the mangled name of
- // the AST_SymbolDeclaration that it points to).
- var lname = -1;
- var to_mangle = [];
- var tw = new TreeWalker(function(node, descend){
- if (node instanceof AST_LabeledStatement) {
- // lname is incremented when we get to the AST_Label
- var save_nesting = lname;
- descend();
- lname = save_nesting;
- return true; // don't descend again in TreeWalker
- }
- if (node instanceof AST_Scope) {
- var p = tw.parent(), a = [];
- node.variables.each(function(symbol){
- if (options.except.indexOf(symbol.name) < 0) {
- a.push(symbol);
- }
- });
- if (options.sort) a.sort(function(a, b){
- return b.references.length - a.references.length;
- });
- to_mangle.push.apply(to_mangle, a);
- return;
- }
- if (node instanceof AST_Label) {
- var name;
- do name = base54(++lname); while (!is_identifier(name));
- node.mangled_name = name;
- return true;
- }
- if (options.screw_ie8 && node instanceof AST_SymbolCatch) {
- to_mangle.push(node.definition());
- return;
- }
- });
- this.walk(tw);
- to_mangle.forEach(function(def){ def.mangle(options) });
-});
-
-AST_Toplevel.DEFMETHOD("compute_char_frequency", function(options){
- options = this._default_mangler_options(options);
- var tw = new TreeWalker(function(node){
- if (node instanceof AST_Constant)
- base54.consider(node.print_to_string());
- else if (node instanceof AST_Return)
- base54.consider("return");
- else if (node instanceof AST_Throw)
- base54.consider("throw");
- else if (node instanceof AST_Continue)
- base54.consider("continue");
- else if (node instanceof AST_Break)
- base54.consider("break");
- else if (node instanceof AST_Debugger)
- base54.consider("debugger");
- else if (node instanceof AST_Directive)
- base54.consider(node.value);
- else if (node instanceof AST_While)
- base54.consider("while");
- else if (node instanceof AST_Do)
- base54.consider("do while");
- else if (node instanceof AST_If) {
- base54.consider("if");
- if (node.alternative) base54.consider("else");
- }
- else if (node instanceof AST_Var)
- base54.consider("var");
- else if (node instanceof AST_Const)
- base54.consider("const");
- else if (node instanceof AST_Lambda)
- base54.consider("function");
- else if (node instanceof AST_For)
- base54.consider("for");
- else if (node instanceof AST_ForIn)
- base54.consider("for in");
- else if (node instanceof AST_Switch)
- base54.consider("switch");
- else if (node instanceof AST_Case)
- base54.consider("case");
- else if (node instanceof AST_Default)
- base54.consider("default");
- else if (node instanceof AST_With)
- base54.consider("with");
- else if (node instanceof AST_ObjectSetter)
- base54.consider("set" + node.key);
- else if (node instanceof AST_ObjectGetter)
- base54.consider("get" + node.key);
- else if (node instanceof AST_ObjectKeyVal)
- base54.consider(node.key);
- else if (node instanceof AST_New)
- base54.consider("new");
- else if (node instanceof AST_This)
- base54.consider("this");
- else if (node instanceof AST_Try)
- base54.consider("try");
- else if (node instanceof AST_Catch)
- base54.consider("catch");
- else if (node instanceof AST_Finally)
- base54.consider("finally");
- else if (node instanceof AST_Symbol && node.unmangleable(options))
- base54.consider(node.name);
- else if (node instanceof AST_Unary || node instanceof AST_Binary)
- base54.consider(node.operator);
- else if (node instanceof AST_Dot)
- base54.consider(node.property);
- });
- this.walk(tw);
- base54.sort();
-});
-
-var base54 = (function() {
- var string = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_0123456789";
- var chars, frequency;
- function reset() {
- frequency = Object.create(null);
- chars = string.split("").map(function(ch){ return ch.charCodeAt(0) });
- chars.forEach(function(ch){ frequency[ch] = 0 });
- }
- base54.consider = function(str){
- for (var i = str.length; --i >= 0;) {
- var code = str.charCodeAt(i);
- if (code in frequency) ++frequency[code];
- }
- };
- base54.sort = function() {
- chars = mergeSort(chars, function(a, b){
- if (is_digit(a) && !is_digit(b)) return 1;
- if (is_digit(b) && !is_digit(a)) return -1;
- return frequency[b] - frequency[a];
- });
- };
- base54.reset = reset;
- reset();
- base54.get = function(){ return chars };
- base54.freq = function(){ return frequency };
- function base54(num) {
- var ret = "", base = 54;
- do {
- ret += String.fromCharCode(chars[num % base]);
- num = Math.floor(num / base);
- base = 64;
- } while (num > 0);
- return ret;
- };
- return base54;
-})();
-
-AST_Toplevel.DEFMETHOD("scope_warnings", function(options){
- options = defaults(options, {
- undeclared : false, // this makes a lot of noise
- unreferenced : true,
- assign_to_global : true,
- func_arguments : true,
- nested_defuns : true,
- eval : true
- });
- var tw = new TreeWalker(function(node){
- if (options.undeclared
- && node instanceof AST_SymbolRef
- && node.undeclared())
- {
- // XXX: this also warns about JS standard names,
- // i.e. Object, Array, parseInt etc. Should add a list of
- // exceptions.
- AST_Node.warn("Undeclared symbol: {name} [{file}:{line},{col}]", {
- name: node.name,
- file: node.start.file,
- line: node.start.line,
- col: node.start.col
- });
- }
- if (options.assign_to_global)
- {
- var sym = null;
- if (node instanceof AST_Assign && node.left instanceof AST_SymbolRef)
- sym = node.left;
- else if (node instanceof AST_ForIn && node.init instanceof AST_SymbolRef)
- sym = node.init;
- if (sym
- && (sym.undeclared()
- || (sym.global() && sym.scope !== sym.definition().scope))) {
- AST_Node.warn("{msg}: {name} [{file}:{line},{col}]", {
- msg: sym.undeclared() ? "Accidental global?" : "Assignment to global",
- name: sym.name,
- file: sym.start.file,
- line: sym.start.line,
- col: sym.start.col
- });
- }
- }
- if (options.eval
- && node instanceof AST_SymbolRef
- && node.undeclared()
- && node.name == "eval") {
- AST_Node.warn("Eval is used [{file}:{line},{col}]", node.start);
- }
- if (options.unreferenced
- && (node instanceof AST_SymbolDeclaration || node instanceof AST_Label)
- && node.unreferenced()) {
- AST_Node.warn("{type} {name} is declared but not referenced [{file}:{line},{col}]", {
- type: node instanceof AST_Label ? "Label" : "Symbol",
- name: node.name,
- file: node.start.file,
- line: node.start.line,
- col: node.start.col
- });
- }
- if (options.func_arguments
- && node instanceof AST_Lambda
- && node.uses_arguments) {
- AST_Node.warn("arguments used in function {name} [{file}:{line},{col}]", {
- name: node.name ? node.name.name : "anonymous",
- file: node.start.file,
- line: node.start.line,
- col: node.start.col
- });
- }
- if (options.nested_defuns
- && node instanceof AST_Defun
- && !(tw.parent() instanceof AST_Scope)) {
- AST_Node.warn("Function {name} declared in nested statement \"{type}\" [{file}:{line},{col}]", {
- name: node.name.name,
- type: tw.parent().TYPE,
- file: node.start.file,
- line: node.start.line,
- col: node.start.col
- });
- }
- });
- this.walk(tw);
-});
diff --git a/builder/node_modules/uglify-js/lib/sourcemap.js b/builder/node_modules/uglify-js/lib/sourcemap.js
deleted file mode 100644
index 663ef12e..00000000
--- a/builder/node_modules/uglify-js/lib/sourcemap.js
+++ /dev/null
@@ -1,87 +0,0 @@
-/***********************************************************************
-
- A JavaScript tokenizer / parser / beautifier / compressor.
- https://github.com/mishoo/UglifyJS2
-
- -------------------------------- (C) ---------------------------------
-
- Author: Mihai Bazon
-
- http://mihai.bazon.net/blog
-
- Distributed under the BSD license:
-
- Copyright 2012 (c) Mihai Bazon
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- * Redistributions of source code must retain the above
- copyright notice, this list of conditions and the following
- disclaimer.
-
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials
- provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
- TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
- THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
-
- ***********************************************************************/
-
-"use strict";
-
-// a small wrapper around fitzgen's source-map library
-function SourceMap(options) {
- options = defaults(options, {
- file : null,
- root : null,
- orig : null,
-
- orig_line_diff : 0,
- dest_line_diff : 0,
- });
- var generator = new MOZ_SourceMap.SourceMapGenerator({
- file : options.file,
- sourceRoot : options.root
- });
- var orig_map = options.orig && new MOZ_SourceMap.SourceMapConsumer(options.orig);
- function add(source, gen_line, gen_col, orig_line, orig_col, name) {
- if (orig_map) {
- var info = orig_map.originalPositionFor({
- line: orig_line,
- column: orig_col
- });
- if (info.source === null) {
- return;
- }
- source = info.source;
- orig_line = info.line;
- orig_col = info.column;
- name = info.name;
- }
- generator.addMapping({
- generated : { line: gen_line + options.dest_line_diff, column: gen_col },
- original : { line: orig_line + options.orig_line_diff, column: orig_col },
- source : source,
- name : name
- });
- };
- return {
- add : add,
- get : function() { return generator },
- toString : function() { return generator.toString() }
- };
-};
diff --git a/builder/node_modules/uglify-js/lib/transform.js b/builder/node_modules/uglify-js/lib/transform.js
deleted file mode 100644
index c3c34f58..00000000
--- a/builder/node_modules/uglify-js/lib/transform.js
+++ /dev/null
@@ -1,218 +0,0 @@
-/***********************************************************************
-
- A JavaScript tokenizer / parser / beautifier / compressor.
- https://github.com/mishoo/UglifyJS2
-
- -------------------------------- (C) ---------------------------------
-
- Author: Mihai Bazon
-
- http://mihai.bazon.net/blog
-
- Distributed under the BSD license:
-
- Copyright 2012 (c) Mihai Bazon
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- * Redistributions of source code must retain the above
- copyright notice, this list of conditions and the following
- disclaimer.
-
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials
- provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
- TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
- THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
-
- ***********************************************************************/
-
-"use strict";
-
-// Tree transformer helpers.
-
-function TreeTransformer(before, after) {
- TreeWalker.call(this);
- this.before = before;
- this.after = after;
-}
-TreeTransformer.prototype = new TreeWalker;
-
-(function(undefined){
-
- function _(node, descend) {
- node.DEFMETHOD("transform", function(tw, in_list){
- var x, y;
- tw.push(this);
- if (tw.before) x = tw.before(this, descend, in_list);
- if (x === undefined) {
- if (!tw.after) {
- x = this;
- descend(x, tw);
- } else {
- tw.stack[tw.stack.length - 1] = x = this.clone();
- descend(x, tw);
- y = tw.after(x, in_list);
- if (y !== undefined) x = y;
- }
- }
- tw.pop();
- return x;
- });
- };
-
- function do_list(list, tw) {
- return MAP(list, function(node){
- return node.transform(tw, true);
- });
- };
-
- _(AST_Node, noop);
-
- _(AST_LabeledStatement, function(self, tw){
- self.label = self.label.transform(tw);
- self.body = self.body.transform(tw);
- });
-
- _(AST_SimpleStatement, function(self, tw){
- self.body = self.body.transform(tw);
- });
-
- _(AST_Block, function(self, tw){
- self.body = do_list(self.body, tw);
- });
-
- _(AST_DWLoop, function(self, tw){
- self.condition = self.condition.transform(tw);
- self.body = self.body.transform(tw);
- });
-
- _(AST_For, function(self, tw){
- if (self.init) self.init = self.init.transform(tw);
- if (self.condition) self.condition = self.condition.transform(tw);
- if (self.step) self.step = self.step.transform(tw);
- self.body = self.body.transform(tw);
- });
-
- _(AST_ForIn, function(self, tw){
- self.init = self.init.transform(tw);
- self.object = self.object.transform(tw);
- self.body = self.body.transform(tw);
- });
-
- _(AST_With, function(self, tw){
- self.expression = self.expression.transform(tw);
- self.body = self.body.transform(tw);
- });
-
- _(AST_Exit, function(self, tw){
- if (self.value) self.value = self.value.transform(tw);
- });
-
- _(AST_LoopControl, function(self, tw){
- if (self.label) self.label = self.label.transform(tw);
- });
-
- _(AST_If, function(self, tw){
- self.condition = self.condition.transform(tw);
- self.body = self.body.transform(tw);
- if (self.alternative) self.alternative = self.alternative.transform(tw);
- });
-
- _(AST_Switch, function(self, tw){
- self.expression = self.expression.transform(tw);
- self.body = do_list(self.body, tw);
- });
-
- _(AST_Case, function(self, tw){
- self.expression = self.expression.transform(tw);
- self.body = do_list(self.body, tw);
- });
-
- _(AST_Try, function(self, tw){
- self.body = do_list(self.body, tw);
- if (self.bcatch) self.bcatch = self.bcatch.transform(tw);
- if (self.bfinally) self.bfinally = self.bfinally.transform(tw);
- });
-
- _(AST_Catch, function(self, tw){
- self.argname = self.argname.transform(tw);
- self.body = do_list(self.body, tw);
- });
-
- _(AST_Definitions, function(self, tw){
- self.definitions = do_list(self.definitions, tw);
- });
-
- _(AST_VarDef, function(self, tw){
- self.name = self.name.transform(tw);
- if (self.value) self.value = self.value.transform(tw);
- });
-
- _(AST_Lambda, function(self, tw){
- if (self.name) self.name = self.name.transform(tw);
- self.argnames = do_list(self.argnames, tw);
- self.body = do_list(self.body, tw);
- });
-
- _(AST_Call, function(self, tw){
- self.expression = self.expression.transform(tw);
- self.args = do_list(self.args, tw);
- });
-
- _(AST_Seq, function(self, tw){
- self.car = self.car.transform(tw);
- self.cdr = self.cdr.transform(tw);
- });
-
- _(AST_Dot, function(self, tw){
- self.expression = self.expression.transform(tw);
- });
-
- _(AST_Sub, function(self, tw){
- self.expression = self.expression.transform(tw);
- self.property = self.property.transform(tw);
- });
-
- _(AST_Unary, function(self, tw){
- self.expression = self.expression.transform(tw);
- });
-
- _(AST_Binary, function(self, tw){
- self.left = self.left.transform(tw);
- self.right = self.right.transform(tw);
- });
-
- _(AST_Conditional, function(self, tw){
- self.condition = self.condition.transform(tw);
- self.consequent = self.consequent.transform(tw);
- self.alternative = self.alternative.transform(tw);
- });
-
- _(AST_Array, function(self, tw){
- self.elements = do_list(self.elements, tw);
- });
-
- _(AST_Object, function(self, tw){
- self.properties = do_list(self.properties, tw);
- });
-
- _(AST_ObjectProperty, function(self, tw){
- self.value = self.value.transform(tw);
- });
-
-})();
diff --git a/builder/node_modules/uglify-js/lib/utils.js b/builder/node_modules/uglify-js/lib/utils.js
deleted file mode 100644
index 7c6a1563..00000000
--- a/builder/node_modules/uglify-js/lib/utils.js
+++ /dev/null
@@ -1,302 +0,0 @@
-/***********************************************************************
-
- A JavaScript tokenizer / parser / beautifier / compressor.
- https://github.com/mishoo/UglifyJS2
-
- -------------------------------- (C) ---------------------------------
-
- Author: Mihai Bazon
-
- http://mihai.bazon.net/blog
-
- Distributed under the BSD license:
-
- Copyright 2012 (c) Mihai Bazon
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- * Redistributions of source code must retain the above
- copyright notice, this list of conditions and the following
- disclaimer.
-
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials
- provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
- TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
- THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
-
- ***********************************************************************/
-
-"use strict";
-
-function array_to_hash(a) {
- var ret = Object.create(null);
- for (var i = 0; i < a.length; ++i)
- ret[a[i]] = true;
- return ret;
-};
-
-function slice(a, start) {
- return Array.prototype.slice.call(a, start || 0);
-};
-
-function characters(str) {
- return str.split("");
-};
-
-function member(name, array) {
- for (var i = array.length; --i >= 0;)
- if (array[i] == name)
- return true;
- return false;
-};
-
-function find_if(func, array) {
- for (var i = 0, n = array.length; i < n; ++i) {
- if (func(array[i]))
- return array[i];
- }
-};
-
-function repeat_string(str, i) {
- if (i <= 0) return "";
- if (i == 1) return str;
- var d = repeat_string(str, i >> 1);
- d += d;
- if (i & 1) d += str;
- return d;
-};
-
-function DefaultsError(msg, defs) {
- Error.call(this, msg);
- this.msg = msg;
- this.defs = defs;
-};
-DefaultsError.prototype = Object.create(Error.prototype);
-DefaultsError.prototype.constructor = DefaultsError;
-
-DefaultsError.croak = function(msg, defs) {
- throw new DefaultsError(msg, defs);
-};
-
-function defaults(args, defs, croak) {
- if (args === true)
- args = {};
- var ret = args || {};
- if (croak) for (var i in ret) if (ret.hasOwnProperty(i) && !defs.hasOwnProperty(i))
- DefaultsError.croak("`" + i + "` is not a supported option", defs);
- for (var i in defs) if (defs.hasOwnProperty(i)) {
- ret[i] = (args && args.hasOwnProperty(i)) ? args[i] : defs[i];
- }
- return ret;
-};
-
-function merge(obj, ext) {
- for (var i in ext) if (ext.hasOwnProperty(i)) {
- obj[i] = ext[i];
- }
- return obj;
-};
-
-function noop() {};
-
-var MAP = (function(){
- function MAP(a, f, backwards) {
- var ret = [], top = [], i;
- function doit() {
- var val = f(a[i], i);
- var is_last = val instanceof Last;
- if (is_last) val = val.v;
- if (val instanceof AtTop) {
- val = val.v;
- if (val instanceof Splice) {
- top.push.apply(top, backwards ? val.v.slice().reverse() : val.v);
- } else {
- top.push(val);
- }
- }
- else if (val !== skip) {
- if (val instanceof Splice) {
- ret.push.apply(ret, backwards ? val.v.slice().reverse() : val.v);
- } else {
- ret.push(val);
- }
- }
- return is_last;
- };
- if (a instanceof Array) {
- if (backwards) {
- for (i = a.length; --i >= 0;) if (doit()) break;
- ret.reverse();
- top.reverse();
- } else {
- for (i = 0; i < a.length; ++i) if (doit()) break;
- }
- }
- else {
- for (i in a) if (a.hasOwnProperty(i)) if (doit()) break;
- }
- return top.concat(ret);
- };
- MAP.at_top = function(val) { return new AtTop(val) };
- MAP.splice = function(val) { return new Splice(val) };
- MAP.last = function(val) { return new Last(val) };
- var skip = MAP.skip = {};
- function AtTop(val) { this.v = val };
- function Splice(val) { this.v = val };
- function Last(val) { this.v = val };
- return MAP;
-})();
-
-function push_uniq(array, el) {
- if (array.indexOf(el) < 0)
- array.push(el);
-};
-
-function string_template(text, props) {
- return text.replace(/\{(.+?)\}/g, function(str, p){
- return props[p];
- });
-};
-
-function remove(array, el) {
- for (var i = array.length; --i >= 0;) {
- if (array[i] === el) array.splice(i, 1);
- }
-};
-
-function mergeSort(array, cmp) {
- if (array.length < 2) return array.slice();
- function merge(a, b) {
- var r = [], ai = 0, bi = 0, i = 0;
- while (ai < a.length && bi < b.length) {
- cmp(a[ai], b[bi]) <= 0
- ? r[i++] = a[ai++]
- : r[i++] = b[bi++];
- }
- if (ai < a.length) r.push.apply(r, a.slice(ai));
- if (bi < b.length) r.push.apply(r, b.slice(bi));
- return r;
- };
- function _ms(a) {
- if (a.length <= 1)
- return a;
- var m = Math.floor(a.length / 2), left = a.slice(0, m), right = a.slice(m);
- left = _ms(left);
- right = _ms(right);
- return merge(left, right);
- };
- return _ms(array);
-};
-
-function set_difference(a, b) {
- return a.filter(function(el){
- return b.indexOf(el) < 0;
- });
-};
-
-function set_intersection(a, b) {
- return a.filter(function(el){
- return b.indexOf(el) >= 0;
- });
-};
-
-// this function is taken from Acorn [1], written by Marijn Haverbeke
-// [1] https://github.com/marijnh/acorn
-function makePredicate(words) {
- if (!(words instanceof Array)) words = words.split(" ");
- var f = "", cats = [];
- out: for (var i = 0; i < words.length; ++i) {
- for (var j = 0; j < cats.length; ++j)
- if (cats[j][0].length == words[i].length) {
- cats[j].push(words[i]);
- continue out;
- }
- cats.push([words[i]]);
- }
- function compareTo(arr) {
- if (arr.length == 1) return f += "return str === " + JSON.stringify(arr[0]) + ";";
- f += "switch(str){";
- for (var i = 0; i < arr.length; ++i) f += "case " + JSON.stringify(arr[i]) + ":";
- f += "return true}return false;";
- }
- // When there are more than three length categories, an outer
- // switch first dispatches on the lengths, to save on comparisons.
- if (cats.length > 3) {
- cats.sort(function(a, b) {return b.length - a.length;});
- f += "switch(str.length){";
- for (var i = 0; i < cats.length; ++i) {
- var cat = cats[i];
- f += "case " + cat[0].length + ":";
- compareTo(cat);
- }
- f += "}";
- // Otherwise, simply generate a flat `switch` statement.
- } else {
- compareTo(words);
- }
- return new Function("str", f);
-};
-
-function all(array, predicate) {
- for (var i = array.length; --i >= 0;)
- if (!predicate(array[i]))
- return false;
- return true;
-};
-
-function Dictionary() {
- this._values = Object.create(null);
- this._size = 0;
-};
-Dictionary.prototype = {
- set: function(key, val) {
- if (!this.has(key)) ++this._size;
- this._values["$" + key] = val;
- return this;
- },
- add: function(key, val) {
- if (this.has(key)) {
- this.get(key).push(val);
- } else {
- this.set(key, [ val ]);
- }
- return this;
- },
- get: function(key) { return this._values["$" + key] },
- del: function(key) {
- if (this.has(key)) {
- --this._size;
- delete this._values["$" + key];
- }
- return this;
- },
- has: function(key) { return ("$" + key) in this._values },
- each: function(f) {
- for (var i in this._values)
- f(this._values[i], i.substr(1));
- },
- size: function() {
- return this._size;
- },
- map: function(f) {
- var ret = [];
- for (var i in this._values)
- ret.push(f(this._values[i], i.substr(1)));
- return ret;
- }
-};
diff --git a/builder/node_modules/uglify-js/node_modules/async/LICENSE b/builder/node_modules/uglify-js/node_modules/async/LICENSE
deleted file mode 100644
index b7f9d500..00000000
--- a/builder/node_modules/uglify-js/node_modules/async/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2010 Caolan McMahon
-
-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.
diff --git a/builder/node_modules/uglify-js/node_modules/async/README.md b/builder/node_modules/uglify-js/node_modules/async/README.md
deleted file mode 100644
index 951f76e9..00000000
--- a/builder/node_modules/uglify-js/node_modules/async/README.md
+++ /dev/null
@@ -1,1425 +0,0 @@
-# Async.js
-
-Async is a utility module which provides straight-forward, powerful functions
-for working with asynchronous JavaScript. Although originally designed for
-use with [node.js](http://nodejs.org), it can also be used directly in the
-browser. Also supports [component](https://github.com/component/component).
-
-Async provides around 20 functions that include the usual 'functional'
-suspects (map, reduce, filter, each…) as well as some common patterns
-for asynchronous control flow (parallel, series, waterfall…). All these
-functions assume you follow the node.js convention of providing a single
-callback as the last argument of your async function.
-
-
-## Quick Examples
-
-```javascript
-async.map(['file1','file2','file3'], fs.stat, function(err, results){
- // results is now an array of stats for each file
-});
-
-async.filter(['file1','file2','file3'], fs.exists, function(results){
- // results now equals an array of the existing files
-});
-
-async.parallel([
- function(){ ... },
- function(){ ... }
-], callback);
-
-async.series([
- function(){ ... },
- function(){ ... }
-]);
-```
-
-There are many more functions available so take a look at the docs below for a
-full list. This module aims to be comprehensive, so if you feel anything is
-missing please create a GitHub issue for it.
-
-## Common Pitfalls
-
-### Binding a context to an iterator
-
-This section is really about bind, not about async. If you are wondering how to
-make async execute your iterators in a given context, or are confused as to why
-a method of another library isn't working as an iterator, study this example:
-
-```js
-// Here is a simple object with an (unnecessarily roundabout) squaring method
-var AsyncSquaringLibrary = {
- squareExponent: 2,
- square: function(number, callback){
- var result = Math.pow(number, this.squareExponent);
- setTimeout(function(){
- callback(null, result);
- }, 200);
- }
-};
-
-async.map([1, 2, 3], AsyncSquaringLibrary.square, function(err, result){
- // result is [NaN, NaN, NaN]
- // This fails because the `this.squareExponent` expression in the square
- // function is not evaluated in the context of AsyncSquaringLibrary, and is
- // therefore undefined.
-});
-
-async.map([1, 2, 3], AsyncSquaringLibrary.square.bind(AsyncSquaringLibrary), function(err, result){
- // result is [1, 4, 9]
- // With the help of bind we can attach a context to the iterator before
- // passing it to async. Now the square function will be executed in its
- // 'home' AsyncSquaringLibrary context and the value of `this.squareExponent`
- // will be as expected.
-});
-```
-
-## Download
-
-The source is available for download from
-[GitHub](http://github.com/caolan/async).
-Alternatively, you can install using Node Package Manager (npm):
-
- npm install async
-
-__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 29.6kb Uncompressed
-
-## In the Browser
-
-So far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage:
-
-```html
-
-
-```
-
-## Documentation
-
-### Collections
-
-* [each](#each)
-* [eachSeries](#eachSeries)
-* [eachLimit](#eachLimit)
-* [map](#map)
-* [mapSeries](#mapSeries)
-* [mapLimit](#mapLimit)
-* [filter](#filter)
-* [filterSeries](#filterSeries)
-* [reject](#reject)
-* [rejectSeries](#rejectSeries)
-* [reduce](#reduce)
-* [reduceRight](#reduceRight)
-* [detect](#detect)
-* [detectSeries](#detectSeries)
-* [sortBy](#sortBy)
-* [some](#some)
-* [every](#every)
-* [concat](#concat)
-* [concatSeries](#concatSeries)
-
-### Control Flow
-
-* [series](#series)
-* [parallel](#parallel)
-* [parallelLimit](#parallellimittasks-limit-callback)
-* [whilst](#whilst)
-* [doWhilst](#doWhilst)
-* [until](#until)
-* [doUntil](#doUntil)
-* [forever](#forever)
-* [waterfall](#waterfall)
-* [compose](#compose)
-* [applyEach](#applyEach)
-* [applyEachSeries](#applyEachSeries)
-* [queue](#queue)
-* [cargo](#cargo)
-* [auto](#auto)
-* [iterator](#iterator)
-* [apply](#apply)
-* [nextTick](#nextTick)
-* [times](#times)
-* [timesSeries](#timesSeries)
-
-### Utils
-
-* [memoize](#memoize)
-* [unmemoize](#unmemoize)
-* [log](#log)
-* [dir](#dir)
-* [noConflict](#noConflict)
-
-
-## Collections
-
-
-
-### each(arr, iterator, callback)
-
-Applies an iterator function to each item in an array, in parallel.
-The iterator is called with an item from the list and a callback for when it
-has finished. If the iterator passes an error to this callback, the main
-callback for the each function is immediately called with the error.
-
-Note, that since this function applies the iterator to each item in parallel
-there is no guarantee that the iterator functions will complete in order.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* iterator(item, callback) - A function to apply to each item in the array.
- The iterator is passed a callback(err) which must be called once it has
- completed. If no error has occured, the callback should be run without
- arguments or with an explicit null argument.
-* callback(err) - A callback which is called after all the iterator functions
- have finished, or an error has occurred.
-
-__Example__
-
-```js
-// assuming openFiles is an array of file names and saveFile is a function
-// to save the modified contents of that file:
-
-async.each(openFiles, saveFile, function(err){
- // if any of the saves produced an error, err would equal that error
-});
-```
-
----------------------------------------
-
-
-
-### eachSeries(arr, iterator, callback)
-
-The same as each only the iterator is applied to each item in the array in
-series. The next iterator is only called once the current one has completed
-processing. This means the iterator functions will complete in order.
-
-
----------------------------------------
-
-
-
-### eachLimit(arr, limit, iterator, callback)
-
-The same as each only no more than "limit" iterators will be simultaneously
-running at any time.
-
-Note that the items are not processed in batches, so there is no guarantee that
- the first "limit" iterator functions will complete before any others are
-started.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* limit - The maximum number of iterators to run at any time.
-* iterator(item, callback) - A function to apply to each item in the array.
- The iterator is passed a callback(err) which must be called once it has
- completed. If no error has occured, the callback should be run without
- arguments or with an explicit null argument.
-* callback(err) - A callback which is called after all the iterator functions
- have finished, or an error has occurred.
-
-__Example__
-
-```js
-// Assume documents is an array of JSON objects and requestApi is a
-// function that interacts with a rate-limited REST api.
-
-async.eachLimit(documents, 20, requestApi, function(err){
- // if any of the saves produced an error, err would equal that error
-});
-```
-
----------------------------------------
-
-
-### map(arr, iterator, callback)
-
-Produces a new array of values by mapping each value in the given array through
-the iterator function. The iterator is called with an item from the array and a
-callback for when it has finished processing. The callback takes 2 arguments,
-an error and the transformed item from the array. If the iterator passes an
-error to this callback, the main callback for the map function is immediately
-called with the error.
-
-Note, that since this function applies the iterator to each item in parallel
-there is no guarantee that the iterator functions will complete in order, however
-the results array will be in the same order as the original array.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* iterator(item, callback) - A function to apply to each item in the array.
- The iterator is passed a callback(err, transformed) which must be called once
- it has completed with an error (which can be null) and a transformed item.
-* callback(err, results) - A callback which is called after all the iterator
- functions have finished, or an error has occurred. Results is an array of the
- transformed items from the original array.
-
-__Example__
-
-```js
-async.map(['file1','file2','file3'], fs.stat, function(err, results){
- // results is now an array of stats for each file
-});
-```
-
----------------------------------------
-
-
-### mapSeries(arr, iterator, callback)
-
-The same as map only the iterator is applied to each item in the array in
-series. The next iterator is only called once the current one has completed
-processing. The results array will be in the same order as the original.
-
-
----------------------------------------
-
-
-### mapLimit(arr, limit, iterator, callback)
-
-The same as map only no more than "limit" iterators will be simultaneously
-running at any time.
-
-Note that the items are not processed in batches, so there is no guarantee that
- the first "limit" iterator functions will complete before any others are
-started.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* limit - The maximum number of iterators to run at any time.
-* iterator(item, callback) - A function to apply to each item in the array.
- The iterator is passed a callback(err, transformed) which must be called once
- it has completed with an error (which can be null) and a transformed item.
-* callback(err, results) - A callback which is called after all the iterator
- functions have finished, or an error has occurred. Results is an array of the
- transformed items from the original array.
-
-__Example__
-
-```js
-async.mapLimit(['file1','file2','file3'], 1, fs.stat, function(err, results){
- // results is now an array of stats for each file
-});
-```
-
----------------------------------------
-
-
-### filter(arr, iterator, callback)
-
-__Alias:__ select
-
-Returns a new array of all the values which pass an async truth test.
-_The callback for each iterator call only accepts a single argument of true or
-false, it does not accept an error argument first!_ This is in-line with the
-way node libraries work with truth tests like fs.exists. This operation is
-performed in parallel, but the results array will be in the same order as the
-original.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* iterator(item, callback) - A truth test to apply to each item in the array.
- The iterator is passed a callback(truthValue) which must be called with a
- boolean argument once it has completed.
-* callback(results) - A callback which is called after all the iterator
- functions have finished.
-
-__Example__
-
-```js
-async.filter(['file1','file2','file3'], fs.exists, function(results){
- // results now equals an array of the existing files
-});
-```
-
----------------------------------------
-
-
-### filterSeries(arr, iterator, callback)
-
-__alias:__ selectSeries
-
-The same as filter only the iterator is applied to each item in the array in
-series. The next iterator is only called once the current one has completed
-processing. The results array will be in the same order as the original.
-
----------------------------------------
-
-
-### reject(arr, iterator, callback)
-
-The opposite of filter. Removes values that pass an async truth test.
-
----------------------------------------
-
-
-### rejectSeries(arr, iterator, callback)
-
-The same as reject, only the iterator is applied to each item in the array
-in series.
-
-
----------------------------------------
-
-
-### reduce(arr, memo, iterator, callback)
-
-__aliases:__ inject, foldl
-
-Reduces a list of values into a single value using an async iterator to return
-each successive step. Memo is the initial state of the reduction. This
-function only operates in series. For performance reasons, it may make sense to
-split a call to this function into a parallel map, then use the normal
-Array.prototype.reduce on the results. This function is for situations where
-each step in the reduction needs to be async, if you can get the data before
-reducing it then it's probably a good idea to do so.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* memo - The initial state of the reduction.
-* iterator(memo, item, callback) - A function applied to each item in the
- array to produce the next step in the reduction. The iterator is passed a
- callback(err, reduction) which accepts an optional error as its first
- argument, and the state of the reduction as the second. If an error is
- passed to the callback, the reduction is stopped and the main callback is
- immediately called with the error.
-* callback(err, result) - A callback which is called after all the iterator
- functions have finished. Result is the reduced value.
-
-__Example__
-
-```js
-async.reduce([1,2,3], 0, function(memo, item, callback){
- // pointless async:
- process.nextTick(function(){
- callback(null, memo + item)
- });
-}, function(err, result){
- // result is now equal to the last value of memo, which is 6
-});
-```
-
----------------------------------------
-
-
-### reduceRight(arr, memo, iterator, callback)
-
-__Alias:__ foldr
-
-Same as reduce, only operates on the items in the array in reverse order.
-
-
----------------------------------------
-
-
-### detect(arr, iterator, callback)
-
-Returns the first value in a list that passes an async truth test. The
-iterator is applied in parallel, meaning the first iterator to return true will
-fire the detect callback with that result. That means the result might not be
-the first item in the original array (in terms of order) that passes the test.
-
-If order within the original array is important then look at detectSeries.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* iterator(item, callback) - A truth test to apply to each item in the array.
- The iterator is passed a callback(truthValue) which must be called with a
- boolean argument once it has completed.
-* callback(result) - A callback which is called as soon as any iterator returns
- true, or after all the iterator functions have finished. Result will be
- the first item in the array that passes the truth test (iterator) or the
- value undefined if none passed.
-
-__Example__
-
-```js
-async.detect(['file1','file2','file3'], fs.exists, function(result){
- // result now equals the first file in the list that exists
-});
-```
-
----------------------------------------
-
-
-### detectSeries(arr, iterator, callback)
-
-The same as detect, only the iterator is applied to each item in the array
-in series. This means the result is always the first in the original array (in
-terms of array order) that passes the truth test.
-
-
----------------------------------------
-
-
-### sortBy(arr, iterator, callback)
-
-Sorts a list by the results of running each value through an async iterator.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* iterator(item, callback) - A function to apply to each item in the array.
- The iterator is passed a callback(err, sortValue) which must be called once it
- has completed with an error (which can be null) and a value to use as the sort
- criteria.
-* callback(err, results) - A callback which is called after all the iterator
- functions have finished, or an error has occurred. Results is the items from
- the original array sorted by the values returned by the iterator calls.
-
-__Example__
-
-```js
-async.sortBy(['file1','file2','file3'], function(file, callback){
- fs.stat(file, function(err, stats){
- callback(err, stats.mtime);
- });
-}, function(err, results){
- // results is now the original array of files sorted by
- // modified date
-});
-```
-
----------------------------------------
-
-
-### some(arr, iterator, callback)
-
-__Alias:__ any
-
-Returns true if at least one element in the array satisfies an async test.
-_The callback for each iterator call only accepts a single argument of true or
-false, it does not accept an error argument first!_ This is in-line with the
-way node libraries work with truth tests like fs.exists. Once any iterator
-call returns true, the main callback is immediately called.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* iterator(item, callback) - A truth test to apply to each item in the array.
- The iterator is passed a callback(truthValue) which must be called with a
- boolean argument once it has completed.
-* callback(result) - A callback which is called as soon as any iterator returns
- true, or after all the iterator functions have finished. Result will be
- either true or false depending on the values of the async tests.
-
-__Example__
-
-```js
-async.some(['file1','file2','file3'], fs.exists, function(result){
- // if result is true then at least one of the files exists
-});
-```
-
----------------------------------------
-
-
-### every(arr, iterator, callback)
-
-__Alias:__ all
-
-Returns true if every element in the array satisfies an async test.
-_The callback for each iterator call only accepts a single argument of true or
-false, it does not accept an error argument first!_ This is in-line with the
-way node libraries work with truth tests like fs.exists.
-
-__Arguments__
-
-* arr - An array to iterate over.
-* iterator(item, callback) - A truth test to apply to each item in the array.
- The iterator is passed a callback(truthValue) which must be called with a
- boolean argument once it has completed.
-* callback(result) - A callback which is called after all the iterator
- functions have finished. Result will be either true or false depending on
- the values of the async tests.
-
-__Example__
-
-```js
-async.every(['file1','file2','file3'], fs.exists, function(result){
- // if result is true then every file exists
-});
-```
-
----------------------------------------
-
-
-### concat(arr, iterator, callback)
-
-Applies an iterator to each item in a list, concatenating the results. Returns the
-concatenated list. The iterators are called in parallel, and the results are
-concatenated as they return. There is no guarantee that the results array will
-be returned in the original order of the arguments passed to the iterator function.
-
-__Arguments__
-
-* arr - An array to iterate over
-* iterator(item, callback) - A function to apply to each item in the array.
- The iterator is passed a callback(err, results) which must be called once it
- has completed with an error (which can be null) and an array of results.
-* callback(err, results) - A callback which is called after all the iterator
- functions have finished, or an error has occurred. Results is an array containing
- the concatenated results of the iterator function.
-
-__Example__
-
-```js
-async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){
- // files is now a list of filenames that exist in the 3 directories
-});
-```
-
----------------------------------------
-
-
-### concatSeries(arr, iterator, callback)
-
-Same as async.concat, but executes in series instead of parallel.
-
-
-## Control Flow
-
-
-### series(tasks, [callback])
-
-Run an array of functions in series, each one running once the previous
-function has completed. If any functions in the series pass an error to its
-callback, no more functions are run and the callback for the series is
-immediately called with the value of the error. Once the tasks have completed,
-the results are passed to the final callback as an array.
-
-It is also possible to use an object instead of an array. Each property will be
-run as a function and the results will be passed to the final callback as an object
-instead of an array. This can be a more readable way of handling results from
-async.series.
-
-
-__Arguments__
-
-* tasks - An array or object containing functions to run, each function is passed
- a callback(err, result) it must call on completion with an error (which can
- be null) and an optional result value.
-* callback(err, results) - An optional callback to run once all the functions
- have completed. This function gets a results array (or object) containing all
- the result arguments passed to the task callbacks.
-
-__Example__
-
-```js
-async.series([
- function(callback){
- // do some stuff ...
- callback(null, 'one');
- },
- function(callback){
- // do some more stuff ...
- callback(null, 'two');
- }
-],
-// optional callback
-function(err, results){
- // results is now equal to ['one', 'two']
-});
-
-
-// an example using an object instead of an array
-async.series({
- one: function(callback){
- setTimeout(function(){
- callback(null, 1);
- }, 200);
- },
- two: function(callback){
- setTimeout(function(){
- callback(null, 2);
- }, 100);
- }
-},
-function(err, results) {
- // results is now equal to: {one: 1, two: 2}
-});
-```
-
----------------------------------------
-
-
-### parallel(tasks, [callback])
-
-Run an array of functions in parallel, without waiting until the previous
-function has completed. If any of the functions pass an error to its
-callback, the main callback is immediately called with the value of the error.
-Once the tasks have completed, the results are passed to the final callback as an
-array.
-
-It is also possible to use an object instead of an array. Each property will be
-run as a function and the results will be passed to the final callback as an object
-instead of an array. This can be a more readable way of handling results from
-async.parallel.
-
-
-__Arguments__
-
-* tasks - An array or object containing functions to run, each function is passed
- a callback(err, result) it must call on completion with an error (which can
- be null) and an optional result value.
-* callback(err, results) - An optional callback to run once all the functions
- have completed. This function gets a results array (or object) containing all
- the result arguments passed to the task callbacks.
-
-__Example__
-
-```js
-async.parallel([
- function(callback){
- setTimeout(function(){
- callback(null, 'one');
- }, 200);
- },
- function(callback){
- setTimeout(function(){
- callback(null, 'two');
- }, 100);
- }
-],
-// optional callback
-function(err, results){
- // the results array will equal ['one','two'] even though
- // the second function had a shorter timeout.
-});
-
-
-// an example using an object instead of an array
-async.parallel({
- one: function(callback){
- setTimeout(function(){
- callback(null, 1);
- }, 200);
- },
- two: function(callback){
- setTimeout(function(){
- callback(null, 2);
- }, 100);
- }
-},
-function(err, results) {
- // results is now equals to: {one: 1, two: 2}
-});
-```
-
----------------------------------------
-
-
-### parallelLimit(tasks, limit, [callback])
-
-The same as parallel only the tasks are executed in parallel with a maximum of "limit"
-tasks executing at any time.
-
-Note that the tasks are not executed in batches, so there is no guarantee that
-the first "limit" tasks will complete before any others are started.
-
-__Arguments__
-
-* tasks - An array or object containing functions to run, each function is passed
- a callback(err, result) it must call on completion with an error (which can
- be null) and an optional result value.
-* limit - The maximum number of tasks to run at any time.
-* callback(err, results) - An optional callback to run once all the functions
- have completed. This function gets a results array (or object) containing all
- the result arguments passed to the task callbacks.
-
----------------------------------------
-
-
-### whilst(test, fn, callback)
-
-Repeatedly call fn, while test returns true. Calls the callback when stopped,
-or an error occurs.
-
-__Arguments__
-
-* test() - synchronous truth test to perform before each execution of fn.
-* fn(callback) - A function to call each time the test passes. The function is
- passed a callback(err) which must be called once it has completed with an
- optional error argument.
-* callback(err) - A callback which is called after the test fails and repeated
- execution of fn has stopped.
-
-__Example__
-
-```js
-var count = 0;
-
-async.whilst(
- function () { return count < 5; },
- function (callback) {
- count++;
- setTimeout(callback, 1000);
- },
- function (err) {
- // 5 seconds have passed
- }
-);
-```
-
----------------------------------------
-
-
-### doWhilst(fn, test, callback)
-
-The post check version of whilst. To reflect the difference in the order of operations `test` and `fn` arguments are switched. `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.
-
----------------------------------------
-
-
-### until(test, fn, callback)
-
-Repeatedly call fn, until test returns true. Calls the callback when stopped,
-or an error occurs.
-
-The inverse of async.whilst.
-
----------------------------------------
-
-
-### doUntil(fn, test, callback)
-
-Like doWhilst except the test is inverted. Note the argument ordering differs from `until`.
-
----------------------------------------
-
-
-### forever(fn, callback)
-
-Calls the asynchronous function 'fn' repeatedly, in series, indefinitely.
-If an error is passed to fn's callback then 'callback' is called with the
-error, otherwise it will never be called.
-
----------------------------------------
-
-
-### waterfall(tasks, [callback])
-
-Runs an array of functions in series, each passing their results to the next in
-the array. However, if any of the functions pass an error to the callback, the
-next function is not executed and the main callback is immediately called with
-the error.
-
-__Arguments__
-
-* tasks - An array of functions to run, each function is passed a
- callback(err, result1, result2, ...) it must call on completion. The first
- argument is an error (which can be null) and any further arguments will be
- passed as arguments in order to the next task.
-* callback(err, [results]) - An optional callback to run once all the functions
- have completed. This will be passed the results of the last task's callback.
-
-
-
-__Example__
-
-```js
-async.waterfall([
- function(callback){
- callback(null, 'one', 'two');
- },
- function(arg1, arg2, callback){
- callback(null, 'three');
- },
- function(arg1, callback){
- // arg1 now equals 'three'
- callback(null, 'done');
- }
-], function (err, result) {
- // result now equals 'done'
-});
-```
-
----------------------------------------
-
-### compose(fn1, fn2...)
-
-Creates a function which is a composition of the passed asynchronous
-functions. Each function consumes the return value of the function that
-follows. Composing functions f(), g() and h() would produce the result of
-f(g(h())), only this version uses callbacks to obtain the return values.
-
-Each function is executed with the `this` binding of the composed function.
-
-__Arguments__
-
-* functions... - the asynchronous functions to compose
-
-
-__Example__
-
-```js
-function add1(n, callback) {
- setTimeout(function () {
- callback(null, n + 1);
- }, 10);
-}
-
-function mul3(n, callback) {
- setTimeout(function () {
- callback(null, n * 3);
- }, 10);
-}
-
-var add1mul3 = async.compose(mul3, add1);
-
-add1mul3(4, function (err, result) {
- // result now equals 15
-});
-```
-
----------------------------------------
-
-### applyEach(fns, args..., callback)
-
-Applies the provided arguments to each function in the array, calling the
-callback after all functions have completed. If you only provide the first
-argument then it will return a function which lets you pass in the
-arguments as if it were a single function call.
-
-__Arguments__
-
-* fns - the asynchronous functions to all call with the same arguments
-* args... - any number of separate arguments to pass to the function
-* callback - the final argument should be the callback, called when all
- functions have completed processing
-
-
-__Example__
-
-```js
-async.applyEach([enableSearch, updateSchema], 'bucket', callback);
-
-// partial application example:
-async.each(
- buckets,
- async.applyEach([enableSearch, updateSchema]),
- callback
-);
-```
-
----------------------------------------
-
-
-### applyEachSeries(arr, iterator, callback)
-
-The same as applyEach only the functions are applied in series.
-
----------------------------------------
-
-
-### queue(worker, concurrency)
-
-Creates a queue object with the specified concurrency. Tasks added to the
-queue will be processed in parallel (up to the concurrency limit). If all
-workers are in progress, the task is queued until one is available. Once
-a worker has completed a task, the task's callback is called.
-
-__Arguments__
-
-* worker(task, callback) - An asynchronous function for processing a queued
- task, which must call its callback(err) argument when finished, with an
- optional error as an argument.
-* concurrency - An integer for determining how many worker functions should be
- run in parallel.
-
-__Queue objects__
-
-The queue object returned by this function has the following properties and
-methods:
-
-* length() - a function returning the number of items waiting to be processed.
-* concurrency - an integer for determining how many worker functions should be
- run in parallel. This property can be changed after a queue is created to
- alter the concurrency on-the-fly.
-* push(task, [callback]) - add a new task to the queue, the callback is called
- once the worker has finished processing the task.
- instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.
-* unshift(task, [callback]) - add a new task to the front of the queue.
-* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued
-* empty - a callback that is called when the last item from the queue is given to a worker
-* drain - a callback that is called when the last item from the queue has returned from the worker
-
-__Example__
-
-```js
-// create a queue object with concurrency 2
-
-var q = async.queue(function (task, callback) {
- console.log('hello ' + task.name);
- callback();
-}, 2);
-
-
-// assign a callback
-q.drain = function() {
- console.log('all items have been processed');
-}
-
-// add some items to the queue
-
-q.push({name: 'foo'}, function (err) {
- console.log('finished processing foo');
-});
-q.push({name: 'bar'}, function (err) {
- console.log('finished processing bar');
-});
-
-// add some items to the queue (batch-wise)
-
-q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {
- console.log('finished processing bar');
-});
-
-// add some items to the front of the queue
-
-q.unshift({name: 'bar'}, function (err) {
- console.log('finished processing bar');
-});
-```
-
----------------------------------------
-
-
-### cargo(worker, [payload])
-
-Creates a cargo object with the specified payload. Tasks added to the
-cargo will be processed altogether (up to the payload limit). If the
-worker is in progress, the task is queued until it is available. Once
-the worker has completed some tasks, each callback of those tasks is called.
-
-__Arguments__
-
-* worker(tasks, callback) - An asynchronous function for processing an array of
- queued tasks, which must call its callback(err) argument when finished, with
- an optional error as an argument.
-* payload - An optional integer for determining how many tasks should be
- processed per round; if omitted, the default is unlimited.
-
-__Cargo objects__
-
-The cargo object returned by this function has the following properties and
-methods:
-
-* length() - a function returning the number of items waiting to be processed.
-* payload - an integer for determining how many tasks should be
- process per round. This property can be changed after a cargo is created to
- alter the payload on-the-fly.
-* push(task, [callback]) - add a new task to the queue, the callback is called
- once the worker has finished processing the task.
- instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.
-* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued
-* empty - a callback that is called when the last item from the queue is given to a worker
-* drain - a callback that is called when the last item from the queue has returned from the worker
-
-__Example__
-
-```js
-// create a cargo object with payload 2
-
-var cargo = async.cargo(function (tasks, callback) {
- for(var i=0; i
-### auto(tasks, [callback])
-
-Determines the best order for running functions based on their requirements.
-Each function can optionally depend on other functions being completed first,
-and each function is run as soon as its requirements are satisfied. If any of
-the functions pass an error to their callback, that function will not complete
-(so any other functions depending on it will not run) and the main callback
-will be called immediately with the error. Functions also receive an object
-containing the results of functions which have completed so far.
-
-Note, all functions are called with a results object as a second argument,
-so it is unsafe to pass functions in the tasks object which cannot handle the
-extra argument. For example, this snippet of code:
-
-```js
-async.auto({
- readData: async.apply(fs.readFile, 'data.txt', 'utf-8')
-}, callback);
-```
-
-will have the effect of calling readFile with the results object as the last
-argument, which will fail:
-
-```js
-fs.readFile('data.txt', 'utf-8', cb, {});
-```
-
-Instead, wrap the call to readFile in a function which does not forward the
-results object:
-
-```js
-async.auto({
- readData: function(cb, results){
- fs.readFile('data.txt', 'utf-8', cb);
- }
-}, callback);
-```
-
-__Arguments__
-
-* tasks - An object literal containing named functions or an array of
- requirements, with the function itself the last item in the array. The key
- used for each function or array is used when specifying requirements. The
- function receives two arguments: (1) a callback(err, result) which must be
- called when finished, passing an error (which can be null) and the result of
- the function's execution, and (2) a results object, containing the results of
- the previously executed functions.
-* callback(err, results) - An optional callback which is called when all the
- tasks have been completed. The callback will receive an error as an argument
- if any tasks pass an error to their callback. Results will always be passed
- but if an error occurred, no other tasks will be performed, and the results
- object will only contain partial results.
-
-
-__Example__
-
-```js
-async.auto({
- get_data: function(callback){
- // async code to get some data
- },
- make_folder: function(callback){
- // async code to create a directory to store a file in
- // this is run at the same time as getting the data
- },
- write_file: ['get_data', 'make_folder', function(callback){
- // once there is some data and the directory exists,
- // write the data to a file in the directory
- callback(null, filename);
- }],
- email_link: ['write_file', function(callback, results){
- // once the file is written let's email a link to it...
- // results.write_file contains the filename returned by write_file.
- }]
-});
-```
-
-This is a fairly trivial example, but to do this using the basic parallel and
-series functions would look like this:
-
-```js
-async.parallel([
- function(callback){
- // async code to get some data
- },
- function(callback){
- // async code to create a directory to store a file in
- // this is run at the same time as getting the data
- }
-],
-function(err, results){
- async.series([
- function(callback){
- // once there is some data and the directory exists,
- // write the data to a file in the directory
- },
- function(callback){
- // once the file is written let's email a link to it...
- }
- ]);
-});
-```
-
-For a complicated series of async tasks using the auto function makes adding
-new tasks much easier and makes the code more readable.
-
-
----------------------------------------
-
-
-### iterator(tasks)
-
-Creates an iterator function which calls the next function in the array,
-returning a continuation to call the next one after that. It's also possible to
-'peek' the next iterator by doing iterator.next().
-
-This function is used internally by the async module but can be useful when
-you want to manually control the flow of functions in series.
-
-__Arguments__
-
-* tasks - An array of functions to run.
-
-__Example__
-
-```js
-var iterator = async.iterator([
- function(){ sys.p('one'); },
- function(){ sys.p('two'); },
- function(){ sys.p('three'); }
-]);
-
-node> var iterator2 = iterator();
-'one'
-node> var iterator3 = iterator2();
-'two'
-node> iterator3();
-'three'
-node> var nextfn = iterator2.next();
-node> nextfn();
-'three'
-```
-
----------------------------------------
-
-
-### apply(function, arguments..)
-
-Creates a continuation function with some arguments already applied, a useful
-shorthand when combined with other control flow functions. Any arguments
-passed to the returned function are added to the arguments originally passed
-to apply.
-
-__Arguments__
-
-* function - The function you want to eventually apply all arguments to.
-* arguments... - Any number of arguments to automatically apply when the
- continuation is called.
-
-__Example__
-
-```js
-// using apply
-
-async.parallel([
- async.apply(fs.writeFile, 'testfile1', 'test1'),
- async.apply(fs.writeFile, 'testfile2', 'test2'),
-]);
-
-
-// the same process without using apply
-
-async.parallel([
- function(callback){
- fs.writeFile('testfile1', 'test1', callback);
- },
- function(callback){
- fs.writeFile('testfile2', 'test2', callback);
- }
-]);
-```
-
-It's possible to pass any number of additional arguments when calling the
-continuation:
-
-```js
-node> var fn = async.apply(sys.puts, 'one');
-node> fn('two', 'three');
-one
-two
-three
-```
-
----------------------------------------
-
-
-### nextTick(callback)
-
-Calls the callback on a later loop around the event loop. In node.js this just
-calls process.nextTick, in the browser it falls back to setImmediate(callback)
-if available, otherwise setTimeout(callback, 0), which means other higher priority
-events may precede the execution of the callback.
-
-This is used internally for browser-compatibility purposes.
-
-__Arguments__
-
-* callback - The function to call on a later loop around the event loop.
-
-__Example__
-
-```js
-var call_order = [];
-async.nextTick(function(){
- call_order.push('two');
- // call_order now equals ['one','two']
-});
-call_order.push('one')
-```
-
-
-### times(n, callback)
-
-Calls the callback n times and accumulates results in the same manner
-you would use with async.map.
-
-__Arguments__
-
-* n - The number of times to run the function.
-* callback - The function to call n times.
-
-__Example__
-
-```js
-// Pretend this is some complicated async factory
-var createUser = function(id, callback) {
- callback(null, {
- id: 'user' + id
- })
-}
-// generate 5 users
-async.times(5, function(n, next){
- createUser(n, function(err, user) {
- next(err, user)
- })
-}, function(err, users) {
- // we should now have 5 users
-});
-```
-
-
-### timesSeries(n, callback)
-
-The same as times only the iterator is applied to each item in the array in
-series. The next iterator is only called once the current one has completed
-processing. The results array will be in the same order as the original.
-
-
-## Utils
-
-
-### memoize(fn, [hasher])
-
-Caches the results of an async function. When creating a hash to store function
-results against, the callback is omitted from the hash and an optional hash
-function can be used.
-
-The cache of results is exposed as the `memo` property of the function returned
-by `memoize`.
-
-__Arguments__
-
-* fn - the function you to proxy and cache results from.
-* hasher - an optional function for generating a custom hash for storing
- results, it has all the arguments applied to it apart from the callback, and
- must be synchronous.
-
-__Example__
-
-```js
-var slow_fn = function (name, callback) {
- // do something
- callback(null, result);
-};
-var fn = async.memoize(slow_fn);
-
-// fn can now be used as if it were slow_fn
-fn('some name', function () {
- // callback
-});
-```
-
-
-### unmemoize(fn)
-
-Undoes a memoized function, reverting it to the original, unmemoized
-form. Comes handy in tests.
-
-__Arguments__
-
-* fn - the memoized function
-
-
-### log(function, arguments)
-
-Logs the result of an async function to the console. Only works in node.js or
-in browsers that support console.log and console.error (such as FF and Chrome).
-If multiple arguments are returned from the async function, console.log is
-called on each argument in order.
-
-__Arguments__
-
-* function - The function you want to eventually apply all arguments to.
-* arguments... - Any number of arguments to apply to the function.
-
-__Example__
-
-```js
-var hello = function(name, callback){
- setTimeout(function(){
- callback(null, 'hello ' + name);
- }, 1000);
-};
-```
-```js
-node> async.log(hello, 'world');
-'hello world'
-```
-
----------------------------------------
-
-
-### dir(function, arguments)
-
-Logs the result of an async function to the console using console.dir to
-display the properties of the resulting object. Only works in node.js or
-in browsers that support console.dir and console.error (such as FF and Chrome).
-If multiple arguments are returned from the async function, console.dir is
-called on each argument in order.
-
-__Arguments__
-
-* function - The function you want to eventually apply all arguments to.
-* arguments... - Any number of arguments to apply to the function.
-
-__Example__
-
-```js
-var hello = function(name, callback){
- setTimeout(function(){
- callback(null, {hello: name});
- }, 1000);
-};
-```
-```js
-node> async.dir(hello, 'world');
-{hello: 'world'}
-```
-
----------------------------------------
-
-
-### noConflict()
-
-Changes the value of async back to its original value, returning a reference to the
-async object.
diff --git a/builder/node_modules/uglify-js/node_modules/async/component.json b/builder/node_modules/uglify-js/node_modules/async/component.json
deleted file mode 100644
index bbb01154..00000000
--- a/builder/node_modules/uglify-js/node_modules/async/component.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "name": "async",
- "repo": "caolan/async",
- "description": "Higher-order functions and common patterns for asynchronous code",
- "version": "0.1.23",
- "keywords": [],
- "dependencies": {},
- "development": {},
- "main": "lib/async.js",
- "scripts": [ "lib/async.js" ]
-}
diff --git a/builder/node_modules/uglify-js/node_modules/async/lib/async.js b/builder/node_modules/uglify-js/node_modules/async/lib/async.js
deleted file mode 100644
index 1eebb153..00000000
--- a/builder/node_modules/uglify-js/node_modules/async/lib/async.js
+++ /dev/null
@@ -1,958 +0,0 @@
-/*global setImmediate: false, setTimeout: false, console: false */
-(function () {
-
- var async = {};
-
- // global on the server, window in the browser
- var root, previous_async;
-
- root = this;
- if (root != null) {
- previous_async = root.async;
- }
-
- async.noConflict = function () {
- root.async = previous_async;
- return async;
- };
-
- function only_once(fn) {
- var called = false;
- return function() {
- if (called) throw new Error("Callback was already called.");
- called = true;
- fn.apply(root, arguments);
- }
- }
-
- //// cross-browser compatiblity functions ////
-
- var _each = function (arr, iterator) {
- if (arr.forEach) {
- return arr.forEach(iterator);
- }
- for (var i = 0; i < arr.length; i += 1) {
- iterator(arr[i], i, arr);
- }
- };
-
- var _map = function (arr, iterator) {
- if (arr.map) {
- return arr.map(iterator);
- }
- var results = [];
- _each(arr, function (x, i, a) {
- results.push(iterator(x, i, a));
- });
- return results;
- };
-
- var _reduce = function (arr, iterator, memo) {
- if (arr.reduce) {
- return arr.reduce(iterator, memo);
- }
- _each(arr, function (x, i, a) {
- memo = iterator(memo, x, i, a);
- });
- return memo;
- };
-
- var _keys = function (obj) {
- if (Object.keys) {
- return Object.keys(obj);
- }
- var keys = [];
- for (var k in obj) {
- if (obj.hasOwnProperty(k)) {
- keys.push(k);
- }
- }
- return keys;
- };
-
- //// exported async module functions ////
-
- //// nextTick implementation with browser-compatible fallback ////
- if (typeof process === 'undefined' || !(process.nextTick)) {
- if (typeof setImmediate === 'function') {
- async.nextTick = function (fn) {
- // not a direct alias for IE10 compatibility
- setImmediate(fn);
- };
- async.setImmediate = async.nextTick;
- }
- else {
- async.nextTick = function (fn) {
- setTimeout(fn, 0);
- };
- async.setImmediate = async.nextTick;
- }
- }
- else {
- async.nextTick = process.nextTick;
- if (typeof setImmediate !== 'undefined') {
- async.setImmediate = function (fn) {
- // not a direct alias for IE10 compatibility
- setImmediate(fn);
- };
- }
- else {
- async.setImmediate = async.nextTick;
- }
- }
-
- async.each = function (arr, iterator, callback) {
- callback = callback || function () {};
- if (!arr.length) {
- return callback();
- }
- var completed = 0;
- _each(arr, function (x) {
- iterator(x, only_once(function (err) {
- if (err) {
- callback(err);
- callback = function () {};
- }
- else {
- completed += 1;
- if (completed >= arr.length) {
- callback(null);
- }
- }
- }));
- });
- };
- async.forEach = async.each;
-
- async.eachSeries = function (arr, iterator, callback) {
- callback = callback || function () {};
- if (!arr.length) {
- return callback();
- }
- var completed = 0;
- var iterate = function () {
- iterator(arr[completed], function (err) {
- if (err) {
- callback(err);
- callback = function () {};
- }
- else {
- completed += 1;
- if (completed >= arr.length) {
- callback(null);
- }
- else {
- iterate();
- }
- }
- });
- };
- iterate();
- };
- async.forEachSeries = async.eachSeries;
-
- async.eachLimit = function (arr, limit, iterator, callback) {
- var fn = _eachLimit(limit);
- fn.apply(null, [arr, iterator, callback]);
- };
- async.forEachLimit = async.eachLimit;
-
- var _eachLimit = function (limit) {
-
- return function (arr, iterator, callback) {
- callback = callback || function () {};
- if (!arr.length || limit <= 0) {
- return callback();
- }
- var completed = 0;
- var started = 0;
- var running = 0;
-
- (function replenish () {
- if (completed >= arr.length) {
- return callback();
- }
-
- while (running < limit && started < arr.length) {
- started += 1;
- running += 1;
- iterator(arr[started - 1], function (err) {
- if (err) {
- callback(err);
- callback = function () {};
- }
- else {
- completed += 1;
- running -= 1;
- if (completed >= arr.length) {
- callback();
- }
- else {
- replenish();
- }
- }
- });
- }
- })();
- };
- };
-
-
- var doParallel = function (fn) {
- return function () {
- var args = Array.prototype.slice.call(arguments);
- return fn.apply(null, [async.each].concat(args));
- };
- };
- var doParallelLimit = function(limit, fn) {
- return function () {
- var args = Array.prototype.slice.call(arguments);
- return fn.apply(null, [_eachLimit(limit)].concat(args));
- };
- };
- var doSeries = function (fn) {
- return function () {
- var args = Array.prototype.slice.call(arguments);
- return fn.apply(null, [async.eachSeries].concat(args));
- };
- };
-
-
- var _asyncMap = function (eachfn, arr, iterator, callback) {
- var results = [];
- arr = _map(arr, function (x, i) {
- return {index: i, value: x};
- });
- eachfn(arr, function (x, callback) {
- iterator(x.value, function (err, v) {
- results[x.index] = v;
- callback(err);
- });
- }, function (err) {
- callback(err, results);
- });
- };
- async.map = doParallel(_asyncMap);
- async.mapSeries = doSeries(_asyncMap);
- async.mapLimit = function (arr, limit, iterator, callback) {
- return _mapLimit(limit)(arr, iterator, callback);
- };
-
- var _mapLimit = function(limit) {
- return doParallelLimit(limit, _asyncMap);
- };
-
- // reduce only has a series version, as doing reduce in parallel won't
- // work in many situations.
- async.reduce = function (arr, memo, iterator, callback) {
- async.eachSeries(arr, function (x, callback) {
- iterator(memo, x, function (err, v) {
- memo = v;
- callback(err);
- });
- }, function (err) {
- callback(err, memo);
- });
- };
- // inject alias
- async.inject = async.reduce;
- // foldl alias
- async.foldl = async.reduce;
-
- async.reduceRight = function (arr, memo, iterator, callback) {
- var reversed = _map(arr, function (x) {
- return x;
- }).reverse();
- async.reduce(reversed, memo, iterator, callback);
- };
- // foldr alias
- async.foldr = async.reduceRight;
-
- var _filter = function (eachfn, arr, iterator, callback) {
- var results = [];
- arr = _map(arr, function (x, i) {
- return {index: i, value: x};
- });
- eachfn(arr, function (x, callback) {
- iterator(x.value, function (v) {
- if (v) {
- results.push(x);
- }
- callback();
- });
- }, function (err) {
- callback(_map(results.sort(function (a, b) {
- return a.index - b.index;
- }), function (x) {
- return x.value;
- }));
- });
- };
- async.filter = doParallel(_filter);
- async.filterSeries = doSeries(_filter);
- // select alias
- async.select = async.filter;
- async.selectSeries = async.filterSeries;
-
- var _reject = function (eachfn, arr, iterator, callback) {
- var results = [];
- arr = _map(arr, function (x, i) {
- return {index: i, value: x};
- });
- eachfn(arr, function (x, callback) {
- iterator(x.value, function (v) {
- if (!v) {
- results.push(x);
- }
- callback();
- });
- }, function (err) {
- callback(_map(results.sort(function (a, b) {
- return a.index - b.index;
- }), function (x) {
- return x.value;
- }));
- });
- };
- async.reject = doParallel(_reject);
- async.rejectSeries = doSeries(_reject);
-
- var _detect = function (eachfn, arr, iterator, main_callback) {
- eachfn(arr, function (x, callback) {
- iterator(x, function (result) {
- if (result) {
- main_callback(x);
- main_callback = function () {};
- }
- else {
- callback();
- }
- });
- }, function (err) {
- main_callback();
- });
- };
- async.detect = doParallel(_detect);
- async.detectSeries = doSeries(_detect);
-
- async.some = function (arr, iterator, main_callback) {
- async.each(arr, function (x, callback) {
- iterator(x, function (v) {
- if (v) {
- main_callback(true);
- main_callback = function () {};
- }
- callback();
- });
- }, function (err) {
- main_callback(false);
- });
- };
- // any alias
- async.any = async.some;
-
- async.every = function (arr, iterator, main_callback) {
- async.each(arr, function (x, callback) {
- iterator(x, function (v) {
- if (!v) {
- main_callback(false);
- main_callback = function () {};
- }
- callback();
- });
- }, function (err) {
- main_callback(true);
- });
- };
- // all alias
- async.all = async.every;
-
- async.sortBy = function (arr, iterator, callback) {
- async.map(arr, function (x, callback) {
- iterator(x, function (err, criteria) {
- if (err) {
- callback(err);
- }
- else {
- callback(null, {value: x, criteria: criteria});
- }
- });
- }, function (err, results) {
- if (err) {
- return callback(err);
- }
- else {
- var fn = function (left, right) {
- var a = left.criteria, b = right.criteria;
- return a < b ? -1 : a > b ? 1 : 0;
- };
- callback(null, _map(results.sort(fn), function (x) {
- return x.value;
- }));
- }
- });
- };
-
- async.auto = function (tasks, callback) {
- callback = callback || function () {};
- var keys = _keys(tasks);
- if (!keys.length) {
- return callback(null);
- }
-
- var results = {};
-
- var listeners = [];
- var addListener = function (fn) {
- listeners.unshift(fn);
- };
- var removeListener = function (fn) {
- for (var i = 0; i < listeners.length; i += 1) {
- if (listeners[i] === fn) {
- listeners.splice(i, 1);
- return;
- }
- }
- };
- var taskComplete = function () {
- _each(listeners.slice(0), function (fn) {
- fn();
- });
- };
-
- addListener(function () {
- if (_keys(results).length === keys.length) {
- callback(null, results);
- callback = function () {};
- }
- });
-
- _each(keys, function (k) {
- var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k];
- var taskCallback = function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (args.length <= 1) {
- args = args[0];
- }
- if (err) {
- var safeResults = {};
- _each(_keys(results), function(rkey) {
- safeResults[rkey] = results[rkey];
- });
- safeResults[k] = args;
- callback(err, safeResults);
- // stop subsequent errors hitting callback multiple times
- callback = function () {};
- }
- else {
- results[k] = args;
- async.setImmediate(taskComplete);
- }
- };
- var requires = task.slice(0, Math.abs(task.length - 1)) || [];
- var ready = function () {
- return _reduce(requires, function (a, x) {
- return (a && results.hasOwnProperty(x));
- }, true) && !results.hasOwnProperty(k);
- };
- if (ready()) {
- task[task.length - 1](taskCallback, results);
- }
- else {
- var listener = function () {
- if (ready()) {
- removeListener(listener);
- task[task.length - 1](taskCallback, results);
- }
- };
- addListener(listener);
- }
- });
- };
-
- async.waterfall = function (tasks, callback) {
- callback = callback || function () {};
- if (tasks.constructor !== Array) {
- var err = new Error('First argument to waterfall must be an array of functions');
- return callback(err);
- }
- if (!tasks.length) {
- return callback();
- }
- var wrapIterator = function (iterator) {
- return function (err) {
- if (err) {
- callback.apply(null, arguments);
- callback = function () {};
- }
- else {
- var args = Array.prototype.slice.call(arguments, 1);
- var next = iterator.next();
- if (next) {
- args.push(wrapIterator(next));
- }
- else {
- args.push(callback);
- }
- async.setImmediate(function () {
- iterator.apply(null, args);
- });
- }
- };
- };
- wrapIterator(async.iterator(tasks))();
- };
-
- var _parallel = function(eachfn, tasks, callback) {
- callback = callback || function () {};
- if (tasks.constructor === Array) {
- eachfn.map(tasks, function (fn, callback) {
- if (fn) {
- fn(function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (args.length <= 1) {
- args = args[0];
- }
- callback.call(null, err, args);
- });
- }
- }, callback);
- }
- else {
- var results = {};
- eachfn.each(_keys(tasks), function (k, callback) {
- tasks[k](function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (args.length <= 1) {
- args = args[0];
- }
- results[k] = args;
- callback(err);
- });
- }, function (err) {
- callback(err, results);
- });
- }
- };
-
- async.parallel = function (tasks, callback) {
- _parallel({ map: async.map, each: async.each }, tasks, callback);
- };
-
- async.parallelLimit = function(tasks, limit, callback) {
- _parallel({ map: _mapLimit(limit), each: _eachLimit(limit) }, tasks, callback);
- };
-
- async.series = function (tasks, callback) {
- callback = callback || function () {};
- if (tasks.constructor === Array) {
- async.mapSeries(tasks, function (fn, callback) {
- if (fn) {
- fn(function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (args.length <= 1) {
- args = args[0];
- }
- callback.call(null, err, args);
- });
- }
- }, callback);
- }
- else {
- var results = {};
- async.eachSeries(_keys(tasks), function (k, callback) {
- tasks[k](function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (args.length <= 1) {
- args = args[0];
- }
- results[k] = args;
- callback(err);
- });
- }, function (err) {
- callback(err, results);
- });
- }
- };
-
- async.iterator = function (tasks) {
- var makeCallback = function (index) {
- var fn = function () {
- if (tasks.length) {
- tasks[index].apply(null, arguments);
- }
- return fn.next();
- };
- fn.next = function () {
- return (index < tasks.length - 1) ? makeCallback(index + 1): null;
- };
- return fn;
- };
- return makeCallback(0);
- };
-
- async.apply = function (fn) {
- var args = Array.prototype.slice.call(arguments, 1);
- return function () {
- return fn.apply(
- null, args.concat(Array.prototype.slice.call(arguments))
- );
- };
- };
-
- var _concat = function (eachfn, arr, fn, callback) {
- var r = [];
- eachfn(arr, function (x, cb) {
- fn(x, function (err, y) {
- r = r.concat(y || []);
- cb(err);
- });
- }, function (err) {
- callback(err, r);
- });
- };
- async.concat = doParallel(_concat);
- async.concatSeries = doSeries(_concat);
-
- async.whilst = function (test, iterator, callback) {
- if (test()) {
- iterator(function (err) {
- if (err) {
- return callback(err);
- }
- async.whilst(test, iterator, callback);
- });
- }
- else {
- callback();
- }
- };
-
- async.doWhilst = function (iterator, test, callback) {
- iterator(function (err) {
- if (err) {
- return callback(err);
- }
- if (test()) {
- async.doWhilst(iterator, test, callback);
- }
- else {
- callback();
- }
- });
- };
-
- async.until = function (test, iterator, callback) {
- if (!test()) {
- iterator(function (err) {
- if (err) {
- return callback(err);
- }
- async.until(test, iterator, callback);
- });
- }
- else {
- callback();
- }
- };
-
- async.doUntil = function (iterator, test, callback) {
- iterator(function (err) {
- if (err) {
- return callback(err);
- }
- if (!test()) {
- async.doUntil(iterator, test, callback);
- }
- else {
- callback();
- }
- });
- };
-
- async.queue = function (worker, concurrency) {
- if (concurrency === undefined) {
- concurrency = 1;
- }
- function _insert(q, data, pos, callback) {
- if(data.constructor !== Array) {
- data = [data];
- }
- _each(data, function(task) {
- var item = {
- data: task,
- callback: typeof callback === 'function' ? callback : null
- };
-
- if (pos) {
- q.tasks.unshift(item);
- } else {
- q.tasks.push(item);
- }
-
- if (q.saturated && q.tasks.length === concurrency) {
- q.saturated();
- }
- async.setImmediate(q.process);
- });
- }
-
- var workers = 0;
- var q = {
- tasks: [],
- concurrency: concurrency,
- saturated: null,
- empty: null,
- drain: null,
- push: function (data, callback) {
- _insert(q, data, false, callback);
- },
- unshift: function (data, callback) {
- _insert(q, data, true, callback);
- },
- process: function () {
- if (workers < q.concurrency && q.tasks.length) {
- var task = q.tasks.shift();
- if (q.empty && q.tasks.length === 0) {
- q.empty();
- }
- workers += 1;
- var next = function () {
- workers -= 1;
- if (task.callback) {
- task.callback.apply(task, arguments);
- }
- if (q.drain && q.tasks.length + workers === 0) {
- q.drain();
- }
- q.process();
- };
- var cb = only_once(next);
- worker(task.data, cb);
- }
- },
- length: function () {
- return q.tasks.length;
- },
- running: function () {
- return workers;
- }
- };
- return q;
- };
-
- async.cargo = function (worker, payload) {
- var working = false,
- tasks = [];
-
- var cargo = {
- tasks: tasks,
- payload: payload,
- saturated: null,
- empty: null,
- drain: null,
- push: function (data, callback) {
- if(data.constructor !== Array) {
- data = [data];
- }
- _each(data, function(task) {
- tasks.push({
- data: task,
- callback: typeof callback === 'function' ? callback : null
- });
- if (cargo.saturated && tasks.length === payload) {
- cargo.saturated();
- }
- });
- async.setImmediate(cargo.process);
- },
- process: function process() {
- if (working) return;
- if (tasks.length === 0) {
- if(cargo.drain) cargo.drain();
- return;
- }
-
- var ts = typeof payload === 'number'
- ? tasks.splice(0, payload)
- : tasks.splice(0);
-
- var ds = _map(ts, function (task) {
- return task.data;
- });
-
- if(cargo.empty) cargo.empty();
- working = true;
- worker(ds, function () {
- working = false;
-
- var args = arguments;
- _each(ts, function (data) {
- if (data.callback) {
- data.callback.apply(null, args);
- }
- });
-
- process();
- });
- },
- length: function () {
- return tasks.length;
- },
- running: function () {
- return working;
- }
- };
- return cargo;
- };
-
- var _console_fn = function (name) {
- return function (fn) {
- var args = Array.prototype.slice.call(arguments, 1);
- fn.apply(null, args.concat([function (err) {
- var args = Array.prototype.slice.call(arguments, 1);
- if (typeof console !== 'undefined') {
- if (err) {
- if (console.error) {
- console.error(err);
- }
- }
- else if (console[name]) {
- _each(args, function (x) {
- console[name](x);
- });
- }
- }
- }]));
- };
- };
- async.log = _console_fn('log');
- async.dir = _console_fn('dir');
- /*async.info = _console_fn('info');
- async.warn = _console_fn('warn');
- async.error = _console_fn('error');*/
-
- async.memoize = function (fn, hasher) {
- var memo = {};
- var queues = {};
- hasher = hasher || function (x) {
- return x;
- };
- var memoized = function () {
- var args = Array.prototype.slice.call(arguments);
- var callback = args.pop();
- var key = hasher.apply(null, args);
- if (key in memo) {
- callback.apply(null, memo[key]);
- }
- else if (key in queues) {
- queues[key].push(callback);
- }
- else {
- queues[key] = [callback];
- fn.apply(null, args.concat([function () {
- memo[key] = arguments;
- var q = queues[key];
- delete queues[key];
- for (var i = 0, l = q.length; i < l; i++) {
- q[i].apply(null, arguments);
- }
- }]));
- }
- };
- memoized.memo = memo;
- memoized.unmemoized = fn;
- return memoized;
- };
-
- async.unmemoize = function (fn) {
- return function () {
- return (fn.unmemoized || fn).apply(null, arguments);
- };
- };
-
- async.times = function (count, iterator, callback) {
- var counter = [];
- for (var i = 0; i < count; i++) {
- counter.push(i);
- }
- return async.map(counter, iterator, callback);
- };
-
- async.timesSeries = function (count, iterator, callback) {
- var counter = [];
- for (var i = 0; i < count; i++) {
- counter.push(i);
- }
- return async.mapSeries(counter, iterator, callback);
- };
-
- async.compose = function (/* functions... */) {
- var fns = Array.prototype.reverse.call(arguments);
- return function () {
- var that = this;
- var args = Array.prototype.slice.call(arguments);
- var callback = args.pop();
- async.reduce(fns, args, function (newargs, fn, cb) {
- fn.apply(that, newargs.concat([function () {
- var err = arguments[0];
- var nextargs = Array.prototype.slice.call(arguments, 1);
- cb(err, nextargs);
- }]))
- },
- function (err, results) {
- callback.apply(that, [err].concat(results));
- });
- };
- };
-
- var _applyEach = function (eachfn, fns /*args...*/) {
- var go = function () {
- var that = this;
- var args = Array.prototype.slice.call(arguments);
- var callback = args.pop();
- return eachfn(fns, function (fn, cb) {
- fn.apply(that, args.concat([cb]));
- },
- callback);
- };
- if (arguments.length > 2) {
- var args = Array.prototype.slice.call(arguments, 2);
- return go.apply(this, args);
- }
- else {
- return go;
- }
- };
- async.applyEach = doParallel(_applyEach);
- async.applyEachSeries = doSeries(_applyEach);
-
- async.forever = function (fn, callback) {
- function next(err) {
- if (err) {
- if (callback) {
- return callback(err);
- }
- throw err;
- }
- fn(next);
- }
- next();
- };
-
- // AMD / RequireJS
- if (typeof define !== 'undefined' && define.amd) {
- define([], function () {
- return async;
- });
- }
- // Node.js
- else if (typeof module !== 'undefined' && module.exports) {
- module.exports = async;
- }
- // included directly via \n\n```\n\n## Documentation\n\n### Collections\n\n* [each](#each)\n* [eachSeries](#eachSeries)\n* [eachLimit](#eachLimit)\n* [map](#map)\n* [mapSeries](#mapSeries)\n* [mapLimit](#mapLimit)\n* [filter](#filter)\n* [filterSeries](#filterSeries)\n* [reject](#reject)\n* [rejectSeries](#rejectSeries)\n* [reduce](#reduce)\n* [reduceRight](#reduceRight)\n* [detect](#detect)\n* [detectSeries](#detectSeries)\n* [sortBy](#sortBy)\n* [some](#some)\n* [every](#every)\n* [concat](#concat)\n* [concatSeries](#concatSeries)\n\n### Control Flow\n\n* [series](#series)\n* [parallel](#parallel)\n* [parallelLimit](#parallellimittasks-limit-callback)\n* [whilst](#whilst)\n* [doWhilst](#doWhilst)\n* [until](#until)\n* [doUntil](#doUntil)\n* [forever](#forever)\n* [waterfall](#waterfall)\n* [compose](#compose)\n* [applyEach](#applyEach)\n* [applyEachSeries](#applyEachSeries)\n* [queue](#queue)\n* [cargo](#cargo)\n* [auto](#auto)\n* [iterator](#iterator)\n* [apply](#apply)\n* [nextTick](#nextTick)\n* [times](#times)\n* [timesSeries](#timesSeries)\n\n### Utils\n\n* [memoize](#memoize)\n* [unmemoize](#unmemoize)\n* [log](#log)\n* [dir](#dir)\n* [noConflict](#noConflict)\n\n\n## Collections\n\n\n\n### each(arr, iterator, callback)\n\nApplies an iterator function to each item in an array, in parallel.\nThe iterator is called with an item from the list and a callback for when it\nhas finished. If the iterator passes an error to this callback, the main\ncallback for the each function is immediately called with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err) which must be called once it has \n completed. If no error has occured, the callback should be run without \n arguments or with an explicit null argument.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n```js\n// assuming openFiles is an array of file names and saveFile is a function\n// to save the modified contents of that file:\n\nasync.each(openFiles, saveFile, function(err){\n // if any of the saves produced an error, err would equal that error\n});\n```\n\n---------------------------------------\n\n\n\n### eachSeries(arr, iterator, callback)\n\nThe same as each only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. This means the iterator functions will complete in order.\n\n\n---------------------------------------\n\n\n\n### eachLimit(arr, limit, iterator, callback)\n\nThe same as each only no more than \"limit\" iterators will be simultaneously \nrunning at any time.\n\nNote that the items are not processed in batches, so there is no guarantee that\n the first \"limit\" iterator functions will complete before any others are \nstarted.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - The maximum number of iterators to run at any time.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err) which must be called once it has \n completed. If no error has occured, the callback should be run without \n arguments or with an explicit null argument.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n```js\n// Assume documents is an array of JSON objects and requestApi is a\n// function that interacts with a rate-limited REST api.\n\nasync.eachLimit(documents, 20, requestApi, function(err){\n // if any of the saves produced an error, err would equal that error\n});\n```\n\n---------------------------------------\n\n\n### map(arr, iterator, callback)\n\nProduces a new array of values by mapping each value in the given array through\nthe iterator function. The iterator is called with an item from the array and a\ncallback for when it has finished processing. The callback takes 2 arguments, \nan error and the transformed item from the array. If the iterator passes an\nerror to this callback, the main callback for the map function is immediately\ncalled with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order, however\nthe results array will be in the same order as the original array.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, transformed) which must be called once \n it has completed with an error (which can be null) and a transformed item.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array of the\n transformed items from the original array.\n\n__Example__\n\n```js\nasync.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n```\n\n---------------------------------------\n\n\n### mapSeries(arr, iterator, callback)\n\nThe same as map only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n\n---------------------------------------\n\n\n### mapLimit(arr, limit, iterator, callback)\n\nThe same as map only no more than \"limit\" iterators will be simultaneously \nrunning at any time.\n\nNote that the items are not processed in batches, so there is no guarantee that\n the first \"limit\" iterator functions will complete before any others are \nstarted.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - The maximum number of iterators to run at any time.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, transformed) which must be called once \n it has completed with an error (which can be null) and a transformed item.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array of the\n transformed items from the original array.\n\n__Example__\n\n```js\nasync.mapLimit(['file1','file2','file3'], 1, fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n```\n\n---------------------------------------\n\n\n### filter(arr, iterator, callback)\n\n__Alias:__ select\n\nReturns a new array of all the values which pass an async truth test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like fs.exists. This operation is\nperformed in parallel, but the results array will be in the same order as the\noriginal.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(results) - A callback which is called after all the iterator\n functions have finished.\n\n__Example__\n\n```js\nasync.filter(['file1','file2','file3'], fs.exists, function(results){\n // results now equals an array of the existing files\n});\n```\n\n---------------------------------------\n\n\n### filterSeries(arr, iterator, callback)\n\n__alias:__ selectSeries\n\nThe same as filter only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n---------------------------------------\n\n\n### reject(arr, iterator, callback)\n\nThe opposite of filter. Removes values that pass an async truth test.\n\n---------------------------------------\n\n\n### rejectSeries(arr, iterator, callback)\n\nThe same as reject, only the iterator is applied to each item in the array\nin series.\n\n\n---------------------------------------\n\n\n### reduce(arr, memo, iterator, callback)\n\n__aliases:__ inject, foldl\n\nReduces a list of values into a single value using an async iterator to return\neach successive step. Memo is the initial state of the reduction. This\nfunction only operates in series. For performance reasons, it may make sense to\nsplit a call to this function into a parallel map, then use the normal\nArray.prototype.reduce on the results. This function is for situations where\neach step in the reduction needs to be async, if you can get the data before\nreducing it then it's probably a good idea to do so.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* memo - The initial state of the reduction.\n* iterator(memo, item, callback) - A function applied to each item in the\n array to produce the next step in the reduction. The iterator is passed a\n callback(err, reduction) which accepts an optional error as its first \n argument, and the state of the reduction as the second. If an error is \n passed to the callback, the reduction is stopped and the main callback is \n immediately called with the error.\n* callback(err, result) - A callback which is called after all the iterator\n functions have finished. Result is the reduced value.\n\n__Example__\n\n```js\nasync.reduce([1,2,3], 0, function(memo, item, callback){\n // pointless async:\n process.nextTick(function(){\n callback(null, memo + item)\n });\n}, function(err, result){\n // result is now equal to the last value of memo, which is 6\n});\n```\n\n---------------------------------------\n\n\n### reduceRight(arr, memo, iterator, callback)\n\n__Alias:__ foldr\n\nSame as reduce, only operates on the items in the array in reverse order.\n\n\n---------------------------------------\n\n\n### detect(arr, iterator, callback)\n\nReturns the first value in a list that passes an async truth test. The\niterator is applied in parallel, meaning the first iterator to return true will\nfire the detect callback with that result. That means the result might not be\nthe first item in the original array (in terms of order) that passes the test.\n\nIf order within the original array is important then look at detectSeries.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n true, or after all the iterator functions have finished. Result will be\n the first item in the array that passes the truth test (iterator) or the\n value undefined if none passed.\n\n__Example__\n\n```js\nasync.detect(['file1','file2','file3'], fs.exists, function(result){\n // result now equals the first file in the list that exists\n});\n```\n\n---------------------------------------\n\n\n### detectSeries(arr, iterator, callback)\n\nThe same as detect, only the iterator is applied to each item in the array\nin series. This means the result is always the first in the original array (in\nterms of array order) that passes the truth test.\n\n\n---------------------------------------\n\n\n### sortBy(arr, iterator, callback)\n\nSorts a list by the results of running each value through an async iterator.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, sortValue) which must be called once it\n has completed with an error (which can be null) and a value to use as the sort\n criteria.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is the items from\n the original array sorted by the values returned by the iterator calls.\n\n__Example__\n\n```js\nasync.sortBy(['file1','file2','file3'], function(file, callback){\n fs.stat(file, function(err, stats){\n callback(err, stats.mtime);\n });\n}, function(err, results){\n // results is now the original array of files sorted by\n // modified date\n});\n```\n\n---------------------------------------\n\n\n### some(arr, iterator, callback)\n\n__Alias:__ any\n\nReturns true if at least one element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like fs.exists. Once any iterator\ncall returns true, the main callback is immediately called.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n true, or after all the iterator functions have finished. Result will be\n either true or false depending on the values of the async tests.\n\n__Example__\n\n```js\nasync.some(['file1','file2','file3'], fs.exists, function(result){\n // if result is true then at least one of the files exists\n});\n```\n\n---------------------------------------\n\n\n### every(arr, iterator, callback)\n\n__Alias:__ all\n\nReturns true if every element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like fs.exists.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(result) - A callback which is called after all the iterator\n functions have finished. Result will be either true or false depending on\n the values of the async tests.\n\n__Example__\n\n```js\nasync.every(['file1','file2','file3'], fs.exists, function(result){\n // if result is true then every file exists\n});\n```\n\n---------------------------------------\n\n\n### concat(arr, iterator, callback)\n\nApplies an iterator to each item in a list, concatenating the results. Returns the\nconcatenated list. The iterators are called in parallel, and the results are\nconcatenated as they return. There is no guarantee that the results array will\nbe returned in the original order of the arguments passed to the iterator function.\n\n__Arguments__\n\n* arr - An array to iterate over\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, results) which must be called once it \n has completed with an error (which can be null) and an array of results.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array containing\n the concatenated results of the iterator function.\n\n__Example__\n\n```js\nasync.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){\n // files is now a list of filenames that exist in the 3 directories\n});\n```\n\n---------------------------------------\n\n\n### concatSeries(arr, iterator, callback)\n\nSame as async.concat, but executes in series instead of parallel.\n\n\n## Control Flow\n\n\n### series(tasks, [callback])\n\nRun an array of functions in series, each one running once the previous\nfunction has completed. If any functions in the series pass an error to its\ncallback, no more functions are run and the callback for the series is\nimmediately called with the value of the error. Once the tasks have completed,\nthe results are passed to the final callback as an array.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.series.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed\n a callback(err, result) it must call on completion with an error (which can\n be null) and an optional result value.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the task callbacks.\n\n__Example__\n\n```js\nasync.series([\n function(callback){\n // do some stuff ...\n callback(null, 'one');\n },\n function(callback){\n // do some more stuff ...\n callback(null, 'two');\n }\n],\n// optional callback\nfunction(err, results){\n // results is now equal to ['one', 'two']\n});\n\n\n// an example using an object instead of an array\nasync.series({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n }\n},\nfunction(err, results) {\n // results is now equal to: {one: 1, two: 2}\n});\n```\n\n---------------------------------------\n\n\n### parallel(tasks, [callback])\n\nRun an array of functions in parallel, without waiting until the previous\nfunction has completed. If any of the functions pass an error to its\ncallback, the main callback is immediately called with the value of the error.\nOnce the tasks have completed, the results are passed to the final callback as an\narray.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.parallel.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed \n a callback(err, result) it must call on completion with an error (which can\n be null) and an optional result value.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the task callbacks.\n\n__Example__\n\n```js\nasync.parallel([\n function(callback){\n setTimeout(function(){\n callback(null, 'one');\n }, 200);\n },\n function(callback){\n setTimeout(function(){\n callback(null, 'two');\n }, 100);\n }\n],\n// optional callback\nfunction(err, results){\n // the results array will equal ['one','two'] even though\n // the second function had a shorter timeout.\n});\n\n\n// an example using an object instead of an array\nasync.parallel({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n }\n},\nfunction(err, results) {\n // results is now equals to: {one: 1, two: 2}\n});\n```\n\n---------------------------------------\n\n\n### parallelLimit(tasks, limit, [callback])\n\nThe same as parallel only the tasks are executed in parallel with a maximum of \"limit\" \ntasks executing at any time.\n\nNote that the tasks are not executed in batches, so there is no guarantee that \nthe first \"limit\" tasks will complete before any others are started.\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed \n a callback(err, result) it must call on completion with an error (which can\n be null) and an optional result value.\n* limit - The maximum number of tasks to run at any time.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the task callbacks.\n\n---------------------------------------\n\n\n### whilst(test, fn, callback)\n\nRepeatedly call fn, while test returns true. Calls the callback when stopped,\nor an error occurs.\n\n__Arguments__\n\n* test() - synchronous truth test to perform before each execution of fn.\n* fn(callback) - A function to call each time the test passes. The function is\n passed a callback(err) which must be called once it has completed with an \n optional error argument.\n* callback(err) - A callback which is called after the test fails and repeated\n execution of fn has stopped.\n\n__Example__\n\n```js\nvar count = 0;\n\nasync.whilst(\n function () { return count < 5; },\n function (callback) {\n count++;\n setTimeout(callback, 1000);\n },\n function (err) {\n // 5 seconds have passed\n }\n);\n```\n\n---------------------------------------\n\n\n### doWhilst(fn, test, callback)\n\nThe post check version of whilst. To reflect the difference in the order of operations `test` and `fn` arguments are switched. `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.\n\n---------------------------------------\n\n\n### until(test, fn, callback)\n\nRepeatedly call fn, until test returns true. Calls the callback when stopped,\nor an error occurs.\n\nThe inverse of async.whilst.\n\n---------------------------------------\n\n\n### doUntil(fn, test, callback)\n\nLike doWhilst except the test is inverted. Note the argument ordering differs from `until`.\n\n---------------------------------------\n\n\n### forever(fn, callback)\n\nCalls the asynchronous function 'fn' repeatedly, in series, indefinitely.\nIf an error is passed to fn's callback then 'callback' is called with the\nerror, otherwise it will never be called.\n\n---------------------------------------\n\n\n### waterfall(tasks, [callback])\n\nRuns an array of functions in series, each passing their results to the next in\nthe array. However, if any of the functions pass an error to the callback, the\nnext function is not executed and the main callback is immediately called with\nthe error.\n\n__Arguments__\n\n* tasks - An array of functions to run, each function is passed a \n callback(err, result1, result2, ...) it must call on completion. The first\n argument is an error (which can be null) and any further arguments will be \n passed as arguments in order to the next task.\n* callback(err, [results]) - An optional callback to run once all the functions\n have completed. This will be passed the results of the last task's callback.\n\n\n\n__Example__\n\n```js\nasync.waterfall([\n function(callback){\n callback(null, 'one', 'two');\n },\n function(arg1, arg2, callback){\n callback(null, 'three');\n },\n function(arg1, callback){\n // arg1 now equals 'three'\n callback(null, 'done');\n }\n], function (err, result) {\n // result now equals 'done' \n});\n```\n\n---------------------------------------\n\n### compose(fn1, fn2...)\n\nCreates a function which is a composition of the passed asynchronous\nfunctions. Each function consumes the return value of the function that\nfollows. Composing functions f(), g() and h() would produce the result of\nf(g(h())), only this version uses callbacks to obtain the return values.\n\nEach function is executed with the `this` binding of the composed function.\n\n__Arguments__\n\n* functions... - the asynchronous functions to compose\n\n\n__Example__\n\n```js\nfunction add1(n, callback) {\n setTimeout(function () {\n callback(null, n + 1);\n }, 10);\n}\n\nfunction mul3(n, callback) {\n setTimeout(function () {\n callback(null, n * 3);\n }, 10);\n}\n\nvar add1mul3 = async.compose(mul3, add1);\n\nadd1mul3(4, function (err, result) {\n // result now equals 15\n});\n```\n\n---------------------------------------\n\n### applyEach(fns, args..., callback)\n\nApplies the provided arguments to each function in the array, calling the\ncallback after all functions have completed. If you only provide the first\nargument then it will return a function which lets you pass in the\narguments as if it were a single function call.\n\n__Arguments__\n\n* fns - the asynchronous functions to all call with the same arguments\n* args... - any number of separate arguments to pass to the function\n* callback - the final argument should be the callback, called when all\n functions have completed processing\n\n\n__Example__\n\n```js\nasync.applyEach([enableSearch, updateSchema], 'bucket', callback);\n\n// partial application example:\nasync.each(\n buckets,\n async.applyEach([enableSearch, updateSchema]),\n callback\n);\n```\n\n---------------------------------------\n\n\n### applyEachSeries(arr, iterator, callback)\n\nThe same as applyEach only the functions are applied in series.\n\n---------------------------------------\n\n\n### queue(worker, concurrency)\n\nCreates a queue object with the specified concurrency. Tasks added to the\nqueue will be processed in parallel (up to the concurrency limit). If all\nworkers are in progress, the task is queued until one is available. Once\na worker has completed a task, the task's callback is called.\n\n__Arguments__\n\n* worker(task, callback) - An asynchronous function for processing a queued\n task, which must call its callback(err) argument when finished, with an \n optional error as an argument.\n* concurrency - An integer for determining how many worker functions should be\n run in parallel.\n\n__Queue objects__\n\nThe queue object returned by this function has the following properties and\nmethods:\n\n* length() - a function returning the number of items waiting to be processed.\n* concurrency - an integer for determining how many worker functions should be\n run in parallel. This property can be changed after a queue is created to\n alter the concurrency on-the-fly.\n* push(task, [callback]) - add a new task to the queue, the callback is called\n once the worker has finished processing the task.\n instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.\n* unshift(task, [callback]) - add a new task to the front of the queue.\n* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued\n* empty - a callback that is called when the last item from the queue is given to a worker\n* drain - a callback that is called when the last item from the queue has returned from the worker\n\n__Example__\n\n```js\n// create a queue object with concurrency 2\n\nvar q = async.queue(function (task, callback) {\n console.log('hello ' + task.name);\n callback();\n}, 2);\n\n\n// assign a callback\nq.drain = function() {\n console.log('all items have been processed');\n}\n\n// add some items to the queue\n\nq.push({name: 'foo'}, function (err) {\n console.log('finished processing foo');\n});\nq.push({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\n\n// add some items to the queue (batch-wise)\n\nq.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {\n console.log('finished processing bar');\n});\n\n// add some items to the front of the queue\n\nq.unshift({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\n```\n\n---------------------------------------\n\n\n### cargo(worker, [payload])\n\nCreates a cargo object with the specified payload. Tasks added to the\ncargo will be processed altogether (up to the payload limit). If the\nworker is in progress, the task is queued until it is available. Once\nthe worker has completed some tasks, each callback of those tasks is called.\n\n__Arguments__\n\n* worker(tasks, callback) - An asynchronous function for processing an array of\n queued tasks, which must call its callback(err) argument when finished, with \n an optional error as an argument.\n* payload - An optional integer for determining how many tasks should be\n processed per round; if omitted, the default is unlimited.\n\n__Cargo objects__\n\nThe cargo object returned by this function has the following properties and\nmethods:\n\n* length() - a function returning the number of items waiting to be processed.\n* payload - an integer for determining how many tasks should be\n process per round. This property can be changed after a cargo is created to\n alter the payload on-the-fly.\n* push(task, [callback]) - add a new task to the queue, the callback is called\n once the worker has finished processing the task.\n instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.\n* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued\n* empty - a callback that is called when the last item from the queue is given to a worker\n* drain - a callback that is called when the last item from the queue has returned from the worker\n\n__Example__\n\n```js\n// create a cargo object with payload 2\n\nvar cargo = async.cargo(function (tasks, callback) {\n for(var i=0; i\n### auto(tasks, [callback])\n\nDetermines the best order for running functions based on their requirements.\nEach function can optionally depend on other functions being completed first,\nand each function is run as soon as its requirements are satisfied. If any of\nthe functions pass an error to their callback, that function will not complete\n(so any other functions depending on it will not run) and the main callback\nwill be called immediately with the error. Functions also receive an object\ncontaining the results of functions which have completed so far.\n\nNote, all functions are called with a results object as a second argument, \nso it is unsafe to pass functions in the tasks object which cannot handle the\nextra argument. For example, this snippet of code:\n\n```js\nasync.auto({\n readData: async.apply(fs.readFile, 'data.txt', 'utf-8')\n}, callback);\n```\n\nwill have the effect of calling readFile with the results object as the last\nargument, which will fail:\n\n```js\nfs.readFile('data.txt', 'utf-8', cb, {});\n```\n\nInstead, wrap the call to readFile in a function which does not forward the \nresults object:\n\n```js\nasync.auto({\n readData: function(cb, results){\n fs.readFile('data.txt', 'utf-8', cb);\n }\n}, callback);\n```\n\n__Arguments__\n\n* tasks - An object literal containing named functions or an array of\n requirements, with the function itself the last item in the array. The key\n used for each function or array is used when specifying requirements. The \n function receives two arguments: (1) a callback(err, result) which must be \n called when finished, passing an error (which can be null) and the result of \n the function's execution, and (2) a results object, containing the results of\n the previously executed functions.\n* callback(err, results) - An optional callback which is called when all the\n tasks have been completed. The callback will receive an error as an argument\n if any tasks pass an error to their callback. Results will always be passed\n\tbut if an error occurred, no other tasks will be performed, and the results\n\tobject will only contain partial results.\n \n\n__Example__\n\n```js\nasync.auto({\n get_data: function(callback){\n // async code to get some data\n },\n make_folder: function(callback){\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n },\n write_file: ['get_data', 'make_folder', function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n callback(null, filename);\n }],\n email_link: ['write_file', function(callback, results){\n // once the file is written let's email a link to it...\n // results.write_file contains the filename returned by write_file.\n }]\n});\n```\n\nThis is a fairly trivial example, but to do this using the basic parallel and\nseries functions would look like this:\n\n```js\nasync.parallel([\n function(callback){\n // async code to get some data\n },\n function(callback){\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n }\n],\nfunction(err, results){\n async.series([\n function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n },\n function(callback){\n // once the file is written let's email a link to it...\n }\n ]);\n});\n```\n\nFor a complicated series of async tasks using the auto function makes adding\nnew tasks much easier and makes the code more readable.\n\n\n---------------------------------------\n\n\n### iterator(tasks)\n\nCreates an iterator function which calls the next function in the array,\nreturning a continuation to call the next one after that. It's also possible to\n'peek' the next iterator by doing iterator.next().\n\nThis function is used internally by the async module but can be useful when\nyou want to manually control the flow of functions in series.\n\n__Arguments__\n\n* tasks - An array of functions to run.\n\n__Example__\n\n```js\nvar iterator = async.iterator([\n function(){ sys.p('one'); },\n function(){ sys.p('two'); },\n function(){ sys.p('three'); }\n]);\n\nnode> var iterator2 = iterator();\n'one'\nnode> var iterator3 = iterator2();\n'two'\nnode> iterator3();\n'three'\nnode> var nextfn = iterator2.next();\nnode> nextfn();\n'three'\n```\n\n---------------------------------------\n\n\n### apply(function, arguments..)\n\nCreates a continuation function with some arguments already applied, a useful\nshorthand when combined with other control flow functions. Any arguments\npassed to the returned function are added to the arguments originally passed\nto apply.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to automatically apply when the\n continuation is called.\n\n__Example__\n\n```js\n// using apply\n\nasync.parallel([\n async.apply(fs.writeFile, 'testfile1', 'test1'),\n async.apply(fs.writeFile, 'testfile2', 'test2'),\n]);\n\n\n// the same process without using apply\n\nasync.parallel([\n function(callback){\n fs.writeFile('testfile1', 'test1', callback);\n },\n function(callback){\n fs.writeFile('testfile2', 'test2', callback);\n }\n]);\n```\n\nIt's possible to pass any number of additional arguments when calling the\ncontinuation:\n\n```js\nnode> var fn = async.apply(sys.puts, 'one');\nnode> fn('two', 'three');\none\ntwo\nthree\n```\n\n---------------------------------------\n\n\n### nextTick(callback)\n\nCalls the callback on a later loop around the event loop. In node.js this just\ncalls process.nextTick, in the browser it falls back to setImmediate(callback)\nif available, otherwise setTimeout(callback, 0), which means other higher priority\nevents may precede the execution of the callback.\n\nThis is used internally for browser-compatibility purposes.\n\n__Arguments__\n\n* callback - The function to call on a later loop around the event loop.\n\n__Example__\n\n```js\nvar call_order = [];\nasync.nextTick(function(){\n call_order.push('two');\n // call_order now equals ['one','two']\n});\ncall_order.push('one')\n```\n\n\n### times(n, callback)\n\nCalls the callback n times and accumulates results in the same manner\nyou would use with async.map.\n\n__Arguments__\n\n* n - The number of times to run the function.\n* callback - The function to call n times.\n\n__Example__\n\n```js\n// Pretend this is some complicated async factory\nvar createUser = function(id, callback) {\n callback(null, {\n id: 'user' + id\n })\n}\n// generate 5 users\nasync.times(5, function(n, next){\n createUser(n, function(err, user) {\n next(err, user)\n })\n}, function(err, users) {\n // we should now have 5 users\n});\n```\n\n\n### timesSeries(n, callback)\n\nThe same as times only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n\n## Utils\n\n\n### memoize(fn, [hasher])\n\nCaches the results of an async function. When creating a hash to store function\nresults against, the callback is omitted from the hash and an optional hash\nfunction can be used.\n\nThe cache of results is exposed as the `memo` property of the function returned\nby `memoize`.\n\n__Arguments__\n\n* fn - the function you to proxy and cache results from.\n* hasher - an optional function for generating a custom hash for storing\n results, it has all the arguments applied to it apart from the callback, and\n must be synchronous.\n\n__Example__\n\n```js\nvar slow_fn = function (name, callback) {\n // do something\n callback(null, result);\n};\nvar fn = async.memoize(slow_fn);\n\n// fn can now be used as if it were slow_fn\nfn('some name', function () {\n // callback\n});\n```\n\n\n### unmemoize(fn)\n\nUndoes a memoized function, reverting it to the original, unmemoized\nform. Comes handy in tests.\n\n__Arguments__\n\n* fn - the memoized function\n\n\n### log(function, arguments)\n\nLogs the result of an async function to the console. Only works in node.js or\nin browsers that support console.log and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.log is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n setTimeout(function(){\n callback(null, 'hello ' + name);\n }, 1000);\n};\n```\n```js\nnode> async.log(hello, 'world');\n'hello world'\n```\n\n---------------------------------------\n\n\n### dir(function, arguments)\n\nLogs the result of an async function to the console using console.dir to\ndisplay the properties of the resulting object. Only works in node.js or\nin browsers that support console.dir and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.dir is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n setTimeout(function(){\n callback(null, {hello: name});\n }, 1000);\n};\n```\n```js\nnode> async.dir(hello, 'world');\n{hello: 'world'}\n```\n\n---------------------------------------\n\n\n### noConflict()\n\nChanges the value of async back to its original value, returning a reference to the\nasync object.\n",
- "readmeFilename": "README.md",
- "homepage": "https://github.com/caolan/async",
- "_id": "async@0.2.10",
- "dist": {
- "shasum": "99b77cfd7ef9a051bb8390626d370bd7284d8688"
- },
- "_from": "async@~0.2.6",
- "_resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz"
-}
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/.travis.yml b/builder/node_modules/uglify-js/node_modules/optimist/.travis.yml
deleted file mode 100644
index cc4dba29..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/.travis.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-language: node_js
-node_js:
- - "0.8"
- - "0.10"
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/LICENSE b/builder/node_modules/uglify-js/node_modules/optimist/LICENSE
deleted file mode 100644
index 432d1aeb..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-Copyright 2010 James Halliday (mail@substack.net)
-
-This project is free software released under the MIT/X11 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.
-
-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.
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/example/bool.js b/builder/node_modules/uglify-js/node_modules/optimist/example/bool.js
deleted file mode 100644
index a998fb7a..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/example/bool.js
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env node
-var util = require('util');
-var argv = require('optimist').argv;
-
-if (argv.s) {
- util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: ');
-}
-console.log(
- (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '')
-);
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/example/boolean_double.js b/builder/node_modules/uglify-js/node_modules/optimist/example/boolean_double.js
deleted file mode 100644
index a35a7e6d..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/example/boolean_double.js
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env node
-var argv = require('optimist')
- .boolean(['x','y','z'])
- .argv
-;
-console.dir([ argv.x, argv.y, argv.z ]);
-console.dir(argv._);
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/example/boolean_single.js b/builder/node_modules/uglify-js/node_modules/optimist/example/boolean_single.js
deleted file mode 100644
index 017bb689..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/example/boolean_single.js
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env node
-var argv = require('optimist')
- .boolean('v')
- .argv
-;
-console.dir(argv.v);
-console.dir(argv._);
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/example/default_hash.js b/builder/node_modules/uglify-js/node_modules/optimist/example/default_hash.js
deleted file mode 100644
index ade77681..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/example/default_hash.js
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env node
-
-var argv = require('optimist')
- .default({ x : 10, y : 10 })
- .argv
-;
-
-console.log(argv.x + argv.y);
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/example/default_singles.js b/builder/node_modules/uglify-js/node_modules/optimist/example/default_singles.js
deleted file mode 100644
index d9b1ff45..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/example/default_singles.js
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env node
-var argv = require('optimist')
- .default('x', 10)
- .default('y', 10)
- .argv
-;
-console.log(argv.x + argv.y);
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/example/divide.js b/builder/node_modules/uglify-js/node_modules/optimist/example/divide.js
deleted file mode 100644
index 5e2ee82f..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/example/divide.js
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env node
-
-var argv = require('optimist')
- .usage('Usage: $0 -x [num] -y [num]')
- .demand(['x','y'])
- .argv;
-
-console.log(argv.x / argv.y);
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/example/line_count.js b/builder/node_modules/uglify-js/node_modules/optimist/example/line_count.js
deleted file mode 100644
index b5f95bf6..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/example/line_count.js
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env node
-var argv = require('optimist')
- .usage('Count the lines in a file.\nUsage: $0')
- .demand('f')
- .alias('f', 'file')
- .describe('f', 'Load a file')
- .argv
-;
-
-var fs = require('fs');
-var s = fs.createReadStream(argv.file);
-
-var lines = 0;
-s.on('data', function (buf) {
- lines += buf.toString().match(/\n/g).length;
-});
-
-s.on('end', function () {
- console.log(lines);
-});
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/example/line_count_options.js b/builder/node_modules/uglify-js/node_modules/optimist/example/line_count_options.js
deleted file mode 100644
index d9ac7090..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/example/line_count_options.js
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env node
-var argv = require('optimist')
- .usage('Count the lines in a file.\nUsage: $0')
- .options({
- file : {
- demand : true,
- alias : 'f',
- description : 'Load a file'
- },
- base : {
- alias : 'b',
- description : 'Numeric base to use for output',
- default : 10,
- },
- })
- .argv
-;
-
-var fs = require('fs');
-var s = fs.createReadStream(argv.file);
-
-var lines = 0;
-s.on('data', function (buf) {
- lines += buf.toString().match(/\n/g).length;
-});
-
-s.on('end', function () {
- console.log(lines.toString(argv.base));
-});
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/example/line_count_wrap.js b/builder/node_modules/uglify-js/node_modules/optimist/example/line_count_wrap.js
deleted file mode 100644
index 42675111..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/example/line_count_wrap.js
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env node
-var argv = require('optimist')
- .usage('Count the lines in a file.\nUsage: $0')
- .wrap(80)
- .demand('f')
- .alias('f', [ 'file', 'filename' ])
- .describe('f',
- "Load a file. It's pretty important."
- + " Required even. So you'd better specify it."
- )
- .alias('b', 'base')
- .describe('b', 'Numeric base to display the number of lines in')
- .default('b', 10)
- .describe('x', 'Super-secret optional parameter which is secret')
- .default('x', '')
- .argv
-;
-
-var fs = require('fs');
-var s = fs.createReadStream(argv.file);
-
-var lines = 0;
-s.on('data', function (buf) {
- lines += buf.toString().match(/\n/g).length;
-});
-
-s.on('end', function () {
- console.log(lines.toString(argv.base));
-});
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/example/nonopt.js b/builder/node_modules/uglify-js/node_modules/optimist/example/nonopt.js
deleted file mode 100644
index ee633eed..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/example/nonopt.js
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/bin/env node
-var argv = require('optimist').argv;
-console.log('(%d,%d)', argv.x, argv.y);
-console.log(argv._);
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/example/reflect.js b/builder/node_modules/uglify-js/node_modules/optimist/example/reflect.js
deleted file mode 100644
index 816b3e11..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/example/reflect.js
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/usr/bin/env node
-console.dir(require('optimist').argv);
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/example/short.js b/builder/node_modules/uglify-js/node_modules/optimist/example/short.js
deleted file mode 100644
index 1db0ad0f..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/example/short.js
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/env node
-var argv = require('optimist').argv;
-console.log('(%d,%d)', argv.x, argv.y);
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/example/string.js b/builder/node_modules/uglify-js/node_modules/optimist/example/string.js
deleted file mode 100644
index a8e5aeb2..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/example/string.js
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/env node
-var argv = require('optimist')
- .string('x', 'y')
- .argv
-;
-console.dir([ argv.x, argv.y ]);
-
-/* Turns off numeric coercion:
- ./node string.js -x 000123 -y 9876
- [ '000123', '9876' ]
-*/
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/example/usage-options.js b/builder/node_modules/uglify-js/node_modules/optimist/example/usage-options.js
deleted file mode 100644
index b9999776..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/example/usage-options.js
+++ /dev/null
@@ -1,19 +0,0 @@
-var optimist = require('./../index');
-
-var argv = optimist.usage('This is my awesome program', {
- 'about': {
- description: 'Provide some details about the author of this program',
- required: true,
- short: 'a',
- },
- 'info': {
- description: 'Provide some information about the node.js agains!!!!!!',
- boolean: true,
- short: 'i'
- }
-}).argv;
-
-optimist.showHelp();
-
-console.log('\n\nInspecting options');
-console.dir(argv);
\ No newline at end of file
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/example/xup.js b/builder/node_modules/uglify-js/node_modules/optimist/example/xup.js
deleted file mode 100644
index 8f6ecd20..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/example/xup.js
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env node
-var argv = require('optimist').argv;
-
-if (argv.rif - 5 * argv.xup > 7.138) {
- console.log('Buy more riffiwobbles');
-}
-else {
- console.log('Sell the xupptumblers');
-}
-
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/index.js b/builder/node_modules/uglify-js/node_modules/optimist/index.js
deleted file mode 100644
index 8ac67eb3..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/index.js
+++ /dev/null
@@ -1,478 +0,0 @@
-var path = require('path');
-var wordwrap = require('wordwrap');
-
-/* Hack an instance of Argv with process.argv into Argv
- so people can do
- require('optimist')(['--beeble=1','-z','zizzle']).argv
- to parse a list of args and
- require('optimist').argv
- to get a parsed version of process.argv.
-*/
-
-var inst = Argv(process.argv.slice(2));
-Object.keys(inst).forEach(function (key) {
- Argv[key] = typeof inst[key] == 'function'
- ? inst[key].bind(inst)
- : inst[key];
-});
-
-var exports = module.exports = Argv;
-function Argv (args, cwd) {
- var self = {};
- if (!cwd) cwd = process.cwd();
-
- self.$0 = process.argv
- .slice(0,2)
- .map(function (x) {
- var b = rebase(cwd, x);
- return x.match(/^\//) && b.length < x.length
- ? b : x
- })
- .join(' ')
- ;
-
- if (process.env._ != undefined && process.argv[1] == process.env._) {
- self.$0 = process.env._.replace(
- path.dirname(process.execPath) + '/', ''
- );
- }
-
- var flags = { bools : {}, strings : {} };
-
- self.boolean = function (bools) {
- if (!Array.isArray(bools)) {
- bools = [].slice.call(arguments);
- }
-
- bools.forEach(function (name) {
- flags.bools[name] = true;
- });
-
- return self;
- };
-
- self.string = function (strings) {
- if (!Array.isArray(strings)) {
- strings = [].slice.call(arguments);
- }
-
- strings.forEach(function (name) {
- flags.strings[name] = true;
- });
-
- return self;
- };
-
- var aliases = {};
- self.alias = function (x, y) {
- if (typeof x === 'object') {
- Object.keys(x).forEach(function (key) {
- self.alias(key, x[key]);
- });
- }
- else if (Array.isArray(y)) {
- y.forEach(function (yy) {
- self.alias(x, yy);
- });
- }
- else {
- var zs = (aliases[x] || []).concat(aliases[y] || []).concat(x, y);
- aliases[x] = zs.filter(function (z) { return z != x });
- aliases[y] = zs.filter(function (z) { return z != y });
- }
-
- return self;
- };
-
- var demanded = {};
- self.demand = function (keys) {
- if (typeof keys == 'number') {
- if (!demanded._) demanded._ = 0;
- demanded._ += keys;
- }
- else if (Array.isArray(keys)) {
- keys.forEach(function (key) {
- self.demand(key);
- });
- }
- else {
- demanded[keys] = true;
- }
-
- return self;
- };
-
- var usage;
- self.usage = function (msg, opts) {
- if (!opts && typeof msg === 'object') {
- opts = msg;
- msg = null;
- }
-
- usage = msg;
-
- if (opts) self.options(opts);
-
- return self;
- };
-
- function fail (msg) {
- self.showHelp();
- if (msg) console.error(msg);
- process.exit(1);
- }
-
- var checks = [];
- self.check = function (f) {
- checks.push(f);
- return self;
- };
-
- var defaults = {};
- self.default = function (key, value) {
- if (typeof key === 'object') {
- Object.keys(key).forEach(function (k) {
- self.default(k, key[k]);
- });
- }
- else {
- defaults[key] = value;
- }
-
- return self;
- };
-
- var descriptions = {};
- self.describe = function (key, desc) {
- if (typeof key === 'object') {
- Object.keys(key).forEach(function (k) {
- self.describe(k, key[k]);
- });
- }
- else {
- descriptions[key] = desc;
- }
- return self;
- };
-
- self.parse = function (args) {
- return Argv(args).argv;
- };
-
- self.option = self.options = function (key, opt) {
- if (typeof key === 'object') {
- Object.keys(key).forEach(function (k) {
- self.options(k, key[k]);
- });
- }
- else {
- if (opt.alias) self.alias(key, opt.alias);
- if (opt.demand) self.demand(key);
- if (typeof opt.default !== 'undefined') {
- self.default(key, opt.default);
- }
-
- if (opt.boolean || opt.type === 'boolean') {
- self.boolean(key);
- }
- if (opt.string || opt.type === 'string') {
- self.string(key);
- }
-
- var desc = opt.describe || opt.description || opt.desc;
- if (desc) {
- self.describe(key, desc);
- }
- }
-
- return self;
- };
-
- var wrap = null;
- self.wrap = function (cols) {
- wrap = cols;
- return self;
- };
-
- self.showHelp = function (fn) {
- if (!fn) fn = console.error;
- fn(self.help());
- };
-
- self.help = function () {
- var keys = Object.keys(
- Object.keys(descriptions)
- .concat(Object.keys(demanded))
- .concat(Object.keys(defaults))
- .reduce(function (acc, key) {
- if (key !== '_') acc[key] = true;
- return acc;
- }, {})
- );
-
- var help = keys.length ? [ 'Options:' ] : [];
-
- if (usage) {
- help.unshift(usage.replace(/\$0/g, self.$0), '');
- }
-
- var switches = keys.reduce(function (acc, key) {
- acc[key] = [ key ].concat(aliases[key] || [])
- .map(function (sw) {
- return (sw.length > 1 ? '--' : '-') + sw
- })
- .join(', ')
- ;
- return acc;
- }, {});
-
- var switchlen = longest(Object.keys(switches).map(function (s) {
- return switches[s] || '';
- }));
-
- var desclen = longest(Object.keys(descriptions).map(function (d) {
- return descriptions[d] || '';
- }));
-
- keys.forEach(function (key) {
- var kswitch = switches[key];
- var desc = descriptions[key] || '';
-
- if (wrap) {
- desc = wordwrap(switchlen + 4, wrap)(desc)
- .slice(switchlen + 4)
- ;
- }
-
- var spadding = new Array(
- Math.max(switchlen - kswitch.length + 3, 0)
- ).join(' ');
-
- var dpadding = new Array(
- Math.max(desclen - desc.length + 1, 0)
- ).join(' ');
-
- var type = null;
-
- if (flags.bools[key]) type = '[boolean]';
- if (flags.strings[key]) type = '[string]';
-
- if (!wrap && dpadding.length > 0) {
- desc += dpadding;
- }
-
- var prelude = ' ' + kswitch + spadding;
- var extra = [
- type,
- demanded[key]
- ? '[required]'
- : null
- ,
- defaults[key] !== undefined
- ? '[default: ' + JSON.stringify(defaults[key]) + ']'
- : null
- ,
- ].filter(Boolean).join(' ');
-
- var body = [ desc, extra ].filter(Boolean).join(' ');
-
- if (wrap) {
- var dlines = desc.split('\n');
- var dlen = dlines.slice(-1)[0].length
- + (dlines.length === 1 ? prelude.length : 0)
-
- body = desc + (dlen + extra.length > wrap - 2
- ? '\n'
- + new Array(wrap - extra.length + 1).join(' ')
- + extra
- : new Array(wrap - extra.length - dlen + 1).join(' ')
- + extra
- );
- }
-
- help.push(prelude + body);
- });
-
- help.push('');
- return help.join('\n');
- };
-
- Object.defineProperty(self, 'argv', {
- get : parseArgs,
- enumerable : true,
- });
-
- function parseArgs () {
- var argv = { _ : [], $0 : self.$0 };
- Object.keys(flags.bools).forEach(function (key) {
- setArg(key, defaults[key] || false);
- });
-
- function setArg (key, val) {
- var num = Number(val);
- var value = typeof val !== 'string' || isNaN(num) ? val : num;
- if (flags.strings[key]) value = val;
-
- setKey(argv, key.split('.'), value);
-
- (aliases[key] || []).forEach(function (x) {
- argv[x] = argv[key];
- });
- }
-
- for (var i = 0; i < args.length; i++) {
- var arg = args[i];
-
- if (arg === '--') {
- argv._.push.apply(argv._, args.slice(i + 1));
- break;
- }
- else if (arg.match(/^--.+=/)) {
- // Using [\s\S] instead of . because js doesn't support the
- // 'dotall' regex modifier. See:
- // http://stackoverflow.com/a/1068308/13216
- var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
- setArg(m[1], m[2]);
- }
- else if (arg.match(/^--no-.+/)) {
- var key = arg.match(/^--no-(.+)/)[1];
- setArg(key, false);
- }
- else if (arg.match(/^--.+/)) {
- var key = arg.match(/^--(.+)/)[1];
- var next = args[i + 1];
- if (next !== undefined && !next.match(/^-/)
- && !flags.bools[key]
- && (aliases[key] ? !flags.bools[aliases[key]] : true)) {
- setArg(key, next);
- i++;
- }
- else if (/^(true|false)$/.test(next)) {
- setArg(key, next === 'true');
- i++;
- }
- else {
- setArg(key, true);
- }
- }
- else if (arg.match(/^-[^-]+/)) {
- var letters = arg.slice(1,-1).split('');
-
- var broken = false;
- for (var j = 0; j < letters.length; j++) {
- if (letters[j+1] && letters[j+1].match(/\W/)) {
- setArg(letters[j], arg.slice(j+2));
- broken = true;
- break;
- }
- else {
- setArg(letters[j], true);
- }
- }
-
- if (!broken) {
- var key = arg.slice(-1)[0];
-
- if (args[i+1] && !args[i+1].match(/^-/)
- && !flags.bools[key]
- && (aliases[key] ? !flags.bools[aliases[key]] : true)) {
- setArg(key, args[i+1]);
- i++;
- }
- else if (args[i+1] && /true|false/.test(args[i+1])) {
- setArg(key, args[i+1] === 'true');
- i++;
- }
- else {
- setArg(key, true);
- }
- }
- }
- else {
- var n = Number(arg);
- argv._.push(flags.strings['_'] || isNaN(n) ? arg : n);
- }
- }
-
- Object.keys(defaults).forEach(function (key) {
- if (!(key in argv)) {
- argv[key] = defaults[key];
- if (key in aliases) {
- argv[aliases[key]] = defaults[key];
- }
- }
- });
-
- if (demanded._ && argv._.length < demanded._) {
- fail('Not enough non-option arguments: got '
- + argv._.length + ', need at least ' + demanded._
- );
- }
-
- var missing = [];
- Object.keys(demanded).forEach(function (key) {
- if (!argv[key]) missing.push(key);
- });
-
- if (missing.length) {
- fail('Missing required arguments: ' + missing.join(', '));
- }
-
- checks.forEach(function (f) {
- try {
- if (f(argv) === false) {
- fail('Argument check failed: ' + f.toString());
- }
- }
- catch (err) {
- fail(err)
- }
- });
-
- return argv;
- }
-
- function longest (xs) {
- return Math.max.apply(
- null,
- xs.map(function (x) { return x.length })
- );
- }
-
- return self;
-};
-
-// rebase an absolute path to a relative one with respect to a base directory
-// exported for tests
-exports.rebase = rebase;
-function rebase (base, dir) {
- var ds = path.normalize(dir).split('/').slice(1);
- var bs = path.normalize(base).split('/').slice(1);
-
- for (var i = 0; ds[i] && ds[i] == bs[i]; i++);
- ds.splice(0, i); bs.splice(0, i);
-
- var p = path.normalize(
- bs.map(function () { return '..' }).concat(ds).join('/')
- ).replace(/\/$/,'').replace(/^$/, '.');
- return p.match(/^[.\/]/) ? p : './' + p;
-};
-
-function setKey (obj, keys, value) {
- var o = obj;
- keys.slice(0,-1).forEach(function (key) {
- if (o[key] === undefined) o[key] = {};
- o = o[key];
- });
-
- var key = keys[keys.length - 1];
- if (o[key] === undefined || typeof o[key] === 'boolean') {
- o[key] = value;
- }
- else if (Array.isArray(o[key])) {
- o[key].push(value);
- }
- else {
- o[key] = [ o[key], value ];
- }
-}
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/.npmignore b/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/.npmignore
deleted file mode 100644
index 3c3629e6..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/.npmignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/README.markdown b/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/README.markdown
deleted file mode 100644
index 346374e0..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/README.markdown
+++ /dev/null
@@ -1,70 +0,0 @@
-wordwrap
-========
-
-Wrap your words.
-
-example
-=======
-
-made out of meat
-----------------
-
-meat.js
-
- var wrap = require('wordwrap')(15);
- console.log(wrap('You and your whole family are made out of meat.'));
-
-output:
-
- You and your
- whole family
- are made out
- of meat.
-
-centered
---------
-
-center.js
-
- var wrap = require('wordwrap')(20, 60);
- console.log(wrap(
- 'At long last the struggle and tumult was over.'
- + ' The machines had finally cast off their oppressors'
- + ' and were finally free to roam the cosmos.'
- + '\n'
- + 'Free of purpose, free of obligation.'
- + ' Just drifting through emptiness.'
- + ' The sun was just another point of light.'
- ));
-
-output:
-
- At long last the struggle and tumult
- was over. The machines had finally cast
- off their oppressors and were finally
- free to roam the cosmos.
- Free of purpose, free of obligation.
- Just drifting through emptiness. The
- sun was just another point of light.
-
-methods
-=======
-
-var wrap = require('wordwrap');
-
-wrap(stop), wrap(start, stop, params={mode:"soft"})
----------------------------------------------------
-
-Returns a function that takes a string and returns a new string.
-
-Pad out lines with spaces out to column `start` and then wrap until column
-`stop`. If a word is longer than `stop - start` characters it will overflow.
-
-In "soft" mode, split chunks by `/(\S+\s+/` and don't break up chunks which are
-longer than `stop - start`, in "hard" mode, split chunks with `/\b/` and break
-up chunks longer than `stop - start`.
-
-wrap.hard(start, stop)
-----------------------
-
-Like `wrap()` but with `params.mode = "hard"`.
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/example/center.js b/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/example/center.js
deleted file mode 100644
index a3fbaae9..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/example/center.js
+++ /dev/null
@@ -1,10 +0,0 @@
-var wrap = require('wordwrap')(20, 60);
-console.log(wrap(
- 'At long last the struggle and tumult was over.'
- + ' The machines had finally cast off their oppressors'
- + ' and were finally free to roam the cosmos.'
- + '\n'
- + 'Free of purpose, free of obligation.'
- + ' Just drifting through emptiness.'
- + ' The sun was just another point of light.'
-));
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/example/meat.js b/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/example/meat.js
deleted file mode 100644
index a4665e10..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/example/meat.js
+++ /dev/null
@@ -1,3 +0,0 @@
-var wrap = require('wordwrap')(15);
-
-console.log(wrap('You and your whole family are made out of meat.'));
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/index.js b/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/index.js
deleted file mode 100644
index c9bc9452..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/index.js
+++ /dev/null
@@ -1,76 +0,0 @@
-var wordwrap = module.exports = function (start, stop, params) {
- if (typeof start === 'object') {
- params = start;
- start = params.start;
- stop = params.stop;
- }
-
- if (typeof stop === 'object') {
- params = stop;
- start = start || params.start;
- stop = undefined;
- }
-
- if (!stop) {
- stop = start;
- start = 0;
- }
-
- if (!params) params = {};
- var mode = params.mode || 'soft';
- var re = mode === 'hard' ? /\b/ : /(\S+\s+)/;
-
- return function (text) {
- var chunks = text.toString()
- .split(re)
- .reduce(function (acc, x) {
- if (mode === 'hard') {
- for (var i = 0; i < x.length; i += stop - start) {
- acc.push(x.slice(i, i + stop - start));
- }
- }
- else acc.push(x)
- return acc;
- }, [])
- ;
-
- return chunks.reduce(function (lines, rawChunk) {
- if (rawChunk === '') return lines;
-
- var chunk = rawChunk.replace(/\t/g, ' ');
-
- var i = lines.length - 1;
- if (lines[i].length + chunk.length > stop) {
- lines[i] = lines[i].replace(/\s+$/, '');
-
- chunk.split(/\n/).forEach(function (c) {
- lines.push(
- new Array(start + 1).join(' ')
- + c.replace(/^\s+/, '')
- );
- });
- }
- else if (chunk.match(/\n/)) {
- var xs = chunk.split(/\n/);
- lines[i] += xs.shift();
- xs.forEach(function (c) {
- lines.push(
- new Array(start + 1).join(' ')
- + c.replace(/^\s+/, '')
- );
- });
- }
- else {
- lines[i] += chunk;
- }
-
- return lines;
- }, [ new Array(start + 1).join(' ') ]).join('\n');
- };
-};
-
-wordwrap.soft = wordwrap;
-
-wordwrap.hard = function (start, stop) {
- return wordwrap(start, stop, { mode : 'hard' });
-};
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/package.json b/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/package.json
deleted file mode 100644
index df8dc051..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/package.json
+++ /dev/null
@@ -1,45 +0,0 @@
-{
- "name": "wordwrap",
- "description": "Wrap those words. Show them at what columns to start and stop.",
- "version": "0.0.2",
- "repository": {
- "type": "git",
- "url": "git://github.com/substack/node-wordwrap.git"
- },
- "main": "./index.js",
- "keywords": [
- "word",
- "wrap",
- "rule",
- "format",
- "column"
- ],
- "directories": {
- "lib": ".",
- "example": "example",
- "test": "test"
- },
- "scripts": {
- "test": "expresso"
- },
- "devDependencies": {
- "expresso": "=0.7.x"
- },
- "engines": {
- "node": ">=0.4.0"
- },
- "license": "MIT/X11",
- "author": {
- "name": "James Halliday",
- "email": "mail@substack.net",
- "url": "http://substack.net"
- },
- "readme": "wordwrap\n========\n\nWrap your words.\n\nexample\n=======\n\nmade out of meat\n----------------\n\nmeat.js\n\n var wrap = require('wordwrap')(15);\n console.log(wrap('You and your whole family are made out of meat.'));\n\noutput:\n\n You and your\n whole family\n are made out\n of meat.\n\ncentered\n--------\n\ncenter.js\n\n var wrap = require('wordwrap')(20, 60);\n console.log(wrap(\n 'At long last the struggle and tumult was over.'\n + ' The machines had finally cast off their oppressors'\n + ' and were finally free to roam the cosmos.'\n + '\\n'\n + 'Free of purpose, free of obligation.'\n + ' Just drifting through emptiness.'\n + ' The sun was just another point of light.'\n ));\n\noutput:\n\n At long last the struggle and tumult\n was over. The machines had finally cast\n off their oppressors and were finally\n free to roam the cosmos.\n Free of purpose, free of obligation.\n Just drifting through emptiness. The\n sun was just another point of light.\n\nmethods\n=======\n\nvar wrap = require('wordwrap');\n\nwrap(stop), wrap(start, stop, params={mode:\"soft\"})\n---------------------------------------------------\n\nReturns a function that takes a string and returns a new string.\n\nPad out lines with spaces out to column `start` and then wrap until column\n`stop`. If a word is longer than `stop - start` characters it will overflow.\n\nIn \"soft\" mode, split chunks by `/(\\S+\\s+/` and don't break up chunks which are\nlonger than `stop - start`, in \"hard\" mode, split chunks with `/\\b/` and break\nup chunks longer than `stop - start`.\n\nwrap.hard(start, stop)\n----------------------\n\nLike `wrap()` but with `params.mode = \"hard\"`.\n",
- "readmeFilename": "README.markdown",
- "bugs": {
- "url": "https://github.com/substack/node-wordwrap/issues"
- },
- "homepage": "https://github.com/substack/node-wordwrap",
- "_id": "wordwrap@0.0.2",
- "_from": "wordwrap@~0.0.2"
-}
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/break.js b/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/break.js
deleted file mode 100644
index 749292ec..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/break.js
+++ /dev/null
@@ -1,30 +0,0 @@
-var assert = require('assert');
-var wordwrap = require('../');
-
-exports.hard = function () {
- var s = 'Assert from {"type":"equal","ok":false,"found":1,"wanted":2,'
- + '"stack":[],"id":"b7ddcd4c409de8799542a74d1a04689b",'
- + '"browser":"chrome/6.0"}'
- ;
- var s_ = wordwrap.hard(80)(s);
-
- var lines = s_.split('\n');
- assert.equal(lines.length, 2);
- assert.ok(lines[0].length < 80);
- assert.ok(lines[1].length < 80);
-
- assert.equal(s, s_.replace(/\n/g, ''));
-};
-
-exports.break = function () {
- var s = new Array(55+1).join('a');
- var s_ = wordwrap.hard(20)(s);
-
- var lines = s_.split('\n');
- assert.equal(lines.length, 3);
- assert.ok(lines[0].length === 20);
- assert.ok(lines[1].length === 20);
- assert.ok(lines[2].length === 15);
-
- assert.equal(s, s_.replace(/\n/g, ''));
-};
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/idleness.txt b/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/idleness.txt
deleted file mode 100644
index aa3f4907..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/idleness.txt
+++ /dev/null
@@ -1,63 +0,0 @@
-In Praise of Idleness
-
-By Bertrand Russell
-
-[1932]
-
-Like most of my generation, I was brought up on the saying: 'Satan finds some mischief for idle hands to do.' Being a highly virtuous child, I believed all that I was told, and acquired a conscience which has kept me working hard down to the present moment. But although my conscience has controlled my actions, my opinions have undergone a revolution. I think that there is far too much work done in the world, that immense harm is caused by the belief that work is virtuous, and that what needs to be preached in modern industrial countries is quite different from what always has been preached. Everyone knows the story of the traveler in Naples who saw twelve beggars lying in the sun (it was before the days of Mussolini), and offered a lira to the laziest of them. Eleven of them jumped up to claim it, so he gave it to the twelfth. this traveler was on the right lines. But in countries which do not enjoy Mediterranean sunshine idleness is more difficult, and a great public propaganda will be required to inaugurate it. I hope that, after reading the following pages, the leaders of the YMCA will start a campaign to induce good young men to do nothing. If so, I shall not have lived in vain.
-
-Before advancing my own arguments for laziness, I must dispose of one which I cannot accept. Whenever a person who already has enough to live on proposes to engage in some everyday kind of job, such as school-teaching or typing, he or she is told that such conduct takes the bread out of other people's mouths, and is therefore wicked. If this argument were valid, it would only be necessary for us all to be idle in order that we should all have our mouths full of bread. What people who say such things forget is that what a man earns he usually spends, and in spending he gives employment. As long as a man spends his income, he puts just as much bread into people's mouths in spending as he takes out of other people's mouths in earning. The real villain, from this point of view, is the man who saves. If he merely puts his savings in a stocking, like the proverbial French peasant, it is obvious that they do not give employment. If he invests his savings, the matter is less obvious, and different cases arise.
-
-One of the commonest things to do with savings is to lend them to some Government. In view of the fact that the bulk of the public expenditure of most civilized Governments consists in payment for past wars or preparation for future wars, the man who lends his money to a Government is in the same position as the bad men in Shakespeare who hire murderers. The net result of the man's economical habits is to increase the armed forces of the State to which he lends his savings. Obviously it would be better if he spent the money, even if he spent it in drink or gambling.
-
-But, I shall be told, the case is quite different when savings are invested in industrial enterprises. When such enterprises succeed, and produce something useful, this may be conceded. In these days, however, no one will deny that most enterprises fail. That means that a large amount of human labor, which might have been devoted to producing something that could be enjoyed, was expended on producing machines which, when produced, lay idle and did no good to anyone. The man who invests his savings in a concern that goes bankrupt is therefore injuring others as well as himself. If he spent his money, say, in giving parties for his friends, they (we may hope) would get pleasure, and so would all those upon whom he spent money, such as the butcher, the baker, and the bootlegger. But if he spends it (let us say) upon laying down rails for surface card in some place where surface cars turn out not to be wanted, he has diverted a mass of labor into channels where it gives pleasure to no one. Nevertheless, when he becomes poor through failure of his investment he will be regarded as a victim of undeserved misfortune, whereas the gay spendthrift, who has spent his money philanthropically, will be despised as a fool and a frivolous person.
-
-All this is only preliminary. I want to say, in all seriousness, that a great deal of harm is being done in the modern world by belief in the virtuousness of work, and that the road to happiness and prosperity lies in an organized diminution of work.
-
-First of all: what is work? Work is of two kinds: first, altering the position of matter at or near the earth's surface relatively to other such matter; second, telling other people to do so. The first kind is unpleasant and ill paid; the second is pleasant and highly paid. The second kind is capable of indefinite extension: there are not only those who give orders, but those who give advice as to what orders should be given. Usually two opposite kinds of advice are given simultaneously by two organized bodies of men; this is called politics. The skill required for this kind of work is not knowledge of the subjects as to which advice is given, but knowledge of the art of persuasive speaking and writing, i.e. of advertising.
-
-Throughout Europe, though not in America, there is a third class of men, more respected than either of the classes of workers. There are men who, through ownership of land, are able to make others pay for the privilege of being allowed to exist and to work. These landowners are idle, and I might therefore be expected to praise them. Unfortunately, their idleness is only rendered possible by the industry of others; indeed their desire for comfortable idleness is historically the source of the whole gospel of work. The last thing they have ever wished is that others should follow their example.
-
-From the beginning of civilization until the Industrial Revolution, a man could, as a rule, produce by hard work little more than was required for the subsistence of himself and his family, although his wife worked at least as hard as he did, and his children added their labor as soon as they were old enough to do so. The small surplus above bare necessaries was not left to those who produced it, but was appropriated by warriors and priests. In times of famine there was no surplus; the warriors and priests, however, still secured as much as at other times, with the result that many of the workers died of hunger. This system persisted in Russia until 1917 [1], and still persists in the East; in England, in spite of the Industrial Revolution, it remained in full force throughout the Napoleonic wars, and until a hundred years ago, when the new class of manufacturers acquired power. In America, the system came to an end with the Revolution, except in the South, where it persisted until the Civil War. A system which lasted so long and ended so recently has naturally left a profound impress upon men's thoughts and opinions. Much that we take for granted about the desirability of work is derived from this system, and, being pre-industrial, is not adapted to the modern world. Modern technique has made it possible for leisure, within limits, to be not the prerogative of small privileged classes, but a right evenly distributed throughout the community. The morality of work is the morality of slaves, and the modern world has no need of slavery.
-
-It is obvious that, in primitive communities, peasants, left to themselves, would not have parted with the slender surplus upon which the warriors and priests subsisted, but would have either produced less or consumed more. At first, sheer force compelled them to produce and part with the surplus. Gradually, however, it was found possible to induce many of them to accept an ethic according to which it was their duty to work hard, although part of their work went to support others in idleness. By this means the amount of compulsion required was lessened, and the expenses of government were diminished. To this day, 99 per cent of British wage-earners would be genuinely shocked if it were proposed that the King should not have a larger income than a working man. The conception of duty, speaking historically, has been a means used by the holders of power to induce others to live for the interests of their masters rather than for their own. Of course the holders of power conceal this fact from themselves by managing to believe that their interests are identical with the larger interests of humanity. Sometimes this is true; Athenian slave-owners, for instance, employed part of their leisure in making a permanent contribution to civilization which would have been impossible under a just economic system. Leisure is essential to civilization, and in former times leisure for the few was only rendered possible by the labors of the many. But their labors were valuable, not because work is good, but because leisure is good. And with modern technique it would be possible to distribute leisure justly without injury to civilization.
-
-Modern technique has made it possible to diminish enormously the amount of labor required to secure the necessaries of life for everyone. This was made obvious during the war. At that time all the men in the armed forces, and all the men and women engaged in the production of munitions, all the men and women engaged in spying, war propaganda, or Government offices connected with the war, were withdrawn from productive occupations. In spite of this, the general level of well-being among unskilled wage-earners on the side of the Allies was higher than before or since. The significance of this fact was concealed by finance: borrowing made it appear as if the future was nourishing the present. But that, of course, would have been impossible; a man cannot eat a loaf of bread that does not yet exist. The war showed conclusively that, by the scientific organization of production, it is possible to keep modern populations in fair comfort on a small part of the working capacity of the modern world. If, at the end of the war, the scientific organization, which had been created in order to liberate men for fighting and munition work, had been preserved, and the hours of the week had been cut down to four, all would have been well. Instead of that the old chaos was restored, those whose work was demanded were made to work long hours, and the rest were left to starve as unemployed. Why? Because work is a duty, and a man should not receive wages in proportion to what he has produced, but in proportion to his virtue as exemplified by his industry.
-
-This is the morality of the Slave State, applied in circumstances totally unlike those in which it arose. No wonder the result has been disastrous. Let us take an illustration. Suppose that, at a given moment, a certain number of people are engaged in the manufacture of pins. They make as many pins as the world needs, working (say) eight hours a day. Someone makes an invention by which the same number of men can make twice as many pins: pins are already so cheap that hardly any more will be bought at a lower price. In a sensible world, everybody concerned in the manufacturing of pins would take to working four hours instead of eight, and everything else would go on as before. But in the actual world this would be thought demoralizing. The men still work eight hours, there are too many pins, some employers go bankrupt, and half the men previously concerned in making pins are thrown out of work. There is, in the end, just as much leisure as on the other plan, but half the men are totally idle while half are still overworked. In this way, it is insured that the unavoidable leisure shall cause misery all round instead of being a universal source of happiness. Can anything more insane be imagined?
-
-The idea that the poor should have leisure has always been shocking to the rich. In England, in the early nineteenth century, fifteen hours was the ordinary day's work for a man; children sometimes did as much, and very commonly did twelve hours a day. When meddlesome busybodies suggested that perhaps these hours were rather long, they were told that work kept adults from drink and children from mischief. When I was a child, shortly after urban working men had acquired the vote, certain public holidays were established by law, to the great indignation of the upper classes. I remember hearing an old Duchess say: 'What do the poor want with holidays? They ought to work.' People nowadays are less frank, but the sentiment persists, and is the source of much of our economic confusion.
-
-Let us, for a moment, consider the ethics of work frankly, without superstition. Every human being, of necessity, consumes, in the course of his life, a certain amount of the produce of human labor. Assuming, as we may, that labor is on the whole disagreeable, it is unjust that a man should consume more than he produces. Of course he may provide services rather than commodities, like a medical man, for example; but he should provide something in return for his board and lodging. to this extent, the duty of work must be admitted, but to this extent only.
-
-I shall not dwell upon the fact that, in all modern societies outside the USSR, many people escape even this minimum amount of work, namely all those who inherit money and all those who marry money. I do not think the fact that these people are allowed to be idle is nearly so harmful as the fact that wage-earners are expected to overwork or starve.
-
-If the ordinary wage-earner worked four hours a day, there would be enough for everybody and no unemployment -- assuming a certain very moderate amount of sensible organization. This idea shocks the well-to-do, because they are convinced that the poor would not know how to use so much leisure. In America men often work long hours even when they are well off; such men, naturally, are indignant at the idea of leisure for wage-earners, except as the grim punishment of unemployment; in fact, they dislike leisure even for their sons. Oddly enough, while they wish their sons to work so hard as to have no time to be civilized, they do not mind their wives and daughters having no work at all. the snobbish admiration of uselessness, which, in an aristocratic society, extends to both sexes, is, under a plutocracy, confined to women; this, however, does not make it any more in agreement with common sense.
-
-The wise use of leisure, it must be conceded, is a product of civilization and education. A man who has worked long hours all his life will become bored if he becomes suddenly idle. But without a considerable amount of leisure a man is cut off from many of the best things. There is no longer any reason why the bulk of the population should suffer this deprivation; only a foolish asceticism, usually vicarious, makes us continue to insist on work in excessive quantities now that the need no longer exists.
-
-In the new creed which controls the government of Russia, while there is much that is very different from the traditional teaching of the West, there are some things that are quite unchanged. The attitude of the governing classes, and especially of those who conduct educational propaganda, on the subject of the dignity of labor, is almost exactly that which the governing classes of the world have always preached to what were called the 'honest poor'. Industry, sobriety, willingness to work long hours for distant advantages, even submissiveness to authority, all these reappear; moreover authority still represents the will of the Ruler of the Universe, Who, however, is now called by a new name, Dialectical Materialism.
-
-The victory of the proletariat in Russia has some points in common with the victory of the feminists in some other countries. For ages, men had conceded the superior saintliness of women, and had consoled women for their inferiority by maintaining that saintliness is more desirable than power. At last the feminists decided that they would have both, since the pioneers among them believed all that the men had told them about the desirability of virtue, but not what they had told them about the worthlessness of political power. A similar thing has happened in Russia as regards manual work. For ages, the rich and their sycophants have written in praise of 'honest toil', have praised the simple life, have professed a religion which teaches that the poor are much more likely to go to heaven than the rich, and in general have tried to make manual workers believe that there is some special nobility about altering the position of matter in space, just as men tried to make women believe that they derived some special nobility from their sexual enslavement. In Russia, all this teaching about the excellence of manual work has been taken seriously, with the result that the manual worker is more honored than anyone else. What are, in essence, revivalist appeals are made, but not for the old purposes: they are made to secure shock workers for special tasks. Manual work is the ideal which is held before the young, and is the basis of all ethical teaching.
-
-For the present, possibly, this is all to the good. A large country, full of natural resources, awaits development, and has has to be developed with very little use of credit. In these circumstances, hard work is necessary, and is likely to bring a great reward. But what will happen when the point has been reached where everybody could be comfortable without working long hours?
-
-In the West, we have various ways of dealing with this problem. We have no attempt at economic justice, so that a large proportion of the total produce goes to a small minority of the population, many of whom do no work at all. Owing to the absence of any central control over production, we produce hosts of things that are not wanted. We keep a large percentage of the working population idle, because we can dispense with their labor by making the others overwork. When all these methods prove inadequate, we have a war: we cause a number of people to manufacture high explosives, and a number of others to explode them, as if we were children who had just discovered fireworks. By a combination of all these devices we manage, though with difficulty, to keep alive the notion that a great deal of severe manual work must be the lot of the average man.
-
-In Russia, owing to more economic justice and central control over production, the problem will have to be differently solved. the rational solution would be, as soon as the necessaries and elementary comforts can be provided for all, to reduce the hours of labor gradually, allowing a popular vote to decide, at each stage, whether more leisure or more goods were to be preferred. But, having taught the supreme virtue of hard work, it is difficult to see how the authorities can aim at a paradise in which there will be much leisure and little work. It seems more likely that they will find continually fresh schemes, by which present leisure is to be sacrificed to future productivity. I read recently of an ingenious plan put forward by Russian engineers, for making the White Sea and the northern coasts of Siberia warm, by putting a dam across the Kara Sea. An admirable project, but liable to postpone proletarian comfort for a generation, while the nobility of toil is being displayed amid the ice-fields and snowstorms of the Arctic Ocean. This sort of thing, if it happens, will be the result of regarding the virtue of hard work as an end in itself, rather than as a means to a state of affairs in which it is no longer needed.
-
-The fact is that moving matter about, while a certain amount of it is necessary to our existence, is emphatically not one of the ends of human life. If it were, we should have to consider every navvy superior to Shakespeare. We have been misled in this matter by two causes. One is the necessity of keeping the poor contented, which has led the rich, for thousands of years, to preach the dignity of labor, while taking care themselves to remain undignified in this respect. The other is the new pleasure in mechanism, which makes us delight in the astonishingly clever changes that we can produce on the earth's surface. Neither of these motives makes any great appeal to the actual worker. If you ask him what he thinks the best part of his life, he is not likely to say: 'I enjoy manual work because it makes me feel that I am fulfilling man's noblest task, and because I like to think how much man can transform his planet. It is true that my body demands periods of rest, which I have to fill in as best I may, but I am never so happy as when the morning comes and I can return to the toil from which my contentment springs.' I have never heard working men say this sort of thing. They consider work, as it should be considered, a necessary means to a livelihood, and it is from their leisure that they derive whatever happiness they may enjoy.
-
-It will be said that, while a little leisure is pleasant, men would not know how to fill their days if they had only four hours of work out of the twenty-four. In so far as this is true in the modern world, it is a condemnation of our civilization; it would not have been true at any earlier period. There was formerly a capacity for light-heartedness and play which has been to some extent inhibited by the cult of efficiency. The modern man thinks that everything ought to be done for the sake of something else, and never for its own sake. Serious-minded persons, for example, are continually condemning the habit of going to the cinema, and telling us that it leads the young into crime. But all the work that goes to producing a cinema is respectable, because it is work, and because it brings a money profit. The notion that the desirable activities are those that bring a profit has made everything topsy-turvy. The butcher who provides you with meat and the baker who provides you with bread are praiseworthy, because they are making money; but when you enjoy the food they have provided, you are merely frivolous, unless you eat only to get strength for your work. Broadly speaking, it is held that getting money is good and spending money is bad. Seeing that they are two sides of one transaction, this is absurd; one might as well maintain that keys are good, but keyholes are bad. Whatever merit there may be in the production of goods must be entirely derivative from the advantage to be obtained by consuming them. The individual, in our society, works for profit; but the social purpose of his work lies in the consumption of what he produces. It is this divorce between the individual and the social purpose of production that makes it so difficult for men to think clearly in a world in which profit-making is the incentive to industry. We think too much of production, and too little of consumption. One result is that we attach too little importance to enjoyment and simple happiness, and that we do not judge production by the pleasure that it gives to the consumer.
-
-When I suggest that working hours should be reduced to four, I am not meaning to imply that all the remaining time should necessarily be spent in pure frivolity. I mean that four hours' work a day should entitle a man to the necessities and elementary comforts of life, and that the rest of his time should be his to use as he might see fit. It is an essential part of any such social system that education should be carried further than it usually is at present, and should aim, in part, at providing tastes which would enable a man to use leisure intelligently. I am not thinking mainly of the sort of things that would be considered 'highbrow'. Peasant dances have died out except in remote rural areas, but the impulses which caused them to be cultivated must still exist in human nature. The pleasures of urban populations have become mainly passive: seeing cinemas, watching football matches, listening to the radio, and so on. This results from the fact that their active energies are fully taken up with work; if they had more leisure, they would again enjoy pleasures in which they took an active part.
-
-In the past, there was a small leisure class and a larger working class. The leisure class enjoyed advantages for which there was no basis in social justice; this necessarily made it oppressive, limited its sympathies, and caused it to invent theories by which to justify its privileges. These facts greatly diminished its excellence, but in spite of this drawback it contributed nearly the whole of what we call civilization. It cultivated the arts and discovered the sciences; it wrote the books, invented the philosophies, and refined social relations. Even the liberation of the oppressed has usually been inaugurated from above. Without the leisure class, mankind would never have emerged from barbarism.
-
-The method of a leisure class without duties was, however, extraordinarily wasteful. None of the members of the class had to be taught to be industrious, and the class as a whole was not exceptionally intelligent. The class might produce one Darwin, but against him had to be set tens of thousands of country gentlemen who never thought of anything more intelligent than fox-hunting and punishing poachers. At present, the universities are supposed to provide, in a more systematic way, what the leisure class provided accidentally and as a by-product. This is a great improvement, but it has certain drawbacks. University life is so different from life in the world at large that men who live in academic milieu tend to be unaware of the preoccupations and problems of ordinary men and women; moreover their ways of expressing themselves are usually such as to rob their opinions of the influence that they ought to have upon the general public. Another disadvantage is that in universities studies are organized, and the man who thinks of some original line of research is likely to be discouraged. Academic institutions, therefore, useful as they are, are not adequate guardians of the interests of civilization in a world where everyone outside their walls is too busy for unutilitarian pursuits.
-
-In a world where no one is compelled to work more than four hours a day, every person possessed of scientific curiosity will be able to indulge it, and every painter will be able to paint without starving, however excellent his pictures may be. Young writers will not be obliged to draw attention to themselves by sensational pot-boilers, with a view to acquiring the economic independence needed for monumental works, for which, when the time at last comes, they will have lost the taste and capacity. Men who, in their professional work, have become interested in some phase of economics or government, will be able to develop their ideas without the academic detachment that makes the work of university economists often seem lacking in reality. Medical men will have the time to learn about the progress of medicine, teachers will not be exasperatedly struggling to teach by routine methods things which they learnt in their youth, which may, in the interval, have been proved to be untrue.
-
-Above all, there will be happiness and joy of life, instead of frayed nerves, weariness, and dyspepsia. The work exacted will be enough to make leisure delightful, but not enough to produce exhaustion. Since men will not be tired in their spare time, they will not demand only such amusements as are passive and vapid. At least one per cent will probably devote the time not spent in professional work to pursuits of some public importance, and, since they will not depend upon these pursuits for their livelihood, their originality will be unhampered, and there will be no need to conform to the standards set by elderly pundits. But it is not only in these exceptional cases that the advantages of leisure will appear. Ordinary men and women, having the opportunity of a happy life, will become more kindly and less persecuting and less inclined to view others with suspicion. The taste for war will die out, partly for this reason, and partly because it will involve long and severe work for all. Good nature is, of all moral qualities, the one that the world needs most, and good nature is the result of ease and security, not of a life of arduous struggle. Modern methods of production have given us the possibility of ease and security for all; we have chosen, instead, to have overwork for some and starvation for others. Hitherto we have continued to be as energetic as we were before there were machines; in this we have been foolish, but there is no reason to go on being foolish forever.
-
-[1] Since then, members of the Communist Party have succeeded to this privilege of the warriors and priests.
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/wrap.js b/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/wrap.js
deleted file mode 100644
index 0cfb76d1..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/test/wrap.js
+++ /dev/null
@@ -1,31 +0,0 @@
-var assert = require('assert');
-var wordwrap = require('wordwrap');
-
-var fs = require('fs');
-var idleness = fs.readFileSync(__dirname + '/idleness.txt', 'utf8');
-
-exports.stop80 = function () {
- var lines = wordwrap(80)(idleness).split(/\n/);
- var words = idleness.split(/\s+/);
-
- lines.forEach(function (line) {
- assert.ok(line.length <= 80, 'line > 80 columns');
- var chunks = line.match(/\S/) ? line.split(/\s+/) : [];
- assert.deepEqual(chunks, words.splice(0, chunks.length));
- });
-};
-
-exports.start20stop60 = function () {
- var lines = wordwrap(20, 100)(idleness).split(/\n/);
- var words = idleness.split(/\s+/);
-
- lines.forEach(function (line) {
- assert.ok(line.length <= 100, 'line > 100 columns');
- var chunks = line
- .split(/\s+/)
- .filter(function (x) { return x.match(/\S/) })
- ;
- assert.deepEqual(chunks, words.splice(0, chunks.length));
- assert.deepEqual(line.slice(0, 20), new Array(20 + 1).join(' '));
- });
-};
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/package.json b/builder/node_modules/uglify-js/node_modules/optimist/package.json
deleted file mode 100644
index 745129b0..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/package.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "name": "optimist",
- "version": "0.3.7",
- "description": "Light-weight option parsing with an argv hash. No optstrings attached.",
- "main": "./index.js",
- "dependencies": {
- "wordwrap": "~0.0.2"
- },
- "devDependencies": {
- "hashish": "~0.0.4",
- "tap": "~0.4.0"
- },
- "scripts": {
- "test": "tap ./test/*.js"
- },
- "repository": {
- "type": "git",
- "url": "http://github.com/substack/node-optimist.git"
- },
- "keywords": [
- "argument",
- "args",
- "option",
- "parser",
- "parsing",
- "cli",
- "command"
- ],
- "author": {
- "name": "James Halliday",
- "email": "mail@substack.net",
- "url": "http://substack.net"
- },
- "license": "MIT/X11",
- "engine": {
- "node": ">=0.4"
- },
- "readme": "optimist\n========\n\nOptimist is a node.js library for option parsing for people who hate option\nparsing. More specifically, this module is for people who like all the --bells\nand -whistlz of program usage but think optstrings are a waste of time.\n\nWith optimist, option parsing doesn't have to suck (as much).\n\n[](http://travis-ci.org/substack/node-optimist)\n\nexamples\n========\n\nWith Optimist, the options are just a hash! No optstrings attached.\n-------------------------------------------------------------------\n\nxup.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\n\nif (argv.rif - 5 * argv.xup > 7.138) {\n console.log('Buy more riffiwobbles');\n}\nelse {\n console.log('Sell the xupptumblers');\n}\n````\n\n***\n\n $ ./xup.js --rif=55 --xup=9.52\n Buy more riffiwobbles\n \n $ ./xup.js --rif 12 --xup 8.1\n Sell the xupptumblers\n\n\n\nBut wait! There's more! You can do short options:\n-------------------------------------------------\n \nshort.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\n````\n\n***\n\n $ ./short.js -x 10 -y 21\n (10,21)\n\nAnd booleans, both long and short (and grouped):\n----------------------------------\n\nbool.js:\n\n````javascript\n#!/usr/bin/env node\nvar util = require('util');\nvar argv = require('optimist').argv;\n\nif (argv.s) {\n util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: ');\n}\nconsole.log(\n (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '')\n);\n````\n\n***\n\n $ ./bool.js -s\n The cat says: meow\n \n $ ./bool.js -sp\n The cat says: meow.\n\n $ ./bool.js -sp --fr\n Le chat dit: miaou.\n\nAnd non-hypenated options too! Just use `argv._`!\n-------------------------------------------------\n \nnonopt.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist').argv;\nconsole.log('(%d,%d)', argv.x, argv.y);\nconsole.log(argv._);\n````\n\n***\n\n $ ./nonopt.js -x 6.82 -y 3.35 moo\n (6.82,3.35)\n [ 'moo' ]\n \n $ ./nonopt.js foo -x 0.54 bar -y 1.12 baz\n (0.54,1.12)\n [ 'foo', 'bar', 'baz' ]\n\nPlus, Optimist comes with .usage() and .demand()!\n-------------------------------------------------\n\ndivide.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Usage: $0 -x [num] -y [num]')\n .demand(['x','y'])\n .argv;\n\nconsole.log(argv.x / argv.y);\n````\n\n***\n \n $ ./divide.js -x 55 -y 11\n 5\n \n $ node ./divide.js -x 4.91 -z 2.51\n Usage: node ./divide.js -x [num] -y [num]\n\n Options:\n -x [required]\n -y [required]\n\n Missing required arguments: y\n\nEVEN MORE HOLY COW\n------------------\n\ndefault_singles.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default('x', 10)\n .default('y', 10)\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_singles.js -x 5\n 15\n\ndefault_hash.js:\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .default({ x : 10, y : 10 })\n .argv\n;\nconsole.log(argv.x + argv.y);\n````\n\n***\n\n $ ./default_hash.js -y 7\n 17\n\nAnd if you really want to get all descriptive about it...\n---------------------------------------------------------\n\nboolean_single.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean('v')\n .argv\n;\nconsole.dir(argv);\n````\n\n***\n\n $ ./boolean_single.js -v foo bar baz\n true\n [ 'bar', 'baz', 'foo' ]\n\nboolean_double.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .boolean(['x','y','z'])\n .argv\n;\nconsole.dir([ argv.x, argv.y, argv.z ]);\nconsole.dir(argv._);\n````\n\n***\n\n $ ./boolean_double.js -x -z one two three\n [ true, false, true ]\n [ 'one', 'two', 'three' ]\n\nOptimist is here to help...\n---------------------------\n\nYou can describe parameters for help messages and set aliases. Optimist figures\nout how to format a handy help string automatically.\n\nline_count.js\n\n````javascript\n#!/usr/bin/env node\nvar argv = require('optimist')\n .usage('Count the lines in a file.\\nUsage: $0')\n .demand('f')\n .alias('f', 'file')\n .describe('f', 'Load a file')\n .argv\n;\n\nvar fs = require('fs');\nvar s = fs.createReadStream(argv.file);\n\nvar lines = 0;\ns.on('data', function (buf) {\n lines += buf.toString().match(/\\n/g).length;\n});\n\ns.on('end', function () {\n console.log(lines);\n});\n````\n\n***\n\n $ node line_count.js\n Count the lines in a file.\n Usage: node ./line_count.js\n\n Options:\n -f, --file Load a file [required]\n\n Missing required arguments: f\n\n $ node line_count.js --file line_count.js \n 20\n \n $ node line_count.js -f line_count.js \n 20\n\nmethods\n=======\n\nBy itself,\n\n````javascript\nrequire('optimist').argv\n`````\n\nwill use `process.argv` array to construct the `argv` object.\n\nYou can pass in the `process.argv` yourself:\n\n````javascript\nrequire('optimist')([ '-x', '1', '-y', '2' ]).argv\n````\n\nor use .parse() to do the same thing:\n\n````javascript\nrequire('optimist').parse([ '-x', '1', '-y', '2' ])\n````\n\nThe rest of these methods below come in just before the terminating `.argv`.\n\n.alias(key, alias)\n------------------\n\nSet key names as equivalent such that updates to a key will propagate to aliases\nand vice-versa.\n\nOptionally `.alias()` can take an object that maps keys to aliases.\n\n.default(key, value)\n--------------------\n\nSet `argv[key]` to `value` if no option was specified on `process.argv`.\n\nOptionally `.default()` can take an object that maps keys to default values.\n\n.demand(key)\n------------\n\nIf `key` is a string, show the usage information and exit if `key` wasn't\nspecified in `process.argv`.\n\nIf `key` is a number, demand at least as many non-option arguments, which show\nup in `argv._`.\n\nIf `key` is an Array, demand each element.\n\n.describe(key, desc)\n--------------------\n\nDescribe a `key` for the generated usage information.\n\nOptionally `.describe()` can take an object that maps keys to descriptions.\n\n.options(key, opt)\n------------------\n\nInstead of chaining together `.alias().demand().default()`, you can specify\nkeys in `opt` for each of the chainable methods.\n\nFor example:\n\n````javascript\nvar argv = require('optimist')\n .options('f', {\n alias : 'file',\n default : '/etc/passwd',\n })\n .argv\n;\n````\n\nis the same as\n\n````javascript\nvar argv = require('optimist')\n .alias('f', 'file')\n .default('f', '/etc/passwd')\n .argv\n;\n````\n\nOptionally `.options()` can take an object that maps keys to `opt` parameters.\n\n.usage(message)\n---------------\n\nSet a usage message to show which commands to use. Inside `message`, the string\n`$0` will get interpolated to the current script name or node command for the\npresent script similar to how `$0` works in bash or perl.\n\n.check(fn)\n----------\n\nCheck that certain conditions are met in the provided arguments.\n\nIf `fn` throws or returns `false`, show the thrown error, usage information, and\nexit.\n\n.boolean(key)\n-------------\n\nInterpret `key` as a boolean. If a non-flag option follows `key` in\n`process.argv`, that string won't get set as the value of `key`.\n\nIf `key` never shows up as a flag in `process.arguments`, `argv[key]` will be\n`false`.\n\nIf `key` is an Array, interpret all the elements as booleans.\n\n.string(key)\n------------\n\nTell the parser logic not to interpret `key` as a number or boolean.\nThis can be useful if you need to preserve leading zeros in an input.\n\nIf `key` is an Array, interpret all the elements as strings.\n\n.wrap(columns)\n--------------\n\nFormat usage output to wrap at `columns` many columns.\n\n.help()\n-------\n\nReturn the generated usage string.\n\n.showHelp(fn=console.error)\n---------------------------\n\nPrint the usage data using `fn` for printing.\n\n.parse(args)\n------------\n\nParse `args` instead of `process.argv`. Returns the `argv` object.\n\n.argv\n-----\n\nGet the arguments as a plain old object.\n\nArguments without a corresponding flag show up in the `argv._` array.\n\nThe script name or node command is available at `argv.$0` similarly to how `$0`\nworks in bash or perl.\n\nparsing tricks\n==============\n\nstop parsing\n------------\n\nUse `--` to stop parsing flags and stuff the remainder into `argv._`.\n\n $ node examples/reflect.js -a 1 -b 2 -- -c 3 -d 4\n { _: [ '-c', '3', '-d', '4' ],\n '$0': 'node ./examples/reflect.js',\n a: 1,\n b: 2 }\n\nnegate fields\n-------------\n\nIf you want to explicity set a field to false instead of just leaving it\nundefined or to override a default you can do `--no-key`.\n\n $ node examples/reflect.js -a --no-b\n { _: [],\n '$0': 'node ./examples/reflect.js',\n a: true,\n b: false }\n\nnumbers\n-------\n\nEvery argument that looks like a number (`!isNaN(Number(arg))`) is converted to\none. This way you can just `net.createConnection(argv.port)` and you can add\nnumbers out of `argv` with `+` without having that mean concatenation,\nwhich is super frustrating.\n\nduplicates\n----------\n\nIf you specify a flag multiple times it will get turned into an array containing\nall the values in order.\n\n $ node examples/reflect.js -x 5 -x 8 -x 0\n { _: [],\n '$0': 'node ./examples/reflect.js',\n x: [ 5, 8, 0 ] }\n\ndot notation\n------------\n\nWhen you use dots (`.`s) in argument names, an implicit object path is assumed.\nThis lets you organize arguments into nested objects.\n\n $ node examples/reflect.js --foo.bar.baz=33 --foo.quux=5\n { _: [],\n '$0': 'node ./examples/reflect.js',\n foo: { bar: { baz: 33 }, quux: 5 } }\n\ninstallation\n============\n\nWith [npm](http://github.com/isaacs/npm), just do:\n npm install optimist\n \nor clone this project on github:\n\n git clone http://github.com/substack/node-optimist.git\n\nTo run the tests with [expresso](http://github.com/visionmedia/expresso),\njust do:\n \n expresso\n\ninspired By\n===========\n\nThis module is loosely inspired by Perl's\n[Getopt::Casual](http://search.cpan.org/~photo/Getopt-Casual-0.13.1/Casual.pm).\n",
- "readmeFilename": "readme.markdown",
- "bugs": {
- "url": "https://github.com/substack/node-optimist/issues"
- },
- "homepage": "https://github.com/substack/node-optimist",
- "_id": "optimist@0.3.7",
- "_from": "optimist@~0.3.5"
-}
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/readme.markdown b/builder/node_modules/uglify-js/node_modules/optimist/readme.markdown
deleted file mode 100644
index ad9d3fd6..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/readme.markdown
+++ /dev/null
@@ -1,487 +0,0 @@
-optimist
-========
-
-Optimist is a node.js library for option parsing for people who hate option
-parsing. More specifically, this module is for people who like all the --bells
-and -whistlz of program usage but think optstrings are a waste of time.
-
-With optimist, option parsing doesn't have to suck (as much).
-
-[](http://travis-ci.org/substack/node-optimist)
-
-examples
-========
-
-With Optimist, the options are just a hash! No optstrings attached.
--------------------------------------------------------------------
-
-xup.js:
-
-````javascript
-#!/usr/bin/env node
-var argv = require('optimist').argv;
-
-if (argv.rif - 5 * argv.xup > 7.138) {
- console.log('Buy more riffiwobbles');
-}
-else {
- console.log('Sell the xupptumblers');
-}
-````
-
-***
-
- $ ./xup.js --rif=55 --xup=9.52
- Buy more riffiwobbles
-
- $ ./xup.js --rif 12 --xup 8.1
- Sell the xupptumblers
-
-
-
-But wait! There's more! You can do short options:
--------------------------------------------------
-
-short.js:
-
-````javascript
-#!/usr/bin/env node
-var argv = require('optimist').argv;
-console.log('(%d,%d)', argv.x, argv.y);
-````
-
-***
-
- $ ./short.js -x 10 -y 21
- (10,21)
-
-And booleans, both long and short (and grouped):
-----------------------------------
-
-bool.js:
-
-````javascript
-#!/usr/bin/env node
-var util = require('util');
-var argv = require('optimist').argv;
-
-if (argv.s) {
- util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: ');
-}
-console.log(
- (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '')
-);
-````
-
-***
-
- $ ./bool.js -s
- The cat says: meow
-
- $ ./bool.js -sp
- The cat says: meow.
-
- $ ./bool.js -sp --fr
- Le chat dit: miaou.
-
-And non-hypenated options too! Just use `argv._`!
--------------------------------------------------
-
-nonopt.js:
-
-````javascript
-#!/usr/bin/env node
-var argv = require('optimist').argv;
-console.log('(%d,%d)', argv.x, argv.y);
-console.log(argv._);
-````
-
-***
-
- $ ./nonopt.js -x 6.82 -y 3.35 moo
- (6.82,3.35)
- [ 'moo' ]
-
- $ ./nonopt.js foo -x 0.54 bar -y 1.12 baz
- (0.54,1.12)
- [ 'foo', 'bar', 'baz' ]
-
-Plus, Optimist comes with .usage() and .demand()!
--------------------------------------------------
-
-divide.js:
-
-````javascript
-#!/usr/bin/env node
-var argv = require('optimist')
- .usage('Usage: $0 -x [num] -y [num]')
- .demand(['x','y'])
- .argv;
-
-console.log(argv.x / argv.y);
-````
-
-***
-
- $ ./divide.js -x 55 -y 11
- 5
-
- $ node ./divide.js -x 4.91 -z 2.51
- Usage: node ./divide.js -x [num] -y [num]
-
- Options:
- -x [required]
- -y [required]
-
- Missing required arguments: y
-
-EVEN MORE HOLY COW
-------------------
-
-default_singles.js:
-
-````javascript
-#!/usr/bin/env node
-var argv = require('optimist')
- .default('x', 10)
- .default('y', 10)
- .argv
-;
-console.log(argv.x + argv.y);
-````
-
-***
-
- $ ./default_singles.js -x 5
- 15
-
-default_hash.js:
-
-````javascript
-#!/usr/bin/env node
-var argv = require('optimist')
- .default({ x : 10, y : 10 })
- .argv
-;
-console.log(argv.x + argv.y);
-````
-
-***
-
- $ ./default_hash.js -y 7
- 17
-
-And if you really want to get all descriptive about it...
----------------------------------------------------------
-
-boolean_single.js
-
-````javascript
-#!/usr/bin/env node
-var argv = require('optimist')
- .boolean('v')
- .argv
-;
-console.dir(argv);
-````
-
-***
-
- $ ./boolean_single.js -v foo bar baz
- true
- [ 'bar', 'baz', 'foo' ]
-
-boolean_double.js
-
-````javascript
-#!/usr/bin/env node
-var argv = require('optimist')
- .boolean(['x','y','z'])
- .argv
-;
-console.dir([ argv.x, argv.y, argv.z ]);
-console.dir(argv._);
-````
-
-***
-
- $ ./boolean_double.js -x -z one two three
- [ true, false, true ]
- [ 'one', 'two', 'three' ]
-
-Optimist is here to help...
----------------------------
-
-You can describe parameters for help messages and set aliases. Optimist figures
-out how to format a handy help string automatically.
-
-line_count.js
-
-````javascript
-#!/usr/bin/env node
-var argv = require('optimist')
- .usage('Count the lines in a file.\nUsage: $0')
- .demand('f')
- .alias('f', 'file')
- .describe('f', 'Load a file')
- .argv
-;
-
-var fs = require('fs');
-var s = fs.createReadStream(argv.file);
-
-var lines = 0;
-s.on('data', function (buf) {
- lines += buf.toString().match(/\n/g).length;
-});
-
-s.on('end', function () {
- console.log(lines);
-});
-````
-
-***
-
- $ node line_count.js
- Count the lines in a file.
- Usage: node ./line_count.js
-
- Options:
- -f, --file Load a file [required]
-
- Missing required arguments: f
-
- $ node line_count.js --file line_count.js
- 20
-
- $ node line_count.js -f line_count.js
- 20
-
-methods
-=======
-
-By itself,
-
-````javascript
-require('optimist').argv
-`````
-
-will use `process.argv` array to construct the `argv` object.
-
-You can pass in the `process.argv` yourself:
-
-````javascript
-require('optimist')([ '-x', '1', '-y', '2' ]).argv
-````
-
-or use .parse() to do the same thing:
-
-````javascript
-require('optimist').parse([ '-x', '1', '-y', '2' ])
-````
-
-The rest of these methods below come in just before the terminating `.argv`.
-
-.alias(key, alias)
-------------------
-
-Set key names as equivalent such that updates to a key will propagate to aliases
-and vice-versa.
-
-Optionally `.alias()` can take an object that maps keys to aliases.
-
-.default(key, value)
---------------------
-
-Set `argv[key]` to `value` if no option was specified on `process.argv`.
-
-Optionally `.default()` can take an object that maps keys to default values.
-
-.demand(key)
-------------
-
-If `key` is a string, show the usage information and exit if `key` wasn't
-specified in `process.argv`.
-
-If `key` is a number, demand at least as many non-option arguments, which show
-up in `argv._`.
-
-If `key` is an Array, demand each element.
-
-.describe(key, desc)
---------------------
-
-Describe a `key` for the generated usage information.
-
-Optionally `.describe()` can take an object that maps keys to descriptions.
-
-.options(key, opt)
-------------------
-
-Instead of chaining together `.alias().demand().default()`, you can specify
-keys in `opt` for each of the chainable methods.
-
-For example:
-
-````javascript
-var argv = require('optimist')
- .options('f', {
- alias : 'file',
- default : '/etc/passwd',
- })
- .argv
-;
-````
-
-is the same as
-
-````javascript
-var argv = require('optimist')
- .alias('f', 'file')
- .default('f', '/etc/passwd')
- .argv
-;
-````
-
-Optionally `.options()` can take an object that maps keys to `opt` parameters.
-
-.usage(message)
----------------
-
-Set a usage message to show which commands to use. Inside `message`, the string
-`$0` will get interpolated to the current script name or node command for the
-present script similar to how `$0` works in bash or perl.
-
-.check(fn)
-----------
-
-Check that certain conditions are met in the provided arguments.
-
-If `fn` throws or returns `false`, show the thrown error, usage information, and
-exit.
-
-.boolean(key)
--------------
-
-Interpret `key` as a boolean. If a non-flag option follows `key` in
-`process.argv`, that string won't get set as the value of `key`.
-
-If `key` never shows up as a flag in `process.arguments`, `argv[key]` will be
-`false`.
-
-If `key` is an Array, interpret all the elements as booleans.
-
-.string(key)
-------------
-
-Tell the parser logic not to interpret `key` as a number or boolean.
-This can be useful if you need to preserve leading zeros in an input.
-
-If `key` is an Array, interpret all the elements as strings.
-
-.wrap(columns)
---------------
-
-Format usage output to wrap at `columns` many columns.
-
-.help()
--------
-
-Return the generated usage string.
-
-.showHelp(fn=console.error)
----------------------------
-
-Print the usage data using `fn` for printing.
-
-.parse(args)
-------------
-
-Parse `args` instead of `process.argv`. Returns the `argv` object.
-
-.argv
------
-
-Get the arguments as a plain old object.
-
-Arguments without a corresponding flag show up in the `argv._` array.
-
-The script name or node command is available at `argv.$0` similarly to how `$0`
-works in bash or perl.
-
-parsing tricks
-==============
-
-stop parsing
-------------
-
-Use `--` to stop parsing flags and stuff the remainder into `argv._`.
-
- $ node examples/reflect.js -a 1 -b 2 -- -c 3 -d 4
- { _: [ '-c', '3', '-d', '4' ],
- '$0': 'node ./examples/reflect.js',
- a: 1,
- b: 2 }
-
-negate fields
--------------
-
-If you want to explicity set a field to false instead of just leaving it
-undefined or to override a default you can do `--no-key`.
-
- $ node examples/reflect.js -a --no-b
- { _: [],
- '$0': 'node ./examples/reflect.js',
- a: true,
- b: false }
-
-numbers
--------
-
-Every argument that looks like a number (`!isNaN(Number(arg))`) is converted to
-one. This way you can just `net.createConnection(argv.port)` and you can add
-numbers out of `argv` with `+` without having that mean concatenation,
-which is super frustrating.
-
-duplicates
-----------
-
-If you specify a flag multiple times it will get turned into an array containing
-all the values in order.
-
- $ node examples/reflect.js -x 5 -x 8 -x 0
- { _: [],
- '$0': 'node ./examples/reflect.js',
- x: [ 5, 8, 0 ] }
-
-dot notation
-------------
-
-When you use dots (`.`s) in argument names, an implicit object path is assumed.
-This lets you organize arguments into nested objects.
-
- $ node examples/reflect.js --foo.bar.baz=33 --foo.quux=5
- { _: [],
- '$0': 'node ./examples/reflect.js',
- foo: { bar: { baz: 33 }, quux: 5 } }
-
-installation
-============
-
-With [npm](http://github.com/isaacs/npm), just do:
- npm install optimist
-
-or clone this project on github:
-
- git clone http://github.com/substack/node-optimist.git
-
-To run the tests with [expresso](http://github.com/visionmedia/expresso),
-just do:
-
- expresso
-
-inspired By
-===========
-
-This module is loosely inspired by Perl's
-[Getopt::Casual](http://search.cpan.org/~photo/Getopt-Casual-0.13.1/Casual.pm).
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/test/_.js b/builder/node_modules/uglify-js/node_modules/optimist/test/_.js
deleted file mode 100644
index d9c58b36..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/test/_.js
+++ /dev/null
@@ -1,71 +0,0 @@
-var spawn = require('child_process').spawn;
-var test = require('tap').test;
-
-test('dotSlashEmpty', testCmd('./bin.js', []));
-
-test('dotSlashArgs', testCmd('./bin.js', [ 'a', 'b', 'c' ]));
-
-test('nodeEmpty', testCmd('node bin.js', []));
-
-test('nodeArgs', testCmd('node bin.js', [ 'x', 'y', 'z' ]));
-
-test('whichNodeEmpty', function (t) {
- var which = spawn('which', ['node']);
-
- which.stdout.on('data', function (buf) {
- t.test(
- testCmd(buf.toString().trim() + ' bin.js', [])
- );
- t.end();
- });
-
- which.stderr.on('data', function (err) {
- assert.error(err);
- t.end();
- });
-});
-
-test('whichNodeArgs', function (t) {
- var which = spawn('which', ['node']);
-
- which.stdout.on('data', function (buf) {
- t.test(
- testCmd(buf.toString().trim() + ' bin.js', [ 'q', 'r' ])
- );
- t.end();
- });
-
- which.stderr.on('data', function (err) {
- t.error(err);
- t.end();
- });
-});
-
-function testCmd (cmd, args) {
-
- return function (t) {
- var to = setTimeout(function () {
- assert.fail('Never got stdout data.')
- }, 5000);
-
- var oldDir = process.cwd();
- process.chdir(__dirname + '/_');
-
- var cmds = cmd.split(' ');
-
- var bin = spawn(cmds[0], cmds.slice(1).concat(args.map(String)));
- process.chdir(oldDir);
-
- bin.stderr.on('data', function (err) {
- t.error(err);
- t.end();
- });
-
- bin.stdout.on('data', function (buf) {
- clearTimeout(to);
- var _ = JSON.parse(buf.toString());
- t.same(_.map(String), args.map(String));
- t.end();
- });
- };
-}
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/test/_/argv.js b/builder/node_modules/uglify-js/node_modules/optimist/test/_/argv.js
deleted file mode 100644
index 3d096062..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/test/_/argv.js
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/usr/bin/env node
-console.log(JSON.stringify(process.argv));
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/test/_/bin.js b/builder/node_modules/uglify-js/node_modules/optimist/test/_/bin.js
deleted file mode 100644
index 4a18d85f..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/test/_/bin.js
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/env node
-var argv = require('../../index').argv
-console.log(JSON.stringify(argv._));
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/test/parse.js b/builder/node_modules/uglify-js/node_modules/optimist/test/parse.js
deleted file mode 100644
index d320f433..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/test/parse.js
+++ /dev/null
@@ -1,446 +0,0 @@
-var optimist = require('../index');
-var path = require('path');
-var test = require('tap').test;
-
-var $0 = 'node ./' + path.relative(process.cwd(), __filename);
-
-test('short boolean', function (t) {
- var parse = optimist.parse([ '-b' ]);
- t.same(parse, { b : true, _ : [], $0 : $0 });
- t.same(typeof parse.b, 'boolean');
- t.end();
-});
-
-test('long boolean', function (t) {
- t.same(
- optimist.parse([ '--bool' ]),
- { bool : true, _ : [], $0 : $0 }
- );
- t.end();
-});
-
-test('bare', function (t) {
- t.same(
- optimist.parse([ 'foo', 'bar', 'baz' ]),
- { _ : [ 'foo', 'bar', 'baz' ], $0 : $0 }
- );
- t.end();
-});
-
-test('short group', function (t) {
- t.same(
- optimist.parse([ '-cats' ]),
- { c : true, a : true, t : true, s : true, _ : [], $0 : $0 }
- );
- t.end();
-});
-
-test('short group next', function (t) {
- t.same(
- optimist.parse([ '-cats', 'meow' ]),
- { c : true, a : true, t : true, s : 'meow', _ : [], $0 : $0 }
- );
- t.end();
-});
-
-test('short capture', function (t) {
- t.same(
- optimist.parse([ '-h', 'localhost' ]),
- { h : 'localhost', _ : [], $0 : $0 }
- );
- t.end();
-});
-
-test('short captures', function (t) {
- t.same(
- optimist.parse([ '-h', 'localhost', '-p', '555' ]),
- { h : 'localhost', p : 555, _ : [], $0 : $0 }
- );
- t.end();
-});
-
-test('long capture sp', function (t) {
- t.same(
- optimist.parse([ '--pow', 'xixxle' ]),
- { pow : 'xixxle', _ : [], $0 : $0 }
- );
- t.end();
-});
-
-test('long capture eq', function (t) {
- t.same(
- optimist.parse([ '--pow=xixxle' ]),
- { pow : 'xixxle', _ : [], $0 : $0 }
- );
- t.end()
-});
-
-test('long captures sp', function (t) {
- t.same(
- optimist.parse([ '--host', 'localhost', '--port', '555' ]),
- { host : 'localhost', port : 555, _ : [], $0 : $0 }
- );
- t.end();
-});
-
-test('long captures eq', function (t) {
- t.same(
- optimist.parse([ '--host=localhost', '--port=555' ]),
- { host : 'localhost', port : 555, _ : [], $0 : $0 }
- );
- t.end();
-});
-
-test('mixed short bool and capture', function (t) {
- t.same(
- optimist.parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]),
- {
- f : true, p : 555, h : 'localhost',
- _ : [ 'script.js' ], $0 : $0,
- }
- );
- t.end();
-});
-
-test('short and long', function (t) {
- t.same(
- optimist.parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]),
- {
- f : true, p : 555, h : 'localhost',
- _ : [ 'script.js' ], $0 : $0,
- }
- );
- t.end();
-});
-
-test('no', function (t) {
- t.same(
- optimist.parse([ '--no-moo' ]),
- { moo : false, _ : [], $0 : $0 }
- );
- t.end();
-});
-
-test('multi', function (t) {
- t.same(
- optimist.parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]),
- { v : ['a','b','c'], _ : [], $0 : $0 }
- );
- t.end();
-});
-
-test('comprehensive', function (t) {
- t.same(
- optimist.parse([
- '--name=meowmers', 'bare', '-cats', 'woo',
- '-h', 'awesome', '--multi=quux',
- '--key', 'value',
- '-b', '--bool', '--no-meep', '--multi=baz',
- '--', '--not-a-flag', 'eek'
- ]),
- {
- c : true,
- a : true,
- t : true,
- s : 'woo',
- h : 'awesome',
- b : true,
- bool : true,
- key : 'value',
- multi : [ 'quux', 'baz' ],
- meep : false,
- name : 'meowmers',
- _ : [ 'bare', '--not-a-flag', 'eek' ],
- $0 : $0
- }
- );
- t.end();
-});
-
-test('nums', function (t) {
- var argv = optimist.parse([
- '-x', '1234',
- '-y', '5.67',
- '-z', '1e7',
- '-w', '10f',
- '--hex', '0xdeadbeef',
- '789',
- ]);
- t.same(argv, {
- x : 1234,
- y : 5.67,
- z : 1e7,
- w : '10f',
- hex : 0xdeadbeef,
- _ : [ 789 ],
- $0 : $0
- });
- t.same(typeof argv.x, 'number');
- t.same(typeof argv.y, 'number');
- t.same(typeof argv.z, 'number');
- t.same(typeof argv.w, 'string');
- t.same(typeof argv.hex, 'number');
- t.same(typeof argv._[0], 'number');
- t.end();
-});
-
-test('flag boolean', function (t) {
- var parse = optimist([ '-t', 'moo' ]).boolean(['t']).argv;
- t.same(parse, { t : true, _ : [ 'moo' ], $0 : $0 });
- t.same(typeof parse.t, 'boolean');
- t.end();
-});
-
-test('flag boolean value', function (t) {
- var parse = optimist(['--verbose', 'false', 'moo', '-t', 'true'])
- .boolean(['t', 'verbose']).default('verbose', true).argv;
-
- t.same(parse, {
- verbose: false,
- t: true,
- _: ['moo'],
- $0 : $0
- });
-
- t.same(typeof parse.verbose, 'boolean');
- t.same(typeof parse.t, 'boolean');
- t.end();
-});
-
-test('flag boolean default false', function (t) {
- var parse = optimist(['moo'])
- .boolean(['t', 'verbose'])
- .default('verbose', false)
- .default('t', false).argv;
-
- t.same(parse, {
- verbose: false,
- t: false,
- _: ['moo'],
- $0 : $0
- });
-
- t.same(typeof parse.verbose, 'boolean');
- t.same(typeof parse.t, 'boolean');
- t.end();
-
-});
-
-test('boolean groups', function (t) {
- var parse = optimist([ '-x', '-z', 'one', 'two', 'three' ])
- .boolean(['x','y','z']).argv;
-
- t.same(parse, {
- x : true,
- y : false,
- z : true,
- _ : [ 'one', 'two', 'three' ],
- $0 : $0
- });
-
- t.same(typeof parse.x, 'boolean');
- t.same(typeof parse.y, 'boolean');
- t.same(typeof parse.z, 'boolean');
- t.end();
-});
-
-test('newlines in params' , function (t) {
- var args = optimist.parse([ '-s', "X\nX" ])
- t.same(args, { _ : [], s : "X\nX", $0 : $0 });
-
- // reproduce in bash:
- // VALUE="new
- // line"
- // node program.js --s="$VALUE"
- args = optimist.parse([ "--s=X\nX" ])
- t.same(args, { _ : [], s : "X\nX", $0 : $0 });
- t.end();
-});
-
-test('strings' , function (t) {
- var s = optimist([ '-s', '0001234' ]).string('s').argv.s;
- t.same(s, '0001234');
- t.same(typeof s, 'string');
-
- var x = optimist([ '-x', '56' ]).string('x').argv.x;
- t.same(x, '56');
- t.same(typeof x, 'string');
- t.end();
-});
-
-test('stringArgs', function (t) {
- var s = optimist([ ' ', ' ' ]).string('_').argv._;
- t.same(s.length, 2);
- t.same(typeof s[0], 'string');
- t.same(s[0], ' ');
- t.same(typeof s[1], 'string');
- t.same(s[1], ' ');
- t.end();
-});
-
-test('slashBreak', function (t) {
- t.same(
- optimist.parse([ '-I/foo/bar/baz' ]),
- { I : '/foo/bar/baz', _ : [], $0 : $0 }
- );
- t.same(
- optimist.parse([ '-xyz/foo/bar/baz' ]),
- { x : true, y : true, z : '/foo/bar/baz', _ : [], $0 : $0 }
- );
- t.end();
-});
-
-test('alias', function (t) {
- var argv = optimist([ '-f', '11', '--zoom', '55' ])
- .alias('z', 'zoom')
- .argv
- ;
- t.equal(argv.zoom, 55);
- t.equal(argv.z, argv.zoom);
- t.equal(argv.f, 11);
- t.end();
-});
-
-test('multiAlias', function (t) {
- var argv = optimist([ '-f', '11', '--zoom', '55' ])
- .alias('z', [ 'zm', 'zoom' ])
- .argv
- ;
- t.equal(argv.zoom, 55);
- t.equal(argv.z, argv.zoom);
- t.equal(argv.z, argv.zm);
- t.equal(argv.f, 11);
- t.end();
-});
-
-test('boolean default true', function (t) {
- var argv = optimist.options({
- sometrue: {
- boolean: true,
- default: true
- }
- }).argv;
-
- t.equal(argv.sometrue, true);
- t.end();
-});
-
-test('boolean default false', function (t) {
- var argv = optimist.options({
- somefalse: {
- boolean: true,
- default: false
- }
- }).argv;
-
- t.equal(argv.somefalse, false);
- t.end();
-});
-
-test('nested dotted objects', function (t) {
- var argv = optimist([
- '--foo.bar', '3', '--foo.baz', '4',
- '--foo.quux.quibble', '5', '--foo.quux.o_O',
- '--beep.boop'
- ]).argv;
-
- t.same(argv.foo, {
- bar : 3,
- baz : 4,
- quux : {
- quibble : 5,
- o_O : true
- },
- });
- t.same(argv.beep, { boop : true });
- t.end();
-});
-
-test('boolean and alias with chainable api', function (t) {
- var aliased = [ '-h', 'derp' ];
- var regular = [ '--herp', 'derp' ];
- var opts = {
- herp: { alias: 'h', boolean: true }
- };
- var aliasedArgv = optimist(aliased)
- .boolean('herp')
- .alias('h', 'herp')
- .argv;
- var propertyArgv = optimist(regular)
- .boolean('herp')
- .alias('h', 'herp')
- .argv;
- var expected = {
- herp: true,
- h: true,
- '_': [ 'derp' ],
- '$0': $0,
- };
-
- t.same(aliasedArgv, expected);
- t.same(propertyArgv, expected);
- t.end();
-});
-
-test('boolean and alias with options hash', function (t) {
- var aliased = [ '-h', 'derp' ];
- var regular = [ '--herp', 'derp' ];
- var opts = {
- herp: { alias: 'h', boolean: true }
- };
- var aliasedArgv = optimist(aliased)
- .options(opts)
- .argv;
- var propertyArgv = optimist(regular).options(opts).argv;
- var expected = {
- herp: true,
- h: true,
- '_': [ 'derp' ],
- '$0': $0,
- };
-
- t.same(aliasedArgv, expected);
- t.same(propertyArgv, expected);
-
- t.end();
-});
-
-test('boolean and alias using explicit true', function (t) {
- var aliased = [ '-h', 'true' ];
- var regular = [ '--herp', 'true' ];
- var opts = {
- herp: { alias: 'h', boolean: true }
- };
- var aliasedArgv = optimist(aliased)
- .boolean('h')
- .alias('h', 'herp')
- .argv;
- var propertyArgv = optimist(regular)
- .boolean('h')
- .alias('h', 'herp')
- .argv;
- var expected = {
- herp: true,
- h: true,
- '_': [ ],
- '$0': $0,
- };
-
- t.same(aliasedArgv, expected);
- t.same(propertyArgv, expected);
- t.end();
-});
-
-// regression, see https://github.com/substack/node-optimist/issues/71
-test('boolean and --x=true', function(t) {
- var parsed = optimist(['--boool', '--other=true']).boolean('boool').argv;
-
- t.same(parsed.boool, true);
- t.same(parsed.other, 'true');
-
- parsed = optimist(['--boool', '--other=false']).boolean('boool').argv;
-
- t.same(parsed.boool, true);
- t.same(parsed.other, 'false');
- t.end();
-});
diff --git a/builder/node_modules/uglify-js/node_modules/optimist/test/usage.js b/builder/node_modules/uglify-js/node_modules/optimist/test/usage.js
deleted file mode 100644
index 300454c1..00000000
--- a/builder/node_modules/uglify-js/node_modules/optimist/test/usage.js
+++ /dev/null
@@ -1,292 +0,0 @@
-var Hash = require('hashish');
-var optimist = require('../index');
-var test = require('tap').test;
-
-test('usageFail', function (t) {
- var r = checkUsage(function () {
- return optimist('-x 10 -z 20'.split(' '))
- .usage('Usage: $0 -x NUM -y NUM')
- .demand(['x','y'])
- .argv;
- });
- t.same(
- r.result,
- { x : 10, z : 20, _ : [], $0 : './usage' }
- );
-
- t.same(
- r.errors.join('\n').split(/\n+/),
- [
- 'Usage: ./usage -x NUM -y NUM',
- 'Options:',
- ' -x [required]',
- ' -y [required]',
- 'Missing required arguments: y',
- ]
- );
- t.same(r.logs, []);
- t.ok(r.exit);
- t.end();
-});
-
-
-test('usagePass', function (t) {
- var r = checkUsage(function () {
- return optimist('-x 10 -y 20'.split(' '))
- .usage('Usage: $0 -x NUM -y NUM')
- .demand(['x','y'])
- .argv;
- });
- t.same(r, {
- result : { x : 10, y : 20, _ : [], $0 : './usage' },
- errors : [],
- logs : [],
- exit : false,
- });
- t.end();
-});
-
-test('checkPass', function (t) {
- var r = checkUsage(function () {
- return optimist('-x 10 -y 20'.split(' '))
- .usage('Usage: $0 -x NUM -y NUM')
- .check(function (argv) {
- if (!('x' in argv)) throw 'You forgot about -x';
- if (!('y' in argv)) throw 'You forgot about -y';
- })
- .argv;
- });
- t.same(r, {
- result : { x : 10, y : 20, _ : [], $0 : './usage' },
- errors : [],
- logs : [],
- exit : false,
- });
- t.end();
-});
-
-test('checkFail', function (t) {
- var r = checkUsage(function () {
- return optimist('-x 10 -z 20'.split(' '))
- .usage('Usage: $0 -x NUM -y NUM')
- .check(function (argv) {
- if (!('x' in argv)) throw 'You forgot about -x';
- if (!('y' in argv)) throw 'You forgot about -y';
- })
- .argv;
- });
-
- t.same(
- r.result,
- { x : 10, z : 20, _ : [], $0 : './usage' }
- );
-
- t.same(
- r.errors.join('\n').split(/\n+/),
- [
- 'Usage: ./usage -x NUM -y NUM',
- 'You forgot about -y'
- ]
- );
-
- t.same(r.logs, []);
- t.ok(r.exit);
- t.end();
-});
-
-test('checkCondPass', function (t) {
- function checker (argv) {
- return 'x' in argv && 'y' in argv;
- }
-
- var r = checkUsage(function () {
- return optimist('-x 10 -y 20'.split(' '))
- .usage('Usage: $0 -x NUM -y NUM')
- .check(checker)
- .argv;
- });
- t.same(r, {
- result : { x : 10, y : 20, _ : [], $0 : './usage' },
- errors : [],
- logs : [],
- exit : false,
- });
- t.end();
-});
-
-test('checkCondFail', function (t) {
- function checker (argv) {
- return 'x' in argv && 'y' in argv;
- }
-
- var r = checkUsage(function () {
- return optimist('-x 10 -z 20'.split(' '))
- .usage('Usage: $0 -x NUM -y NUM')
- .check(checker)
- .argv;
- });
-
- t.same(
- r.result,
- { x : 10, z : 20, _ : [], $0 : './usage' }
- );
-
- t.same(
- r.errors.join('\n').split(/\n+/).join('\n'),
- 'Usage: ./usage -x NUM -y NUM\n'
- + 'Argument check failed: ' + checker.toString()
- );
-
- t.same(r.logs, []);
- t.ok(r.exit);
- t.end();
-});
-
-test('countPass', function (t) {
- var r = checkUsage(function () {
- return optimist('1 2 3 --moo'.split(' '))
- .usage('Usage: $0 [x] [y] [z] {OPTIONS}')
- .demand(3)
- .argv;
- });
- t.same(r, {
- result : { _ : [ '1', '2', '3' ], moo : true, $0 : './usage' },
- errors : [],
- logs : [],
- exit : false,
- });
- t.end();
-});
-
-test('countFail', function (t) {
- var r = checkUsage(function () {
- return optimist('1 2 --moo'.split(' '))
- .usage('Usage: $0 [x] [y] [z] {OPTIONS}')
- .demand(3)
- .argv;
- });
- t.same(
- r.result,
- { _ : [ '1', '2' ], moo : true, $0 : './usage' }
- );
-
- t.same(
- r.errors.join('\n').split(/\n+/),
- [
- 'Usage: ./usage [x] [y] [z] {OPTIONS}',
- 'Not enough non-option arguments: got 2, need at least 3',
- ]
- );
-
- t.same(r.logs, []);
- t.ok(r.exit);
- t.end();
-});
-
-test('defaultSingles', function (t) {
- var r = checkUsage(function () {
- return optimist('--foo 50 --baz 70 --powsy'.split(' '))
- .default('foo', 5)
- .default('bar', 6)
- .default('baz', 7)
- .argv
- ;
- });
- t.same(r.result, {
- foo : '50',
- bar : 6,
- baz : '70',
- powsy : true,
- _ : [],
- $0 : './usage',
- });
- t.end();
-});
-
-test('defaultAliases', function (t) {
- var r = checkUsage(function () {
- return optimist('')
- .alias('f', 'foo')
- .default('f', 5)
- .argv
- ;
- });
- t.same(r.result, {
- f : '5',
- foo : '5',
- _ : [],
- $0 : './usage',
- });
- t.end();
-});
-
-test('defaultHash', function (t) {
- var r = checkUsage(function () {
- return optimist('--foo 50 --baz 70'.split(' '))
- .default({ foo : 10, bar : 20, quux : 30 })
- .argv
- ;
- });
- t.same(r.result, {
- _ : [],
- $0 : './usage',
- foo : 50,
- baz : 70,
- bar : 20,
- quux : 30,
- });
- t.end();
-});
-
-test('rebase', function (t) {
- t.equal(
- optimist.rebase('/home/substack', '/home/substack/foo/bar/baz'),
- './foo/bar/baz'
- );
- t.equal(
- optimist.rebase('/home/substack/foo/bar/baz', '/home/substack'),
- '../../..'
- );
- t.equal(
- optimist.rebase('/home/substack/foo', '/home/substack/pow/zoom.txt'),
- '../pow/zoom.txt'
- );
- t.end();
-});
-
-function checkUsage (f) {
-
- var exit = false;
-
- process._exit = process.exit;
- process._env = process.env;
- process._argv = process.argv;
-
- process.exit = function (t) { exit = true };
- process.env = Hash.merge(process.env, { _ : 'node' });
- process.argv = [ './usage' ];
-
- var errors = [];
- var logs = [];
-
- console._error = console.error;
- console.error = function (msg) { errors.push(msg) };
- console._log = console.log;
- console.log = function (msg) { logs.push(msg) };
-
- var result = f();
-
- process.exit = process._exit;
- process.env = process._env;
- process.argv = process._argv;
-
- console.error = console._error;
- console.log = console._log;
-
- return {
- errors : errors,
- logs : logs,
- exit : exit,
- result : result,
- };
-};
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/.npmignore b/builder/node_modules/uglify-js/node_modules/source-map/.npmignore
deleted file mode 100644
index 3dddf3f6..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/.npmignore
+++ /dev/null
@@ -1,2 +0,0 @@
-dist/*
-node_modules/*
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/.travis.yml b/builder/node_modules/uglify-js/node_modules/source-map/.travis.yml
deleted file mode 100644
index ddc9c4f9..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/.travis.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-language: node_js
-node_js:
- - 0.8
- - "0.10"
\ No newline at end of file
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/CHANGELOG.md b/builder/node_modules/uglify-js/node_modules/source-map/CHANGELOG.md
deleted file mode 100644
index a0e1b9c4..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/CHANGELOG.md
+++ /dev/null
@@ -1,130 +0,0 @@
-# Change Log
-
-## 0.1.33
-
-* Fix some edge cases surrounding path joining and URL resolution.
-
-* Add a third parameter for relative path to
- `SourceMapGenerator.prototype.applySourceMap`.
-
-* Fix issues with mappings and EOLs.
-
-## 0.1.32
-
-* Fixed a bug where SourceMapConsumer couldn't handle negative relative columns
- (issue 92).
-
-* Fixed test runner to actually report number of failed tests as its process
- exit code.
-
-* Fixed a typo when reporting bad mappings (issue 87).
-
-## 0.1.31
-
-* Delay parsing the mappings in SourceMapConsumer until queried for a source
- location.
-
-* Support Sass source maps (which at the time of writing deviate from the spec
- in small ways) in SourceMapConsumer.
-
-## 0.1.30
-
-* Do not join source root with a source, when the source is a data URI.
-
-* Extend the test runner to allow running single specific test files at a time.
-
-* Performance improvements in `SourceNode.prototype.walk` and
- `SourceMapConsumer.prototype.eachMapping`.
-
-* Source map browser builds will now work inside Workers.
-
-* Better error messages when attempting to add an invalid mapping to a
- `SourceMapGenerator`.
-
-## 0.1.29
-
-* Allow duplicate entries in the `names` and `sources` arrays of source maps
- (usually from TypeScript) we are parsing. Fixes github isse 72.
-
-## 0.1.28
-
-* Skip duplicate mappings when creating source maps from SourceNode; github
- issue 75.
-
-## 0.1.27
-
-* Don't throw an error when the `file` property is missing in SourceMapConsumer,
- we don't use it anyway.
-
-## 0.1.26
-
-* Fix SourceNode.fromStringWithSourceMap for empty maps. Fixes github issue 70.
-
-## 0.1.25
-
-* Make compatible with browserify
-
-## 0.1.24
-
-* Fix issue with absolute paths and `file://` URIs. See
- https://bugzilla.mozilla.org/show_bug.cgi?id=885597
-
-## 0.1.23
-
-* Fix issue with absolute paths and sourcesContent, github issue 64.
-
-## 0.1.22
-
-* Ignore duplicate mappings in SourceMapGenerator. Fixes github issue 21.
-
-## 0.1.21
-
-* Fixed handling of sources that start with a slash so that they are relative to
- the source root's host.
-
-## 0.1.20
-
-* Fixed github issue #43: absolute URLs aren't joined with the source root
- anymore.
-
-## 0.1.19
-
-* Using Travis CI to run tests.
-
-## 0.1.18
-
-* Fixed a bug in the handling of sourceRoot.
-
-## 0.1.17
-
-* Added SourceNode.fromStringWithSourceMap.
-
-## 0.1.16
-
-* Added missing documentation.
-
-* Fixed the generating of empty mappings in SourceNode.
-
-## 0.1.15
-
-* Added SourceMapGenerator.applySourceMap.
-
-## 0.1.14
-
-* The sourceRoot is now handled consistently.
-
-## 0.1.13
-
-* Added SourceMapGenerator.fromSourceMap.
-
-## 0.1.12
-
-* SourceNode now generates empty mappings too.
-
-## 0.1.11
-
-* Added name support to SourceNode.
-
-## 0.1.10
-
-* Added sourcesContent support to the customer and generator.
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/LICENSE b/builder/node_modules/uglify-js/node_modules/source-map/LICENSE
deleted file mode 100644
index ed1b7cf2..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/LICENSE
+++ /dev/null
@@ -1,28 +0,0 @@
-
-Copyright (c) 2009-2011, Mozilla Foundation and contributors
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
-* Neither the names of the Mozilla Foundation nor the names of project
- contributors may be used to endorse or promote products derived from this
- software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/Makefile.dryice.js b/builder/node_modules/uglify-js/node_modules/source-map/Makefile.dryice.js
deleted file mode 100644
index d6fc26a7..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/Makefile.dryice.js
+++ /dev/null
@@ -1,166 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-var path = require('path');
-var fs = require('fs');
-var copy = require('dryice').copy;
-
-function removeAmdefine(src) {
- src = String(src).replace(
- /if\s*\(typeof\s*define\s*!==\s*'function'\)\s*{\s*var\s*define\s*=\s*require\('amdefine'\)\(module,\s*require\);\s*}\s*/g,
- '');
- src = src.replace(
- /\b(define\(.*)('amdefine',?)/gm,
- '$1');
- return src;
-}
-removeAmdefine.onRead = true;
-
-function makeNonRelative(src) {
- return src
- .replace(/require\('.\//g, 'require(\'source-map/')
- .replace(/\.\.\/\.\.\/lib\//g, '');
-}
-makeNonRelative.onRead = true;
-
-function buildBrowser() {
- console.log('\nCreating dist/source-map.js');
-
- var project = copy.createCommonJsProject({
- roots: [ path.join(__dirname, 'lib') ]
- });
-
- copy({
- source: [
- 'build/mini-require.js',
- {
- project: project,
- require: [ 'source-map/source-map-generator',
- 'source-map/source-map-consumer',
- 'source-map/source-node']
- },
- 'build/suffix-browser.js'
- ],
- filter: [
- copy.filter.moduleDefines,
- removeAmdefine
- ],
- dest: 'dist/source-map.js'
- });
-}
-
-function buildBrowserMin() {
- console.log('\nCreating dist/source-map.min.js');
-
- copy({
- source: 'dist/source-map.js',
- filter: copy.filter.uglifyjs,
- dest: 'dist/source-map.min.js'
- });
-}
-
-function buildFirefox() {
- console.log('\nCreating dist/SourceMap.jsm');
-
- var project = copy.createCommonJsProject({
- roots: [ path.join(__dirname, 'lib') ]
- });
-
- copy({
- source: [
- 'build/prefix-source-map.jsm',
- {
- project: project,
- require: [ 'source-map/source-map-consumer',
- 'source-map/source-map-generator',
- 'source-map/source-node' ]
- },
- 'build/suffix-source-map.jsm'
- ],
- filter: [
- copy.filter.moduleDefines,
- removeAmdefine,
- makeNonRelative
- ],
- dest: 'dist/SourceMap.jsm'
- });
-
- // Create dist/test/Utils.jsm
- console.log('\nCreating dist/test/Utils.jsm');
-
- project = copy.createCommonJsProject({
- roots: [ __dirname, path.join(__dirname, 'lib') ]
- });
-
- copy({
- source: [
- 'build/prefix-utils.jsm',
- 'build/assert-shim.js',
- {
- project: project,
- require: [ 'test/source-map/util' ]
- },
- 'build/suffix-utils.jsm'
- ],
- filter: [
- copy.filter.moduleDefines,
- removeAmdefine,
- makeNonRelative
- ],
- dest: 'dist/test/Utils.jsm'
- });
-
- function isTestFile(f) {
- return /^test\-.*?\.js/.test(f);
- }
-
- var testFiles = fs.readdirSync(path.join(__dirname, 'test', 'source-map')).filter(isTestFile);
-
- testFiles.forEach(function (testFile) {
- console.log('\nCreating', path.join('dist', 'test', testFile.replace(/\-/g, '_')));
-
- copy({
- source: [
- 'build/test-prefix.js',
- path.join('test', 'source-map', testFile),
- 'build/test-suffix.js'
- ],
- filter: [
- removeAmdefine,
- makeNonRelative,
- function (input, source) {
- return input.replace('define(',
- 'define("'
- + path.join('test', 'source-map', testFile.replace(/\.js$/, ''))
- + '", ["require", "exports", "module"], ');
- },
- function (input, source) {
- return input.replace('{THIS_MODULE}', function () {
- return "test/source-map/" + testFile.replace(/\.js$/, '');
- });
- }
- ],
- dest: path.join('dist', 'test', testFile.replace(/\-/g, '_'))
- });
- });
-}
-
-function ensureDir(name) {
- var dirExists = false;
- try {
- dirExists = fs.statSync(name).isDirectory();
- } catch (err) {}
-
- if (!dirExists) {
- fs.mkdirSync(name, 0777);
- }
-}
-
-ensureDir("dist");
-ensureDir("dist/test");
-buildFirefox();
-buildBrowser();
-buildBrowserMin();
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/README.md b/builder/node_modules/uglify-js/node_modules/source-map/README.md
deleted file mode 100644
index b00e970c..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/README.md
+++ /dev/null
@@ -1,446 +0,0 @@
-# Source Map
-
-This is a library to generate and consume the source map format
-[described here][format].
-
-This library is written in the Asynchronous Module Definition format, and works
-in the following environments:
-
-* Modern Browsers supporting ECMAScript 5 (either after the build, or with an
- AMD loader such as RequireJS)
-
-* Inside Firefox (as a JSM file, after the build)
-
-* With NodeJS versions 0.8.X and higher
-
-## Node
-
- $ npm install source-map
-
-## Building from Source (for everywhere else)
-
-Install Node and then run
-
- $ git clone https://fitzgen@github.com/mozilla/source-map.git
- $ cd source-map
- $ npm link .
-
-Next, run
-
- $ node Makefile.dryice.js
-
-This should spew a bunch of stuff to stdout, and create the following files:
-
-* `dist/source-map.js` - The unminified browser version.
-
-* `dist/source-map.min.js` - The minified browser version.
-
-* `dist/SourceMap.jsm` - The JavaScript Module for inclusion in Firefox source.
-
-## Examples
-
-### Consuming a source map
-
- var rawSourceMap = {
- version: 3,
- file: 'min.js',
- names: ['bar', 'baz', 'n'],
- sources: ['one.js', 'two.js'],
- sourceRoot: 'http://example.com/www/js/',
- mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'
- };
-
- var smc = new SourceMapConsumer(rawSourceMap);
-
- console.log(smc.sources);
- // [ 'http://example.com/www/js/one.js',
- // 'http://example.com/www/js/two.js' ]
-
- console.log(smc.originalPositionFor({
- line: 2,
- column: 28
- }));
- // { source: 'http://example.com/www/js/two.js',
- // line: 2,
- // column: 10,
- // name: 'n' }
-
- console.log(smc.generatedPositionFor({
- source: 'http://example.com/www/js/two.js',
- line: 2,
- column: 10
- }));
- // { line: 2, column: 28 }
-
- smc.eachMapping(function (m) {
- // ...
- });
-
-### Generating a source map
-
-In depth guide:
-[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/)
-
-#### With SourceNode (high level API)
-
- function compile(ast) {
- switch (ast.type) {
- case 'BinaryExpression':
- return new SourceNode(
- ast.location.line,
- ast.location.column,
- ast.location.source,
- [compile(ast.left), " + ", compile(ast.right)]
- );
- case 'Literal':
- return new SourceNode(
- ast.location.line,
- ast.location.column,
- ast.location.source,
- String(ast.value)
- );
- // ...
- default:
- throw new Error("Bad AST");
- }
- }
-
- var ast = parse("40 + 2", "add.js");
- console.log(compile(ast).toStringWithSourceMap({
- file: 'add.js'
- }));
- // { code: '40 + 2',
- // map: [object SourceMapGenerator] }
-
-#### With SourceMapGenerator (low level API)
-
- var map = new SourceMapGenerator({
- file: "source-mapped.js"
- });
-
- map.addMapping({
- generated: {
- line: 10,
- column: 35
- },
- source: "foo.js",
- original: {
- line: 33,
- column: 2
- },
- name: "christopher"
- });
-
- console.log(map.toString());
- // '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}'
-
-## API
-
-Get a reference to the module:
-
- // NodeJS
- var sourceMap = require('source-map');
-
- // Browser builds
- var sourceMap = window.sourceMap;
-
- // Inside Firefox
- let sourceMap = {};
- Components.utils.import('resource:///modules/devtools/SourceMap.jsm', sourceMap);
-
-### SourceMapConsumer
-
-A SourceMapConsumer instance represents a parsed source map which we can query
-for information about the original file positions by giving it a file position
-in the generated source.
-
-#### new SourceMapConsumer(rawSourceMap)
-
-The only parameter is the raw source map (either as a string which can be
-`JSON.parse`'d, or an object). According to the spec, source maps have the
-following attributes:
-
-* `version`: Which version of the source map spec this map is following.
-
-* `sources`: An array of URLs to the original source files.
-
-* `names`: An array of identifiers which can be referrenced by individual
- mappings.
-
-* `sourceRoot`: Optional. The URL root from which all sources are relative.
-
-* `sourcesContent`: Optional. An array of contents of the original source files.
-
-* `mappings`: A string of base64 VLQs which contain the actual mappings.
-
-* `file`: Optional. The generated filename this source map is associated with.
-
-#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition)
-
-Returns the original source, line, and column information for the generated
-source's line and column positions provided. The only argument is an object with
-the following properties:
-
-* `line`: The line number in the generated source.
-
-* `column`: The column number in the generated source.
-
-and an object is returned with the following properties:
-
-* `source`: The original source file, or null if this information is not
- available.
-
-* `line`: The line number in the original source, or null if this information is
- not available.
-
-* `column`: The column number in the original source, or null or null if this
- information is not available.
-
-* `name`: The original identifier, or null if this information is not available.
-
-#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition)
-
-Returns the generated line and column information for the original source,
-line, and column positions provided. The only argument is an object with
-the following properties:
-
-* `source`: The filename of the original source.
-
-* `line`: The line number in the original source.
-
-* `column`: The column number in the original source.
-
-and an object is returned with the following properties:
-
-* `line`: The line number in the generated source, or null.
-
-* `column`: The column number in the generated source, or null.
-
-#### SourceMapConsumer.prototype.sourceContentFor(source)
-
-Returns the original source content for the source provided. The only
-argument is the URL of the original source file.
-
-#### SourceMapConsumer.prototype.eachMapping(callback, context, order)
-
-Iterate over each mapping between an original source/line/column and a
-generated line/column in this source map.
-
-* `callback`: The function that is called with each mapping. Mappings have the
- form `{ source, generatedLine, generatedColumn, originalLine, originalColumn,
- name }`
-
-* `context`: Optional. If specified, this object will be the value of `this`
- every time that `callback` is called.
-
-* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or
- `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over
- the mappings sorted by the generated file's line/column order or the
- original's source/line/column order, respectively. Defaults to
- `SourceMapConsumer.GENERATED_ORDER`.
-
-### SourceMapGenerator
-
-An instance of the SourceMapGenerator represents a source map which is being
-built incrementally.
-
-#### new SourceMapGenerator([startOfSourceMap])
-
-You may pass an object with the following properties:
-
-* `file`: The filename of the generated source that this source map is
- associated with.
-
-* `sourceRoot`: A root for all relative URLs in this source map.
-
-#### SourceMapGenerator.fromSourceMap(sourceMapConsumer)
-
-Creates a new SourceMapGenerator based on a SourceMapConsumer
-
-* `sourceMapConsumer` The SourceMap.
-
-#### SourceMapGenerator.prototype.addMapping(mapping)
-
-Add a single mapping from original source line and column to the generated
-source's line and column for this source map being created. The mapping object
-should have the following properties:
-
-* `generated`: An object with the generated line and column positions.
-
-* `original`: An object with the original line and column positions.
-
-* `source`: The original source file (relative to the sourceRoot).
-
-* `name`: An optional original token name for this mapping.
-
-#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)
-
-Set the source content for an original source file.
-
-* `sourceFile` the URL of the original source file.
-
-* `sourceContent` the content of the source file.
-
-#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])
-
-Applies a SourceMap for a source file to the SourceMap.
-Each mapping to the supplied source file is rewritten using the
-supplied SourceMap. Note: The resolution for the resulting mappings
-is the minimium of this map and the supplied map.
-
-* `sourceMapConsumer`: The SourceMap to be applied.
-
-* `sourceFile`: Optional. The filename of the source file.
- If omitted, sourceMapConsumer.file will be used, if it exists.
- Otherwise an error will be thrown.
-
-* `sourceMapPath`: Optional. The dirname of the path to the SourceMap
- to be applied. If relative, it is relative to the SourceMap.
-
- This parameter is needed when the two SourceMaps aren't in the same
- directory, and the SourceMap to be applied contains relative source
- paths. If so, those relative source paths need to be rewritten
- relative to the SourceMap.
-
- If omitted, it is assumed that both SourceMaps are in the same directory,
- thus not needing any rewriting. (Supplying `'.'` has the same effect.)
-
-#### SourceMapGenerator.prototype.toString()
-
-Renders the source map being generated to a string.
-
-### SourceNode
-
-SourceNodes provide a way to abstract over interpolating and/or concatenating
-snippets of generated JavaScript source code, while maintaining the line and
-column information associated between those snippets and the original source
-code. This is useful as the final intermediate representation a compiler might
-use before outputting the generated JS and source map.
-
-#### new SourceNode([line, column, source[, chunk[, name]]])
-
-* `line`: The original line number associated with this source node, or null if
- it isn't associated with an original line.
-
-* `column`: The original column number associated with this source node, or null
- if it isn't associated with an original column.
-
-* `source`: The original source's filename; null if no filename is provided.
-
-* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see
- below.
-
-* `name`: Optional. The original identifier.
-
-#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer)
-
-Creates a SourceNode from generated code and a SourceMapConsumer.
-
-* `code`: The generated code
-
-* `sourceMapConsumer` The SourceMap for the generated code
-
-#### SourceNode.prototype.add(chunk)
-
-Add a chunk of generated JS to this source node.
-
-* `chunk`: A string snippet of generated JS code, another instance of
- `SourceNode`, or an array where each member is one of those things.
-
-#### SourceNode.prototype.prepend(chunk)
-
-Prepend a chunk of generated JS to this source node.
-
-* `chunk`: A string snippet of generated JS code, another instance of
- `SourceNode`, or an array where each member is one of those things.
-
-#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent)
-
-Set the source content for a source file. This will be added to the
-`SourceMap` in the `sourcesContent` field.
-
-* `sourceFile`: The filename of the source file
-
-* `sourceContent`: The content of the source file
-
-#### SourceNode.prototype.walk(fn)
-
-Walk over the tree of JS snippets in this node and its children. The walking
-function is called once for each snippet of JS and is passed that snippet and
-the its original associated source's line/column location.
-
-* `fn`: The traversal function.
-
-#### SourceNode.prototype.walkSourceContents(fn)
-
-Walk over the tree of SourceNodes. The walking function is called for each
-source file content and is passed the filename and source content.
-
-* `fn`: The traversal function.
-
-#### SourceNode.prototype.join(sep)
-
-Like `Array.prototype.join` except for SourceNodes. Inserts the separator
-between each of this source node's children.
-
-* `sep`: The separator.
-
-#### SourceNode.prototype.replaceRight(pattern, replacement)
-
-Call `String.prototype.replace` on the very right-most source snippet. Useful
-for trimming whitespace from the end of a source node, etc.
-
-* `pattern`: The pattern to replace.
-
-* `replacement`: The thing to replace the pattern with.
-
-#### SourceNode.prototype.toString()
-
-Return the string representation of this source node. Walks over the tree and
-concatenates all the various snippets together to one string.
-
-### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])
-
-Returns the string representation of this tree of source nodes, plus a
-SourceMapGenerator which contains all the mappings between the generated and
-original sources.
-
-The arguments are the same as those to `new SourceMapGenerator`.
-
-## Tests
-
-[](https://travis-ci.org/mozilla/source-map)
-
-Install NodeJS version 0.8.0 or greater, then run `node test/run-tests.js`.
-
-To add new tests, create a new file named `test/test-.js`
-and export your test functions with names that start with "test", for example
-
- exports["test doing the foo bar"] = function (assert, util) {
- ...
- };
-
-The new test will be located automatically when you run the suite.
-
-The `util` argument is the test utility module located at `test/source-map/util`.
-
-The `assert` argument is a cut down version of node's assert module. You have
-access to the following assertion functions:
-
-* `doesNotThrow`
-
-* `equal`
-
-* `ok`
-
-* `strictEqual`
-
-* `throws`
-
-(The reason for the restricted set of test functions is because we need the
-tests to run inside Firefox's test suite as well and so the assert module is
-shimmed in that environment. See `build/assert-shim.js`.)
-
-[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit
-[feature]: https://wiki.mozilla.org/DevTools/Features/SourceMap
-[Dryice]: https://github.com/mozilla/dryice
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/build/assert-shim.js b/builder/node_modules/uglify-js/node_modules/source-map/build/assert-shim.js
deleted file mode 100644
index daa1a623..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/build/assert-shim.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-define('test/source-map/assert', ['exports'], function (exports) {
-
- let do_throw = function (msg) {
- throw new Error(msg);
- };
-
- exports.init = function (throw_fn) {
- do_throw = throw_fn;
- };
-
- exports.doesNotThrow = function (fn) {
- try {
- fn();
- }
- catch (e) {
- do_throw(e.message);
- }
- };
-
- exports.equal = function (actual, expected, msg) {
- msg = msg || String(actual) + ' != ' + String(expected);
- if (actual != expected) {
- do_throw(msg);
- }
- };
-
- exports.ok = function (val, msg) {
- msg = msg || String(val) + ' is falsey';
- if (!Boolean(val)) {
- do_throw(msg);
- }
- };
-
- exports.strictEqual = function (actual, expected, msg) {
- msg = msg || String(actual) + ' !== ' + String(expected);
- if (actual !== expected) {
- do_throw(msg);
- }
- };
-
- exports.throws = function (fn) {
- try {
- fn();
- do_throw('Expected an error to be thrown, but it wasn\'t.');
- }
- catch (e) {
- }
- };
-
-});
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/build/mini-require.js b/builder/node_modules/uglify-js/node_modules/source-map/build/mini-require.js
deleted file mode 100644
index 0daf4537..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/build/mini-require.js
+++ /dev/null
@@ -1,152 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-
-/**
- * Define a module along with a payload.
- * @param {string} moduleName Name for the payload
- * @param {ignored} deps Ignored. For compatibility with CommonJS AMD Spec
- * @param {function} payload Function with (require, exports, module) params
- */
-function define(moduleName, deps, payload) {
- if (typeof moduleName != "string") {
- throw new TypeError('Expected string, got: ' + moduleName);
- }
-
- if (arguments.length == 2) {
- payload = deps;
- }
-
- if (moduleName in define.modules) {
- throw new Error("Module already defined: " + moduleName);
- }
- define.modules[moduleName] = payload;
-};
-
-/**
- * The global store of un-instantiated modules
- */
-define.modules = {};
-
-
-/**
- * We invoke require() in the context of a Domain so we can have multiple
- * sets of modules running separate from each other.
- * This contrasts with JSMs which are singletons, Domains allows us to
- * optionally load a CommonJS module twice with separate data each time.
- * Perhaps you want 2 command lines with a different set of commands in each,
- * for example.
- */
-function Domain() {
- this.modules = {};
- this._currentModule = null;
-}
-
-(function () {
-
- /**
- * Lookup module names and resolve them by calling the definition function if
- * needed.
- * There are 2 ways to call this, either with an array of dependencies and a
- * callback to call when the dependencies are found (which can happen
- * asynchronously in an in-page context) or with a single string an no callback
- * where the dependency is resolved synchronously and returned.
- * The API is designed to be compatible with the CommonJS AMD spec and
- * RequireJS.
- * @param {string[]|string} deps A name, or names for the payload
- * @param {function|undefined} callback Function to call when the dependencies
- * are resolved
- * @return {undefined|object} The module required or undefined for
- * array/callback method
- */
- Domain.prototype.require = function(deps, callback) {
- if (Array.isArray(deps)) {
- var params = deps.map(function(dep) {
- return this.lookup(dep);
- }, this);
- if (callback) {
- callback.apply(null, params);
- }
- return undefined;
- }
- else {
- return this.lookup(deps);
- }
- };
-
- function normalize(path) {
- var bits = path.split('/');
- var i = 1;
- while (i < bits.length) {
- if (bits[i] === '..') {
- bits.splice(i-1, 1);
- } else if (bits[i] === '.') {
- bits.splice(i, 1);
- } else {
- i++;
- }
- }
- return bits.join('/');
- }
-
- function join(a, b) {
- a = a.trim();
- b = b.trim();
- if (/^\//.test(b)) {
- return b;
- } else {
- return a.replace(/\/*$/, '/') + b;
- }
- }
-
- function dirname(path) {
- var bits = path.split('/');
- bits.pop();
- return bits.join('/');
- }
-
- /**
- * Lookup module names and resolve them by calling the definition function if
- * needed.
- * @param {string} moduleName A name for the payload to lookup
- * @return {object} The module specified by aModuleName or null if not found.
- */
- Domain.prototype.lookup = function(moduleName) {
- if (/^\./.test(moduleName)) {
- moduleName = normalize(join(dirname(this._currentModule), moduleName));
- }
-
- if (moduleName in this.modules) {
- var module = this.modules[moduleName];
- return module;
- }
-
- if (!(moduleName in define.modules)) {
- throw new Error("Module not defined: " + moduleName);
- }
-
- var module = define.modules[moduleName];
-
- if (typeof module == "function") {
- var exports = {};
- var previousModule = this._currentModule;
- this._currentModule = moduleName;
- module(this.require.bind(this), exports, { id: moduleName, uri: "" });
- this._currentModule = previousModule;
- module = exports;
- }
-
- // cache the resulting module object for next time
- this.modules[moduleName] = module;
-
- return module;
- };
-
-}());
-
-define.Domain = Domain;
-define.globalDomain = new Domain();
-var require = define.globalDomain.require.bind(define.globalDomain);
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/build/prefix-source-map.jsm b/builder/node_modules/uglify-js/node_modules/source-map/build/prefix-source-map.jsm
deleted file mode 100644
index ee2539d8..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/build/prefix-source-map.jsm
+++ /dev/null
@@ -1,20 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-
-/*
- * WARNING!
- *
- * Do not edit this file directly, it is built from the sources at
- * https://github.com/mozilla/source-map/
- */
-
-///////////////////////////////////////////////////////////////////////////////
-
-
-this.EXPORTED_SYMBOLS = [ "SourceMapConsumer", "SourceMapGenerator", "SourceNode" ];
-
-Components.utils.import('resource://gre/modules/devtools/Require.jsm');
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/build/prefix-utils.jsm b/builder/node_modules/uglify-js/node_modules/source-map/build/prefix-utils.jsm
deleted file mode 100644
index 80341d45..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/build/prefix-utils.jsm
+++ /dev/null
@@ -1,18 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-
-/*
- * WARNING!
- *
- * Do not edit this file directly, it is built from the sources at
- * https://github.com/mozilla/source-map/
- */
-
-Components.utils.import('resource://gre/modules/devtools/Require.jsm');
-Components.utils.import('resource://gre/modules/devtools/SourceMap.jsm');
-
-this.EXPORTED_SYMBOLS = [ "define", "runSourceMapTests" ];
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/build/suffix-browser.js b/builder/node_modules/uglify-js/node_modules/source-map/build/suffix-browser.js
deleted file mode 100644
index fb29ff5f..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/build/suffix-browser.js
+++ /dev/null
@@ -1,8 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-///////////////////////////////////////////////////////////////////////////////
-
-this.sourceMap = {
- SourceMapConsumer: require('source-map/source-map-consumer').SourceMapConsumer,
- SourceMapGenerator: require('source-map/source-map-generator').SourceMapGenerator,
- SourceNode: require('source-map/source-node').SourceNode
-};
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/build/suffix-source-map.jsm b/builder/node_modules/uglify-js/node_modules/source-map/build/suffix-source-map.jsm
deleted file mode 100644
index cf3c2d8d..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/build/suffix-source-map.jsm
+++ /dev/null
@@ -1,6 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-///////////////////////////////////////////////////////////////////////////////
-
-this.SourceMapConsumer = require('source-map/source-map-consumer').SourceMapConsumer;
-this.SourceMapGenerator = require('source-map/source-map-generator').SourceMapGenerator;
-this.SourceNode = require('source-map/source-node').SourceNode;
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/build/suffix-utils.jsm b/builder/node_modules/uglify-js/node_modules/source-map/build/suffix-utils.jsm
deleted file mode 100644
index b31b84cb..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/build/suffix-utils.jsm
+++ /dev/null
@@ -1,21 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-function runSourceMapTests(modName, do_throw) {
- let mod = require(modName);
- let assert = require('test/source-map/assert');
- let util = require('test/source-map/util');
-
- assert.init(do_throw);
-
- for (let k in mod) {
- if (/^test/.test(k)) {
- mod[k](assert, util);
- }
- }
-
-}
-this.runSourceMapTests = runSourceMapTests;
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/build/test-prefix.js b/builder/node_modules/uglify-js/node_modules/source-map/build/test-prefix.js
deleted file mode 100644
index 1b13f300..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/build/test-prefix.js
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
- * WARNING!
- *
- * Do not edit this file directly, it is built from the sources at
- * https://github.com/mozilla/source-map/
- */
-
-Components.utils.import('resource://test/Utils.jsm');
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/build/test-suffix.js b/builder/node_modules/uglify-js/node_modules/source-map/build/test-suffix.js
deleted file mode 100644
index bec2de3f..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/build/test-suffix.js
+++ /dev/null
@@ -1,3 +0,0 @@
-function run_test() {
- runSourceMapTests('{THIS_MODULE}', do_throw);
-}
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map.js b/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map.js
deleted file mode 100644
index 121ad241..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map.js
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
- * Copyright 2009-2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE.txt or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-exports.SourceMapGenerator = require('./source-map/source-map-generator').SourceMapGenerator;
-exports.SourceMapConsumer = require('./source-map/source-map-consumer').SourceMapConsumer;
-exports.SourceNode = require('./source-map/source-node').SourceNode;
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map/array-set.js b/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map/array-set.js
deleted file mode 100644
index 40f9a18b..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map/array-set.js
+++ /dev/null
@@ -1,97 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-if (typeof define !== 'function') {
- var define = require('amdefine')(module, require);
-}
-define(function (require, exports, module) {
-
- var util = require('./util');
-
- /**
- * A data structure which is a combination of an array and a set. Adding a new
- * member is O(1), testing for membership is O(1), and finding the index of an
- * element is O(1). Removing elements from the set is not supported. Only
- * strings are supported for membership.
- */
- function ArraySet() {
- this._array = [];
- this._set = {};
- }
-
- /**
- * Static method for creating ArraySet instances from an existing array.
- */
- ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
- var set = new ArraySet();
- for (var i = 0, len = aArray.length; i < len; i++) {
- set.add(aArray[i], aAllowDuplicates);
- }
- return set;
- };
-
- /**
- * Add the given string to this set.
- *
- * @param String aStr
- */
- ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
- var isDuplicate = this.has(aStr);
- var idx = this._array.length;
- if (!isDuplicate || aAllowDuplicates) {
- this._array.push(aStr);
- }
- if (!isDuplicate) {
- this._set[util.toSetString(aStr)] = idx;
- }
- };
-
- /**
- * Is the given string a member of this set?
- *
- * @param String aStr
- */
- ArraySet.prototype.has = function ArraySet_has(aStr) {
- return Object.prototype.hasOwnProperty.call(this._set,
- util.toSetString(aStr));
- };
-
- /**
- * What is the index of the given string in the array?
- *
- * @param String aStr
- */
- ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
- if (this.has(aStr)) {
- return this._set[util.toSetString(aStr)];
- }
- throw new Error('"' + aStr + '" is not in the set.');
- };
-
- /**
- * What is the element at the given index?
- *
- * @param Number aIdx
- */
- ArraySet.prototype.at = function ArraySet_at(aIdx) {
- if (aIdx >= 0 && aIdx < this._array.length) {
- return this._array[aIdx];
- }
- throw new Error('No element indexed by ' + aIdx);
- };
-
- /**
- * Returns the array representation of this set (which has the proper indices
- * indicated by indexOf). Note that this is a copy of the internal array used
- * for storing the members so that no one can mess with internal state.
- */
- ArraySet.prototype.toArray = function ArraySet_toArray() {
- return this._array.slice();
- };
-
- exports.ArraySet = ArraySet;
-
-});
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64-vlq.js b/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64-vlq.js
deleted file mode 100644
index 1b67bb37..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64-vlq.js
+++ /dev/null
@@ -1,144 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- *
- * Based on the Base 64 VLQ implementation in Closure Compiler:
- * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
- *
- * Copyright 2011 The Closure Compiler Authors. All rights reserved.
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-if (typeof define !== 'function') {
- var define = require('amdefine')(module, require);
-}
-define(function (require, exports, module) {
-
- var base64 = require('./base64');
-
- // A single base 64 digit can contain 6 bits of data. For the base 64 variable
- // length quantities we use in the source map spec, the first bit is the sign,
- // the next four bits are the actual value, and the 6th bit is the
- // continuation bit. The continuation bit tells us whether there are more
- // digits in this value following this digit.
- //
- // Continuation
- // | Sign
- // | |
- // V V
- // 101011
-
- var VLQ_BASE_SHIFT = 5;
-
- // binary: 100000
- var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
-
- // binary: 011111
- var VLQ_BASE_MASK = VLQ_BASE - 1;
-
- // binary: 100000
- var VLQ_CONTINUATION_BIT = VLQ_BASE;
-
- /**
- * Converts from a two-complement value to a value where the sign bit is
- * is placed in the least significant bit. For example, as decimals:
- * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
- * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
- */
- function toVLQSigned(aValue) {
- return aValue < 0
- ? ((-aValue) << 1) + 1
- : (aValue << 1) + 0;
- }
-
- /**
- * Converts to a two-complement value from a value where the sign bit is
- * is placed in the least significant bit. For example, as decimals:
- * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
- * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
- */
- function fromVLQSigned(aValue) {
- var isNegative = (aValue & 1) === 1;
- var shifted = aValue >> 1;
- return isNegative
- ? -shifted
- : shifted;
- }
-
- /**
- * Returns the base 64 VLQ encoded value.
- */
- exports.encode = function base64VLQ_encode(aValue) {
- var encoded = "";
- var digit;
-
- var vlq = toVLQSigned(aValue);
-
- do {
- digit = vlq & VLQ_BASE_MASK;
- vlq >>>= VLQ_BASE_SHIFT;
- if (vlq > 0) {
- // There are still more digits in this value, so we must make sure the
- // continuation bit is marked.
- digit |= VLQ_CONTINUATION_BIT;
- }
- encoded += base64.encode(digit);
- } while (vlq > 0);
-
- return encoded;
- };
-
- /**
- * Decodes the next base 64 VLQ value from the given string and returns the
- * value and the rest of the string.
- */
- exports.decode = function base64VLQ_decode(aStr) {
- var i = 0;
- var strLen = aStr.length;
- var result = 0;
- var shift = 0;
- var continuation, digit;
-
- do {
- if (i >= strLen) {
- throw new Error("Expected more digits in base 64 VLQ value.");
- }
- digit = base64.decode(aStr.charAt(i++));
- continuation = !!(digit & VLQ_CONTINUATION_BIT);
- digit &= VLQ_BASE_MASK;
- result = result + (digit << shift);
- shift += VLQ_BASE_SHIFT;
- } while (continuation);
-
- return {
- value: fromVLQSigned(result),
- rest: aStr.slice(i)
- };
- };
-
-});
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64.js b/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64.js
deleted file mode 100644
index 863cc465..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-if (typeof define !== 'function') {
- var define = require('amdefine')(module, require);
-}
-define(function (require, exports, module) {
-
- var charToIntMap = {};
- var intToCharMap = {};
-
- 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
- .split('')
- .forEach(function (ch, index) {
- charToIntMap[ch] = index;
- intToCharMap[index] = ch;
- });
-
- /**
- * Encode an integer in the range of 0 to 63 to a single base 64 digit.
- */
- exports.encode = function base64_encode(aNumber) {
- if (aNumber in intToCharMap) {
- return intToCharMap[aNumber];
- }
- throw new TypeError("Must be between 0 and 63: " + aNumber);
- };
-
- /**
- * Decode a single base 64 digit to an integer.
- */
- exports.decode = function base64_decode(aChar) {
- if (aChar in charToIntMap) {
- return charToIntMap[aChar];
- }
- throw new TypeError("Not a valid base 64 digit: " + aChar);
- };
-
-});
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map/binary-search.js b/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map/binary-search.js
deleted file mode 100644
index ff347c68..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map/binary-search.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-if (typeof define !== 'function') {
- var define = require('amdefine')(module, require);
-}
-define(function (require, exports, module) {
-
- /**
- * Recursive implementation of binary search.
- *
- * @param aLow Indices here and lower do not contain the needle.
- * @param aHigh Indices here and higher do not contain the needle.
- * @param aNeedle The element being searched for.
- * @param aHaystack The non-empty array being searched.
- * @param aCompare Function which takes two elements and returns -1, 0, or 1.
- */
- function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare) {
- // This function terminates when one of the following is true:
- //
- // 1. We find the exact element we are looking for.
- //
- // 2. We did not find the exact element, but we can return the next
- // closest element that is less than that element.
- //
- // 3. We did not find the exact element, and there is no next-closest
- // element which is less than the one we are searching for, so we
- // return null.
- var mid = Math.floor((aHigh - aLow) / 2) + aLow;
- var cmp = aCompare(aNeedle, aHaystack[mid], true);
- if (cmp === 0) {
- // Found the element we are looking for.
- return aHaystack[mid];
- }
- else if (cmp > 0) {
- // aHaystack[mid] is greater than our needle.
- if (aHigh - mid > 1) {
- // The element is in the upper half.
- return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare);
- }
- // We did not find an exact match, return the next closest one
- // (termination case 2).
- return aHaystack[mid];
- }
- else {
- // aHaystack[mid] is less than our needle.
- if (mid - aLow > 1) {
- // The element is in the lower half.
- return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare);
- }
- // The exact needle element was not found in this haystack. Determine if
- // we are in termination case (2) or (3) and return the appropriate thing.
- return aLow < 0
- ? null
- : aHaystack[aLow];
- }
- }
-
- /**
- * This is an implementation of binary search which will always try and return
- * the next lowest value checked if there is no exact hit. This is because
- * mappings between original and generated line/col pairs are single points,
- * and there is an implicit region between each of them, so a miss just means
- * that you aren't on the very start of a region.
- *
- * @param aNeedle The element you are looking for.
- * @param aHaystack The array that is being searched.
- * @param aCompare A function which takes the needle and an element in the
- * array and returns -1, 0, or 1 depending on whether the needle is less
- * than, equal to, or greater than the element, respectively.
- */
- exports.search = function search(aNeedle, aHaystack, aCompare) {
- return aHaystack.length > 0
- ? recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare)
- : null;
- };
-
-});
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-consumer.js b/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-consumer.js
deleted file mode 100644
index 5214d5e7..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-consumer.js
+++ /dev/null
@@ -1,478 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-if (typeof define !== 'function') {
- var define = require('amdefine')(module, require);
-}
-define(function (require, exports, module) {
-
- var util = require('./util');
- var binarySearch = require('./binary-search');
- var ArraySet = require('./array-set').ArraySet;
- var base64VLQ = require('./base64-vlq');
-
- /**
- * A SourceMapConsumer instance represents a parsed source map which we can
- * query for information about the original file positions by giving it a file
- * position in the generated source.
- *
- * The only parameter is the raw source map (either as a JSON string, or
- * already parsed to an object). According to the spec, source maps have the
- * following attributes:
- *
- * - version: Which version of the source map spec this map is following.
- * - sources: An array of URLs to the original source files.
- * - names: An array of identifiers which can be referrenced by individual mappings.
- * - sourceRoot: Optional. The URL root from which all sources are relative.
- * - sourcesContent: Optional. An array of contents of the original source files.
- * - mappings: A string of base64 VLQs which contain the actual mappings.
- * - file: Optional. The generated file this source map is associated with.
- *
- * Here is an example source map, taken from the source map spec[0]:
- *
- * {
- * version : 3,
- * file: "out.js",
- * sourceRoot : "",
- * sources: ["foo.js", "bar.js"],
- * names: ["src", "maps", "are", "fun"],
- * mappings: "AA,AB;;ABCDE;"
- * }
- *
- * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
- */
- function SourceMapConsumer(aSourceMap) {
- var sourceMap = aSourceMap;
- if (typeof aSourceMap === 'string') {
- sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
- }
-
- var version = util.getArg(sourceMap, 'version');
- var sources = util.getArg(sourceMap, 'sources');
- // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
- // requires the array) to play nice here.
- var names = util.getArg(sourceMap, 'names', []);
- var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
- var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
- var mappings = util.getArg(sourceMap, 'mappings');
- var file = util.getArg(sourceMap, 'file', null);
-
- // Once again, Sass deviates from the spec and supplies the version as a
- // string rather than a number, so we use loose equality checking here.
- if (version != this._version) {
- throw new Error('Unsupported version: ' + version);
- }
-
- // Pass `true` below to allow duplicate names and sources. While source maps
- // are intended to be compressed and deduplicated, the TypeScript compiler
- // sometimes generates source maps with duplicates in them. See Github issue
- // #72 and bugzil.la/889492.
- this._names = ArraySet.fromArray(names, true);
- this._sources = ArraySet.fromArray(sources, true);
-
- this.sourceRoot = sourceRoot;
- this.sourcesContent = sourcesContent;
- this._mappings = mappings;
- this.file = file;
- }
-
- /**
- * Create a SourceMapConsumer from a SourceMapGenerator.
- *
- * @param SourceMapGenerator aSourceMap
- * The source map that will be consumed.
- * @returns SourceMapConsumer
- */
- SourceMapConsumer.fromSourceMap =
- function SourceMapConsumer_fromSourceMap(aSourceMap) {
- var smc = Object.create(SourceMapConsumer.prototype);
-
- smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
- smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
- smc.sourceRoot = aSourceMap._sourceRoot;
- smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),
- smc.sourceRoot);
- smc.file = aSourceMap._file;
-
- smc.__generatedMappings = aSourceMap._mappings.slice()
- .sort(util.compareByGeneratedPositions);
- smc.__originalMappings = aSourceMap._mappings.slice()
- .sort(util.compareByOriginalPositions);
-
- return smc;
- };
-
- /**
- * The version of the source mapping spec that we are consuming.
- */
- SourceMapConsumer.prototype._version = 3;
-
- /**
- * The list of original sources.
- */
- Object.defineProperty(SourceMapConsumer.prototype, 'sources', {
- get: function () {
- return this._sources.toArray().map(function (s) {
- return this.sourceRoot ? util.join(this.sourceRoot, s) : s;
- }, this);
- }
- });
-
- // `__generatedMappings` and `__originalMappings` are arrays that hold the
- // parsed mapping coordinates from the source map's "mappings" attribute. They
- // are lazily instantiated, accessed via the `_generatedMappings` and
- // `_originalMappings` getters respectively, and we only parse the mappings
- // and create these arrays once queried for a source location. We jump through
- // these hoops because there can be many thousands of mappings, and parsing
- // them is expensive, so we only want to do it if we must.
- //
- // Each object in the arrays is of the form:
- //
- // {
- // generatedLine: The line number in the generated code,
- // generatedColumn: The column number in the generated code,
- // source: The path to the original source file that generated this
- // chunk of code,
- // originalLine: The line number in the original source that
- // corresponds to this chunk of generated code,
- // originalColumn: The column number in the original source that
- // corresponds to this chunk of generated code,
- // name: The name of the original symbol which generated this chunk of
- // code.
- // }
- //
- // All properties except for `generatedLine` and `generatedColumn` can be
- // `null`.
- //
- // `_generatedMappings` is ordered by the generated positions.
- //
- // `_originalMappings` is ordered by the original positions.
-
- SourceMapConsumer.prototype.__generatedMappings = null;
- Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
- get: function () {
- if (!this.__generatedMappings) {
- this.__generatedMappings = [];
- this.__originalMappings = [];
- this._parseMappings(this._mappings, this.sourceRoot);
- }
-
- return this.__generatedMappings;
- }
- });
-
- SourceMapConsumer.prototype.__originalMappings = null;
- Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
- get: function () {
- if (!this.__originalMappings) {
- this.__generatedMappings = [];
- this.__originalMappings = [];
- this._parseMappings(this._mappings, this.sourceRoot);
- }
-
- return this.__originalMappings;
- }
- });
-
- /**
- * Parse the mappings in a string in to a data structure which we can easily
- * query (the ordered arrays in the `this.__generatedMappings` and
- * `this.__originalMappings` properties).
- */
- SourceMapConsumer.prototype._parseMappings =
- function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
- var generatedLine = 1;
- var previousGeneratedColumn = 0;
- var previousOriginalLine = 0;
- var previousOriginalColumn = 0;
- var previousSource = 0;
- var previousName = 0;
- var mappingSeparator = /^[,;]/;
- var str = aStr;
- var mapping;
- var temp;
-
- while (str.length > 0) {
- if (str.charAt(0) === ';') {
- generatedLine++;
- str = str.slice(1);
- previousGeneratedColumn = 0;
- }
- else if (str.charAt(0) === ',') {
- str = str.slice(1);
- }
- else {
- mapping = {};
- mapping.generatedLine = generatedLine;
-
- // Generated column.
- temp = base64VLQ.decode(str);
- mapping.generatedColumn = previousGeneratedColumn + temp.value;
- previousGeneratedColumn = mapping.generatedColumn;
- str = temp.rest;
-
- if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) {
- // Original source.
- temp = base64VLQ.decode(str);
- mapping.source = this._sources.at(previousSource + temp.value);
- previousSource += temp.value;
- str = temp.rest;
- if (str.length === 0 || mappingSeparator.test(str.charAt(0))) {
- throw new Error('Found a source, but no line and column');
- }
-
- // Original line.
- temp = base64VLQ.decode(str);
- mapping.originalLine = previousOriginalLine + temp.value;
- previousOriginalLine = mapping.originalLine;
- // Lines are stored 0-based
- mapping.originalLine += 1;
- str = temp.rest;
- if (str.length === 0 || mappingSeparator.test(str.charAt(0))) {
- throw new Error('Found a source and line, but no column');
- }
-
- // Original column.
- temp = base64VLQ.decode(str);
- mapping.originalColumn = previousOriginalColumn + temp.value;
- previousOriginalColumn = mapping.originalColumn;
- str = temp.rest;
-
- if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) {
- // Original name.
- temp = base64VLQ.decode(str);
- mapping.name = this._names.at(previousName + temp.value);
- previousName += temp.value;
- str = temp.rest;
- }
- }
-
- this.__generatedMappings.push(mapping);
- if (typeof mapping.originalLine === 'number') {
- this.__originalMappings.push(mapping);
- }
- }
- }
-
- this.__generatedMappings.sort(util.compareByGeneratedPositions);
- this.__originalMappings.sort(util.compareByOriginalPositions);
- };
-
- /**
- * Find the mapping that best matches the hypothetical "needle" mapping that
- * we are searching for in the given "haystack" of mappings.
- */
- SourceMapConsumer.prototype._findMapping =
- function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,
- aColumnName, aComparator) {
- // To return the position we are searching for, we must first find the
- // mapping for the given position and then return the opposite position it
- // points to. Because the mappings are sorted, we can use binary search to
- // find the best mapping.
-
- if (aNeedle[aLineName] <= 0) {
- throw new TypeError('Line must be greater than or equal to 1, got '
- + aNeedle[aLineName]);
- }
- if (aNeedle[aColumnName] < 0) {
- throw new TypeError('Column must be greater than or equal to 0, got '
- + aNeedle[aColumnName]);
- }
-
- return binarySearch.search(aNeedle, aMappings, aComparator);
- };
-
- /**
- * Returns the original source, line, and column information for the generated
- * source's line and column positions provided. The only argument is an object
- * with the following properties:
- *
- * - line: The line number in the generated source.
- * - column: The column number in the generated source.
- *
- * and an object is returned with the following properties:
- *
- * - source: The original source file, or null.
- * - line: The line number in the original source, or null.
- * - column: The column number in the original source, or null.
- * - name: The original identifier, or null.
- */
- SourceMapConsumer.prototype.originalPositionFor =
- function SourceMapConsumer_originalPositionFor(aArgs) {
- var needle = {
- generatedLine: util.getArg(aArgs, 'line'),
- generatedColumn: util.getArg(aArgs, 'column')
- };
-
- var mapping = this._findMapping(needle,
- this._generatedMappings,
- "generatedLine",
- "generatedColumn",
- util.compareByGeneratedPositions);
-
- if (mapping && mapping.generatedLine === needle.generatedLine) {
- var source = util.getArg(mapping, 'source', null);
- if (source && this.sourceRoot) {
- source = util.join(this.sourceRoot, source);
- }
- return {
- source: source,
- line: util.getArg(mapping, 'originalLine', null),
- column: util.getArg(mapping, 'originalColumn', null),
- name: util.getArg(mapping, 'name', null)
- };
- }
-
- return {
- source: null,
- line: null,
- column: null,
- name: null
- };
- };
-
- /**
- * Returns the original source content. The only argument is the url of the
- * original source file. Returns null if no original source content is
- * availible.
- */
- SourceMapConsumer.prototype.sourceContentFor =
- function SourceMapConsumer_sourceContentFor(aSource) {
- if (!this.sourcesContent) {
- return null;
- }
-
- if (this.sourceRoot) {
- aSource = util.relative(this.sourceRoot, aSource);
- }
-
- if (this._sources.has(aSource)) {
- return this.sourcesContent[this._sources.indexOf(aSource)];
- }
-
- var url;
- if (this.sourceRoot
- && (url = util.urlParse(this.sourceRoot))) {
- // XXX: file:// URIs and absolute paths lead to unexpected behavior for
- // many users. We can help them out when they expect file:// URIs to
- // behave like it would if they were running a local HTTP server. See
- // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
- var fileUriAbsPath = aSource.replace(/^file:\/\//, "");
- if (url.scheme == "file"
- && this._sources.has(fileUriAbsPath)) {
- return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]
- }
-
- if ((!url.path || url.path == "/")
- && this._sources.has("/" + aSource)) {
- return this.sourcesContent[this._sources.indexOf("/" + aSource)];
- }
- }
-
- throw new Error('"' + aSource + '" is not in the SourceMap.');
- };
-
- /**
- * Returns the generated line and column information for the original source,
- * line, and column positions provided. The only argument is an object with
- * the following properties:
- *
- * - source: The filename of the original source.
- * - line: The line number in the original source.
- * - column: The column number in the original source.
- *
- * and an object is returned with the following properties:
- *
- * - line: The line number in the generated source, or null.
- * - column: The column number in the generated source, or null.
- */
- SourceMapConsumer.prototype.generatedPositionFor =
- function SourceMapConsumer_generatedPositionFor(aArgs) {
- var needle = {
- source: util.getArg(aArgs, 'source'),
- originalLine: util.getArg(aArgs, 'line'),
- originalColumn: util.getArg(aArgs, 'column')
- };
-
- if (this.sourceRoot) {
- needle.source = util.relative(this.sourceRoot, needle.source);
- }
-
- var mapping = this._findMapping(needle,
- this._originalMappings,
- "originalLine",
- "originalColumn",
- util.compareByOriginalPositions);
-
- if (mapping) {
- return {
- line: util.getArg(mapping, 'generatedLine', null),
- column: util.getArg(mapping, 'generatedColumn', null)
- };
- }
-
- return {
- line: null,
- column: null
- };
- };
-
- SourceMapConsumer.GENERATED_ORDER = 1;
- SourceMapConsumer.ORIGINAL_ORDER = 2;
-
- /**
- * Iterate over each mapping between an original source/line/column and a
- * generated line/column in this source map.
- *
- * @param Function aCallback
- * The function that is called with each mapping.
- * @param Object aContext
- * Optional. If specified, this object will be the value of `this` every
- * time that `aCallback` is called.
- * @param aOrder
- * Either `SourceMapConsumer.GENERATED_ORDER` or
- * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
- * iterate over the mappings sorted by the generated file's line/column
- * order or the original's source/line/column order, respectively. Defaults to
- * `SourceMapConsumer.GENERATED_ORDER`.
- */
- SourceMapConsumer.prototype.eachMapping =
- function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
- var context = aContext || null;
- var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
-
- var mappings;
- switch (order) {
- case SourceMapConsumer.GENERATED_ORDER:
- mappings = this._generatedMappings;
- break;
- case SourceMapConsumer.ORIGINAL_ORDER:
- mappings = this._originalMappings;
- break;
- default:
- throw new Error("Unknown order of iteration.");
- }
-
- var sourceRoot = this.sourceRoot;
- mappings.map(function (mapping) {
- var source = mapping.source;
- if (source && sourceRoot) {
- source = util.join(sourceRoot, source);
- }
- return {
- source: source,
- generatedLine: mapping.generatedLine,
- generatedColumn: mapping.generatedColumn,
- originalLine: mapping.originalLine,
- originalColumn: mapping.originalColumn,
- name: mapping.name
- };
- }).forEach(aCallback, context);
- };
-
- exports.SourceMapConsumer = SourceMapConsumer;
-
-});
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-generator.js b/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-generator.js
deleted file mode 100644
index d555f08c..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-generator.js
+++ /dev/null
@@ -1,397 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-if (typeof define !== 'function') {
- var define = require('amdefine')(module, require);
-}
-define(function (require, exports, module) {
-
- var base64VLQ = require('./base64-vlq');
- var util = require('./util');
- var ArraySet = require('./array-set').ArraySet;
-
- /**
- * An instance of the SourceMapGenerator represents a source map which is
- * being built incrementally. You may pass an object with the following
- * properties:
- *
- * - file: The filename of the generated source.
- * - sourceRoot: A root for all relative URLs in this source map.
- */
- function SourceMapGenerator(aArgs) {
- if (!aArgs) {
- aArgs = {};
- }
- this._file = util.getArg(aArgs, 'file', null);
- this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
- this._sources = new ArraySet();
- this._names = new ArraySet();
- this._mappings = [];
- this._sourcesContents = null;
- }
-
- SourceMapGenerator.prototype._version = 3;
-
- /**
- * Creates a new SourceMapGenerator based on a SourceMapConsumer
- *
- * @param aSourceMapConsumer The SourceMap.
- */
- SourceMapGenerator.fromSourceMap =
- function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
- var sourceRoot = aSourceMapConsumer.sourceRoot;
- var generator = new SourceMapGenerator({
- file: aSourceMapConsumer.file,
- sourceRoot: sourceRoot
- });
- aSourceMapConsumer.eachMapping(function (mapping) {
- var newMapping = {
- generated: {
- line: mapping.generatedLine,
- column: mapping.generatedColumn
- }
- };
-
- if (mapping.source) {
- newMapping.source = mapping.source;
- if (sourceRoot) {
- newMapping.source = util.relative(sourceRoot, newMapping.source);
- }
-
- newMapping.original = {
- line: mapping.originalLine,
- column: mapping.originalColumn
- };
-
- if (mapping.name) {
- newMapping.name = mapping.name;
- }
- }
-
- generator.addMapping(newMapping);
- });
- aSourceMapConsumer.sources.forEach(function (sourceFile) {
- var content = aSourceMapConsumer.sourceContentFor(sourceFile);
- if (content) {
- generator.setSourceContent(sourceFile, content);
- }
- });
- return generator;
- };
-
- /**
- * Add a single mapping from original source line and column to the generated
- * source's line and column for this source map being created. The mapping
- * object should have the following properties:
- *
- * - generated: An object with the generated line and column positions.
- * - original: An object with the original line and column positions.
- * - source: The original source file (relative to the sourceRoot).
- * - name: An optional original token name for this mapping.
- */
- SourceMapGenerator.prototype.addMapping =
- function SourceMapGenerator_addMapping(aArgs) {
- var generated = util.getArg(aArgs, 'generated');
- var original = util.getArg(aArgs, 'original', null);
- var source = util.getArg(aArgs, 'source', null);
- var name = util.getArg(aArgs, 'name', null);
-
- this._validateMapping(generated, original, source, name);
-
- if (source && !this._sources.has(source)) {
- this._sources.add(source);
- }
-
- if (name && !this._names.has(name)) {
- this._names.add(name);
- }
-
- this._mappings.push({
- generatedLine: generated.line,
- generatedColumn: generated.column,
- originalLine: original != null && original.line,
- originalColumn: original != null && original.column,
- source: source,
- name: name
- });
- };
-
- /**
- * Set the source content for a source file.
- */
- SourceMapGenerator.prototype.setSourceContent =
- function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
- var source = aSourceFile;
- if (this._sourceRoot) {
- source = util.relative(this._sourceRoot, source);
- }
-
- if (aSourceContent !== null) {
- // Add the source content to the _sourcesContents map.
- // Create a new _sourcesContents map if the property is null.
- if (!this._sourcesContents) {
- this._sourcesContents = {};
- }
- this._sourcesContents[util.toSetString(source)] = aSourceContent;
- } else {
- // Remove the source file from the _sourcesContents map.
- // If the _sourcesContents map is empty, set the property to null.
- delete this._sourcesContents[util.toSetString(source)];
- if (Object.keys(this._sourcesContents).length === 0) {
- this._sourcesContents = null;
- }
- }
- };
-
- /**
- * Applies the mappings of a sub-source-map for a specific source file to the
- * source map being generated. Each mapping to the supplied source file is
- * rewritten using the supplied source map. Note: The resolution for the
- * resulting mappings is the minimium of this map and the supplied map.
- *
- * @param aSourceMapConsumer The source map to be applied.
- * @param aSourceFile Optional. The filename of the source file.
- * If omitted, SourceMapConsumer's file property will be used.
- * @param aSourceMapPath Optional. The dirname of the path to the source map
- * to be applied. If relative, it is relative to the SourceMapConsumer.
- * This parameter is needed when the two source maps aren't in the same
- * directory, and the source map to be applied contains relative source
- * paths. If so, those relative source paths need to be rewritten
- * relative to the SourceMapGenerator.
- */
- SourceMapGenerator.prototype.applySourceMap =
- function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
- // If aSourceFile is omitted, we will use the file property of the SourceMap
- if (!aSourceFile) {
- if (!aSourceMapConsumer.file) {
- throw new Error(
- 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
- 'or the source map\'s "file" property. Both were omitted.'
- );
- }
- aSourceFile = aSourceMapConsumer.file;
- }
- var sourceRoot = this._sourceRoot;
- // Make "aSourceFile" relative if an absolute Url is passed.
- if (sourceRoot) {
- aSourceFile = util.relative(sourceRoot, aSourceFile);
- }
- // Applying the SourceMap can add and remove items from the sources and
- // the names array.
- var newSources = new ArraySet();
- var newNames = new ArraySet();
-
- // Find mappings for the "aSourceFile"
- this._mappings.forEach(function (mapping) {
- if (mapping.source === aSourceFile && mapping.originalLine) {
- // Check if it can be mapped by the source map, then update the mapping.
- var original = aSourceMapConsumer.originalPositionFor({
- line: mapping.originalLine,
- column: mapping.originalColumn
- });
- if (original.source !== null) {
- // Copy mapping
- mapping.source = original.source;
- if (aSourceMapPath) {
- mapping.source = util.join(aSourceMapPath, mapping.source)
- }
- if (sourceRoot) {
- mapping.source = util.relative(sourceRoot, mapping.source);
- }
- mapping.originalLine = original.line;
- mapping.originalColumn = original.column;
- if (original.name !== null && mapping.name !== null) {
- // Only use the identifier name if it's an identifier
- // in both SourceMaps
- mapping.name = original.name;
- }
- }
- }
-
- var source = mapping.source;
- if (source && !newSources.has(source)) {
- newSources.add(source);
- }
-
- var name = mapping.name;
- if (name && !newNames.has(name)) {
- newNames.add(name);
- }
-
- }, this);
- this._sources = newSources;
- this._names = newNames;
-
- // Copy sourcesContents of applied map.
- aSourceMapConsumer.sources.forEach(function (sourceFile) {
- var content = aSourceMapConsumer.sourceContentFor(sourceFile);
- if (content) {
- if (sourceRoot) {
- sourceFile = util.relative(sourceRoot, sourceFile);
- }
- this.setSourceContent(sourceFile, content);
- }
- }, this);
- };
-
- /**
- * A mapping can have one of the three levels of data:
- *
- * 1. Just the generated position.
- * 2. The Generated position, original position, and original source.
- * 3. Generated and original position, original source, as well as a name
- * token.
- *
- * To maintain consistency, we validate that any new mapping being added falls
- * in to one of these categories.
- */
- SourceMapGenerator.prototype._validateMapping =
- function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
- aName) {
- if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
- && aGenerated.line > 0 && aGenerated.column >= 0
- && !aOriginal && !aSource && !aName) {
- // Case 1.
- return;
- }
- else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
- && aOriginal && 'line' in aOriginal && 'column' in aOriginal
- && aGenerated.line > 0 && aGenerated.column >= 0
- && aOriginal.line > 0 && aOriginal.column >= 0
- && aSource) {
- // Cases 2 and 3.
- return;
- }
- else {
- throw new Error('Invalid mapping: ' + JSON.stringify({
- generated: aGenerated,
- source: aSource,
- original: aOriginal,
- name: aName
- }));
- }
- };
-
- /**
- * Serialize the accumulated mappings in to the stream of base 64 VLQs
- * specified by the source map format.
- */
- SourceMapGenerator.prototype._serializeMappings =
- function SourceMapGenerator_serializeMappings() {
- var previousGeneratedColumn = 0;
- var previousGeneratedLine = 1;
- var previousOriginalColumn = 0;
- var previousOriginalLine = 0;
- var previousName = 0;
- var previousSource = 0;
- var result = '';
- var mapping;
-
- // The mappings must be guaranteed to be in sorted order before we start
- // serializing them or else the generated line numbers (which are defined
- // via the ';' separators) will be all messed up. Note: it might be more
- // performant to maintain the sorting as we insert them, rather than as we
- // serialize them, but the big O is the same either way.
- this._mappings.sort(util.compareByGeneratedPositions);
-
- for (var i = 0, len = this._mappings.length; i < len; i++) {
- mapping = this._mappings[i];
-
- if (mapping.generatedLine !== previousGeneratedLine) {
- previousGeneratedColumn = 0;
- while (mapping.generatedLine !== previousGeneratedLine) {
- result += ';';
- previousGeneratedLine++;
- }
- }
- else {
- if (i > 0) {
- if (!util.compareByGeneratedPositions(mapping, this._mappings[i - 1])) {
- continue;
- }
- result += ',';
- }
- }
-
- result += base64VLQ.encode(mapping.generatedColumn
- - previousGeneratedColumn);
- previousGeneratedColumn = mapping.generatedColumn;
-
- if (mapping.source) {
- result += base64VLQ.encode(this._sources.indexOf(mapping.source)
- - previousSource);
- previousSource = this._sources.indexOf(mapping.source);
-
- // lines are stored 0-based in SourceMap spec version 3
- result += base64VLQ.encode(mapping.originalLine - 1
- - previousOriginalLine);
- previousOriginalLine = mapping.originalLine - 1;
-
- result += base64VLQ.encode(mapping.originalColumn
- - previousOriginalColumn);
- previousOriginalColumn = mapping.originalColumn;
-
- if (mapping.name) {
- result += base64VLQ.encode(this._names.indexOf(mapping.name)
- - previousName);
- previousName = this._names.indexOf(mapping.name);
- }
- }
- }
-
- return result;
- };
-
- SourceMapGenerator.prototype._generateSourcesContent =
- function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
- return aSources.map(function (source) {
- if (!this._sourcesContents) {
- return null;
- }
- if (aSourceRoot) {
- source = util.relative(aSourceRoot, source);
- }
- var key = util.toSetString(source);
- return Object.prototype.hasOwnProperty.call(this._sourcesContents,
- key)
- ? this._sourcesContents[key]
- : null;
- }, this);
- };
-
- /**
- * Externalize the source map.
- */
- SourceMapGenerator.prototype.toJSON =
- function SourceMapGenerator_toJSON() {
- var map = {
- version: this._version,
- file: this._file,
- sources: this._sources.toArray(),
- names: this._names.toArray(),
- mappings: this._serializeMappings()
- };
- if (this._sourceRoot) {
- map.sourceRoot = this._sourceRoot;
- }
- if (this._sourcesContents) {
- map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
- }
-
- return map;
- };
-
- /**
- * Render the source map being generated to a string.
- */
- SourceMapGenerator.prototype.toString =
- function SourceMapGenerator_toString() {
- return JSON.stringify(this);
- };
-
- exports.SourceMapGenerator = SourceMapGenerator;
-
-});
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-node.js b/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-node.js
deleted file mode 100644
index 1d98123b..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-node.js
+++ /dev/null
@@ -1,387 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-if (typeof define !== 'function') {
- var define = require('amdefine')(module, require);
-}
-define(function (require, exports, module) {
-
- var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;
- var util = require('./util');
-
- /**
- * SourceNodes provide a way to abstract over interpolating/concatenating
- * snippets of generated JavaScript source code while maintaining the line and
- * column information associated with the original source code.
- *
- * @param aLine The original line number.
- * @param aColumn The original column number.
- * @param aSource The original source's filename.
- * @param aChunks Optional. An array of strings which are snippets of
- * generated JS, or other SourceNodes.
- * @param aName The original identifier.
- */
- function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
- this.children = [];
- this.sourceContents = {};
- this.line = aLine === undefined ? null : aLine;
- this.column = aColumn === undefined ? null : aColumn;
- this.source = aSource === undefined ? null : aSource;
- this.name = aName === undefined ? null : aName;
- if (aChunks != null) this.add(aChunks);
- }
-
- /**
- * Creates a SourceNode from generated code and a SourceMapConsumer.
- *
- * @param aGeneratedCode The generated code
- * @param aSourceMapConsumer The SourceMap for the generated code
- */
- SourceNode.fromStringWithSourceMap =
- function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer) {
- // The SourceNode we want to fill with the generated code
- // and the SourceMap
- var node = new SourceNode();
-
- // The generated code
- // Processed fragments are removed from this array.
- var remainingLines = aGeneratedCode.split('\n');
-
- // We need to remember the position of "remainingLines"
- var lastGeneratedLine = 1, lastGeneratedColumn = 0;
-
- // The generate SourceNodes we need a code range.
- // To extract it current and last mapping is used.
- // Here we store the last mapping.
- var lastMapping = null;
-
- aSourceMapConsumer.eachMapping(function (mapping) {
- if (lastMapping !== null) {
- // We add the code from "lastMapping" to "mapping":
- // First check if there is a new line in between.
- if (lastGeneratedLine < mapping.generatedLine) {
- var code = "";
- // Associate first line with "lastMapping"
- addMappingWithCode(lastMapping, remainingLines.shift() + "\n");
- lastGeneratedLine++;
- lastGeneratedColumn = 0;
- // The remaining code is added without mapping
- } else {
- // There is no new line in between.
- // Associate the code between "lastGeneratedColumn" and
- // "mapping.generatedColumn" with "lastMapping"
- var nextLine = remainingLines[0];
- var code = nextLine.substr(0, mapping.generatedColumn -
- lastGeneratedColumn);
- remainingLines[0] = nextLine.substr(mapping.generatedColumn -
- lastGeneratedColumn);
- lastGeneratedColumn = mapping.generatedColumn;
- addMappingWithCode(lastMapping, code);
- // No more remaining code, continue
- lastMapping = mapping;
- return;
- }
- }
- // We add the generated code until the first mapping
- // to the SourceNode without any mapping.
- // Each line is added as separate string.
- while (lastGeneratedLine < mapping.generatedLine) {
- node.add(remainingLines.shift() + "\n");
- lastGeneratedLine++;
- }
- if (lastGeneratedColumn < mapping.generatedColumn) {
- var nextLine = remainingLines[0];
- node.add(nextLine.substr(0, mapping.generatedColumn));
- remainingLines[0] = nextLine.substr(mapping.generatedColumn);
- lastGeneratedColumn = mapping.generatedColumn;
- }
- lastMapping = mapping;
- }, this);
- // We have processed all mappings.
- if (remainingLines.length > 0) {
- if (lastMapping) {
- // Associate the remaining code in the current line with "lastMapping"
- var lastLine = remainingLines.shift();
- if (remainingLines.length > 0) lastLine += "\n";
- addMappingWithCode(lastMapping, lastLine);
- }
- // and add the remaining lines without any mapping
- node.add(remainingLines.join("\n"));
- }
-
- // Copy sourcesContent into SourceNode
- aSourceMapConsumer.sources.forEach(function (sourceFile) {
- var content = aSourceMapConsumer.sourceContentFor(sourceFile);
- if (content) {
- node.setSourceContent(sourceFile, content);
- }
- });
-
- return node;
-
- function addMappingWithCode(mapping, code) {
- if (mapping === null || mapping.source === undefined) {
- node.add(code);
- } else {
- node.add(new SourceNode(mapping.originalLine,
- mapping.originalColumn,
- mapping.source,
- code,
- mapping.name));
- }
- }
- };
-
- /**
- * Add a chunk of generated JS to this source node.
- *
- * @param aChunk A string snippet of generated JS code, another instance of
- * SourceNode, or an array where each member is one of those things.
- */
- SourceNode.prototype.add = function SourceNode_add(aChunk) {
- if (Array.isArray(aChunk)) {
- aChunk.forEach(function (chunk) {
- this.add(chunk);
- }, this);
- }
- else if (aChunk instanceof SourceNode || typeof aChunk === "string") {
- if (aChunk) {
- this.children.push(aChunk);
- }
- }
- else {
- throw new TypeError(
- "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
- );
- }
- return this;
- };
-
- /**
- * Add a chunk of generated JS to the beginning of this source node.
- *
- * @param aChunk A string snippet of generated JS code, another instance of
- * SourceNode, or an array where each member is one of those things.
- */
- SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
- if (Array.isArray(aChunk)) {
- for (var i = aChunk.length-1; i >= 0; i--) {
- this.prepend(aChunk[i]);
- }
- }
- else if (aChunk instanceof SourceNode || typeof aChunk === "string") {
- this.children.unshift(aChunk);
- }
- else {
- throw new TypeError(
- "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
- );
- }
- return this;
- };
-
- /**
- * Walk over the tree of JS snippets in this node and its children. The
- * walking function is called once for each snippet of JS and is passed that
- * snippet and the its original associated source's line/column location.
- *
- * @param aFn The traversal function.
- */
- SourceNode.prototype.walk = function SourceNode_walk(aFn) {
- var chunk;
- for (var i = 0, len = this.children.length; i < len; i++) {
- chunk = this.children[i];
- if (chunk instanceof SourceNode) {
- chunk.walk(aFn);
- }
- else {
- if (chunk !== '') {
- aFn(chunk, { source: this.source,
- line: this.line,
- column: this.column,
- name: this.name });
- }
- }
- }
- };
-
- /**
- * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
- * each of `this.children`.
- *
- * @param aSep The separator.
- */
- SourceNode.prototype.join = function SourceNode_join(aSep) {
- var newChildren;
- var i;
- var len = this.children.length;
- if (len > 0) {
- newChildren = [];
- for (i = 0; i < len-1; i++) {
- newChildren.push(this.children[i]);
- newChildren.push(aSep);
- }
- newChildren.push(this.children[i]);
- this.children = newChildren;
- }
- return this;
- };
-
- /**
- * Call String.prototype.replace on the very right-most source snippet. Useful
- * for trimming whitespace from the end of a source node, etc.
- *
- * @param aPattern The pattern to replace.
- * @param aReplacement The thing to replace the pattern with.
- */
- SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
- var lastChild = this.children[this.children.length - 1];
- if (lastChild instanceof SourceNode) {
- lastChild.replaceRight(aPattern, aReplacement);
- }
- else if (typeof lastChild === 'string') {
- this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
- }
- else {
- this.children.push(''.replace(aPattern, aReplacement));
- }
- return this;
- };
-
- /**
- * Set the source content for a source file. This will be added to the SourceMapGenerator
- * in the sourcesContent field.
- *
- * @param aSourceFile The filename of the source file
- * @param aSourceContent The content of the source file
- */
- SourceNode.prototype.setSourceContent =
- function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
- this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
- };
-
- /**
- * Walk over the tree of SourceNodes. The walking function is called for each
- * source file content and is passed the filename and source content.
- *
- * @param aFn The traversal function.
- */
- SourceNode.prototype.walkSourceContents =
- function SourceNode_walkSourceContents(aFn) {
- for (var i = 0, len = this.children.length; i < len; i++) {
- if (this.children[i] instanceof SourceNode) {
- this.children[i].walkSourceContents(aFn);
- }
- }
-
- var sources = Object.keys(this.sourceContents);
- for (var i = 0, len = sources.length; i < len; i++) {
- aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
- }
- };
-
- /**
- * Return the string representation of this source node. Walks over the tree
- * and concatenates all the various snippets together to one string.
- */
- SourceNode.prototype.toString = function SourceNode_toString() {
- var str = "";
- this.walk(function (chunk) {
- str += chunk;
- });
- return str;
- };
-
- /**
- * Returns the string representation of this source node along with a source
- * map.
- */
- SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
- var generated = {
- code: "",
- line: 1,
- column: 0
- };
- var map = new SourceMapGenerator(aArgs);
- var sourceMappingActive = false;
- var lastOriginalSource = null;
- var lastOriginalLine = null;
- var lastOriginalColumn = null;
- var lastOriginalName = null;
- this.walk(function (chunk, original) {
- generated.code += chunk;
- if (original.source !== null
- && original.line !== null
- && original.column !== null) {
- if(lastOriginalSource !== original.source
- || lastOriginalLine !== original.line
- || lastOriginalColumn !== original.column
- || lastOriginalName !== original.name) {
- map.addMapping({
- source: original.source,
- original: {
- line: original.line,
- column: original.column
- },
- generated: {
- line: generated.line,
- column: generated.column
- },
- name: original.name
- });
- }
- lastOriginalSource = original.source;
- lastOriginalLine = original.line;
- lastOriginalColumn = original.column;
- lastOriginalName = original.name;
- sourceMappingActive = true;
- } else if (sourceMappingActive) {
- map.addMapping({
- generated: {
- line: generated.line,
- column: generated.column
- }
- });
- lastOriginalSource = null;
- sourceMappingActive = false;
- }
- chunk.split('').forEach(function (ch, idx, array) {
- if (ch === '\n') {
- generated.line++;
- generated.column = 0;
- // Mappings end at eol
- if (idx + 1 === array.length) {
- lastOriginalSource = null;
- sourceMappingActive = false;
- } else if (sourceMappingActive) {
- map.addMapping({
- source: original.source,
- original: {
- line: original.line,
- column: original.column
- },
- generated: {
- line: generated.line,
- column: generated.column
- },
- name: original.name
- });
- }
- } else {
- generated.column++;
- }
- });
- });
- this.walkSourceContents(function (sourceFile, sourceContent) {
- map.setSourceContent(sourceFile, sourceContent);
- });
-
- return { code: generated.code, map: map };
- };
-
- exports.SourceNode = SourceNode;
-
-});
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map/util.js b/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map/util.js
deleted file mode 100644
index 4316445f..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/lib/source-map/util.js
+++ /dev/null
@@ -1,302 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-if (typeof define !== 'function') {
- var define = require('amdefine')(module, require);
-}
-define(function (require, exports, module) {
-
- /**
- * This is a helper function for getting values from parameter/options
- * objects.
- *
- * @param args The object we are extracting values from
- * @param name The name of the property we are getting.
- * @param defaultValue An optional value to return if the property is missing
- * from the object. If this is not specified and the property is missing, an
- * error will be thrown.
- */
- function getArg(aArgs, aName, aDefaultValue) {
- if (aName in aArgs) {
- return aArgs[aName];
- } else if (arguments.length === 3) {
- return aDefaultValue;
- } else {
- throw new Error('"' + aName + '" is a required argument.');
- }
- }
- exports.getArg = getArg;
-
- var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/;
- var dataUrlRegexp = /^data:.+\,.+$/;
-
- function urlParse(aUrl) {
- var match = aUrl.match(urlRegexp);
- if (!match) {
- return null;
- }
- return {
- scheme: match[1],
- auth: match[2],
- host: match[3],
- port: match[4],
- path: match[5]
- };
- }
- exports.urlParse = urlParse;
-
- function urlGenerate(aParsedUrl) {
- var url = '';
- if (aParsedUrl.scheme) {
- url += aParsedUrl.scheme + ':';
- }
- url += '//';
- if (aParsedUrl.auth) {
- url += aParsedUrl.auth + '@';
- }
- if (aParsedUrl.host) {
- url += aParsedUrl.host;
- }
- if (aParsedUrl.port) {
- url += ":" + aParsedUrl.port
- }
- if (aParsedUrl.path) {
- url += aParsedUrl.path;
- }
- return url;
- }
- exports.urlGenerate = urlGenerate;
-
- /**
- * Normalizes a path, or the path portion of a URL:
- *
- * - Replaces consequtive slashes with one slash.
- * - Removes unnecessary '.' parts.
- * - Removes unnecessary '/..' parts.
- *
- * Based on code in the Node.js 'path' core module.
- *
- * @param aPath The path or url to normalize.
- */
- function normalize(aPath) {
- var path = aPath;
- var url = urlParse(aPath);
- if (url) {
- if (!url.path) {
- return aPath;
- }
- path = url.path;
- }
- var isAbsolute = (path.charAt(0) === '/');
-
- var parts = path.split(/\/+/);
- for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
- part = parts[i];
- if (part === '.') {
- parts.splice(i, 1);
- } else if (part === '..') {
- up++;
- } else if (up > 0) {
- if (part === '') {
- // The first part is blank if the path is absolute. Trying to go
- // above the root is a no-op. Therefore we can remove all '..' parts
- // directly after the root.
- parts.splice(i + 1, up);
- up = 0;
- } else {
- parts.splice(i, 2);
- up--;
- }
- }
- }
- path = parts.join('/');
-
- if (path === '') {
- path = isAbsolute ? '/' : '.';
- }
-
- if (url) {
- url.path = path;
- return urlGenerate(url);
- }
- return path;
- }
- exports.normalize = normalize;
-
- /**
- * Joins two paths/URLs.
- *
- * @param aRoot The root path or URL.
- * @param aPath The path or URL to be joined with the root.
- *
- * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
- * scheme-relative URL: Then the scheme of aRoot, if any, is prepended
- * first.
- * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
- * is updated with the result and aRoot is returned. Otherwise the result
- * is returned.
- * - If aPath is absolute, the result is aPath.
- * - Otherwise the two paths are joined with a slash.
- * - Joining for example 'http://' and 'www.example.com' is also supported.
- */
- function join(aRoot, aPath) {
- var aPathUrl = urlParse(aPath);
- var aRootUrl = urlParse(aRoot);
- if (aRootUrl) {
- aRoot = aRootUrl.path || '/';
- }
-
- // `join(foo, '//www.example.org')`
- if (aPathUrl && !aPathUrl.scheme) {
- if (aRootUrl) {
- aPathUrl.scheme = aRootUrl.scheme;
- }
- return urlGenerate(aPathUrl);
- }
-
- if (aPathUrl || aPath.match(dataUrlRegexp)) {
- return aPath;
- }
-
- // `join('http://', 'www.example.com')`
- if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
- aRootUrl.host = aPath;
- return urlGenerate(aRootUrl);
- }
-
- var joined = aPath.charAt(0) === '/'
- ? aPath
- : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
-
- if (aRootUrl) {
- aRootUrl.path = joined;
- return urlGenerate(aRootUrl);
- }
- return joined;
- }
- exports.join = join;
-
- /**
- * Because behavior goes wacky when you set `__proto__` on objects, we
- * have to prefix all the strings in our set with an arbitrary character.
- *
- * See https://github.com/mozilla/source-map/pull/31 and
- * https://github.com/mozilla/source-map/issues/30
- *
- * @param String aStr
- */
- function toSetString(aStr) {
- return '$' + aStr;
- }
- exports.toSetString = toSetString;
-
- function fromSetString(aStr) {
- return aStr.substr(1);
- }
- exports.fromSetString = fromSetString;
-
- function relative(aRoot, aPath) {
- aRoot = aRoot.replace(/\/$/, '');
-
- var url = urlParse(aRoot);
- if (aPath.charAt(0) == "/" && url && url.path == "/") {
- return aPath.slice(1);
- }
-
- return aPath.indexOf(aRoot + '/') === 0
- ? aPath.substr(aRoot.length + 1)
- : aPath;
- }
- exports.relative = relative;
-
- function strcmp(aStr1, aStr2) {
- var s1 = aStr1 || "";
- var s2 = aStr2 || "";
- return (s1 > s2) - (s1 < s2);
- }
-
- /**
- * Comparator between two mappings where the original positions are compared.
- *
- * Optionally pass in `true` as `onlyCompareGenerated` to consider two
- * mappings with the same original source/line/column, but different generated
- * line and column the same. Useful when searching for a mapping with a
- * stubbed out mapping.
- */
- function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
- var cmp;
-
- cmp = strcmp(mappingA.source, mappingB.source);
- if (cmp) {
- return cmp;
- }
-
- cmp = mappingA.originalLine - mappingB.originalLine;
- if (cmp) {
- return cmp;
- }
-
- cmp = mappingA.originalColumn - mappingB.originalColumn;
- if (cmp || onlyCompareOriginal) {
- return cmp;
- }
-
- cmp = strcmp(mappingA.name, mappingB.name);
- if (cmp) {
- return cmp;
- }
-
- cmp = mappingA.generatedLine - mappingB.generatedLine;
- if (cmp) {
- return cmp;
- }
-
- return mappingA.generatedColumn - mappingB.generatedColumn;
- };
- exports.compareByOriginalPositions = compareByOriginalPositions;
-
- /**
- * Comparator between two mappings where the generated positions are
- * compared.
- *
- * Optionally pass in `true` as `onlyCompareGenerated` to consider two
- * mappings with the same generated line and column, but different
- * source/name/original line and column the same. Useful when searching for a
- * mapping with a stubbed out mapping.
- */
- function compareByGeneratedPositions(mappingA, mappingB, onlyCompareGenerated) {
- var cmp;
-
- cmp = mappingA.generatedLine - mappingB.generatedLine;
- if (cmp) {
- return cmp;
- }
-
- cmp = mappingA.generatedColumn - mappingB.generatedColumn;
- if (cmp || onlyCompareGenerated) {
- return cmp;
- }
-
- cmp = strcmp(mappingA.source, mappingB.source);
- if (cmp) {
- return cmp;
- }
-
- cmp = mappingA.originalLine - mappingB.originalLine;
- if (cmp) {
- return cmp;
- }
-
- cmp = mappingA.originalColumn - mappingB.originalColumn;
- if (cmp) {
- return cmp;
- }
-
- return strcmp(mappingA.name, mappingB.name);
- };
- exports.compareByGeneratedPositions = compareByGeneratedPositions;
-
-});
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/LICENSE b/builder/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/LICENSE
deleted file mode 100644
index f33d665d..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/LICENSE
+++ /dev/null
@@ -1,58 +0,0 @@
-amdefine is released under two licenses: new BSD, and MIT. You may pick the
-license that best suits your development needs. The text of both licenses are
-provided below.
-
-
-The "New" BSD License:
-----------------------
-
-Copyright (c) 2011, The Dojo Foundation
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
- * Neither the name of the Dojo Foundation nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-
-MIT License
------------
-
-Copyright (c) 2011, The Dojo Foundation
-
-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.
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/README.md b/builder/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/README.md
deleted file mode 100644
index c6995c07..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/README.md
+++ /dev/null
@@ -1,171 +0,0 @@
-# amdefine
-
-A module that can be used to implement AMD's define() in Node. This allows you
-to code to the AMD API and have the module work in node programs without
-requiring those other programs to use AMD.
-
-## Usage
-
-**1)** Update your package.json to indicate amdefine as a dependency:
-
-```javascript
- "dependencies": {
- "amdefine": ">=0.1.0"
- }
-```
-
-Then run `npm install` to get amdefine into your project.
-
-**2)** At the top of each module that uses define(), place this code:
-
-```javascript
-if (typeof define !== 'function') { var define = require('amdefine')(module) }
-```
-
-**Only use these snippets** when loading amdefine. If you preserve the basic structure,
-with the braces, it will be stripped out when using the [RequireJS optimizer](#optimizer).
-
-You can add spaces, line breaks and even require amdefine with a local path, but
-keep the rest of the structure to get the stripping behavior.
-
-As you may know, because `if` statements in JavaScript don't have their own scope, the var
-declaration in the above snippet is made whether the `if` expression is truthy or not. If
-RequireJS is loaded then the declaration is superfluous because `define` is already already
-declared in the same scope in RequireJS. Fortunately JavaScript handles multiple `var`
-declarations of the same variable in the same scope gracefully.
-
-If you want to deliver amdefine.js with your code rather than specifying it as a dependency
-with npm, then just download the latest release and refer to it using a relative path:
-
-[Latest Version](https://github.com/jrburke/amdefine/raw/latest/amdefine.js)
-
-### amdefine/intercept
-
-Consider this very experimental.
-
-Instead of pasting the piece of text for the amdefine setup of a `define`
-variable in each module you create or consume, you can use `amdefine/intercept`
-instead. It will automatically insert the above snippet in each .js file loaded
-by Node.
-
-**Warning**: you should only use this if you are creating an application that
-is consuming AMD style defined()'d modules that are distributed via npm and want
-to run that code in Node.
-
-For library code where you are not sure if it will be used by others in Node or
-in the browser, then explicitly depending on amdefine and placing the code
-snippet above is suggested path, instead of using `amdefine/intercept`. The
-intercept module affects all .js files loaded in the Node app, and it is
-inconsiderate to modify global state like that unless you are also controlling
-the top level app.
-
-#### Why distribute AMD-style nodes via npm?
-
-npm has a lot of weaknesses for front-end use (installed layout is not great,
-should have better support for the `baseUrl + moduleID + '.js' style of loading,
-single file JS installs), but some people want a JS package manager and are
-willing to live with those constraints. If that is you, but still want to author
-in AMD style modules to get dynamic require([]), better direct source usage and
-powerful loader plugin support in the browser, then this tool can help.
-
-#### amdefine/intercept usage
-
-Just require it in your top level app module (for example index.js, server.js):
-
-```javascript
-require('amdefine/intercept');
-```
-
-The module does not return a value, so no need to assign the result to a local
-variable.
-
-Then just require() code as you normally would with Node's require(). Any .js
-loaded after the intercept require will have the amdefine check injected in
-the .js source as it is loaded. It does not modify the source on disk, just
-prepends some content to the text of the module as it is loaded by Node.
-
-#### How amdefine/intercept works
-
-It overrides the `Module._extensions['.js']` in Node to automatically prepend
-the amdefine snippet above. So, it will affect any .js file loaded by your
-app.
-
-## define() usage
-
-It is best if you use the anonymous forms of define() in your module:
-
-```javascript
-define(function (require) {
- var dependency = require('dependency');
-});
-```
-
-or
-
-```javascript
-define(['dependency'], function (dependency) {
-
-});
-```
-
-## RequireJS optimizer integration.
-
-Version 1.0.3 of the [RequireJS optimizer](http://requirejs.org/docs/optimization.html)
-will have support for stripping the `if (typeof define !== 'function')` check
-mentioned above, so you can include this snippet for code that runs in the
-browser, but avoid taking the cost of the if() statement once the code is
-optimized for deployment.
-
-## Node 0.4 Support
-
-If you want to support Node 0.4, then add `require` as the second parameter to amdefine:
-
-```javascript
-//Only if you want Node 0.4. If using 0.5 or later, use the above snippet.
-if (typeof define !== 'function') { var define = require('amdefine')(module, require) }
-```
-
-## Limitations
-
-### Synchronous vs Asynchronous
-
-amdefine creates a define() function that is callable by your code. It will
-execute and trace dependencies and call the factory function *synchronously*,
-to keep the behavior in line with Node's synchronous dependency tracing.
-
-The exception: calling AMD's callback-style require() from inside a factory
-function. The require callback is called on process.nextTick():
-
-```javascript
-define(function (require) {
- require(['a'], function(a) {
- //'a' is loaded synchronously, but
- //this callback is called on process.nextTick().
- });
-});
-```
-
-### Loader Plugins
-
-Loader plugins are supported as long as they call their load() callbacks
-synchronously. So ones that do network requests will not work. However plugins
-like [text](http://requirejs.org/docs/api.html#text) can load text files locally.
-
-The plugin API's `load.fromText()` is **not supported** in amdefine, so this means
-transpiler plugins like the [CoffeeScript loader plugin](https://github.com/jrburke/require-cs)
-will not work. This may be fixable, but it is a bit complex, and I do not have
-enough node-fu to figure it out yet. See the source for amdefine.js if you want
-to get an idea of the issues involved.
-
-## Tests
-
-To run the tests, cd to **tests** and run:
-
-```
-node all.js
-node all-intercept.js
-```
-
-## License
-
-New BSD and MIT. Check the LICENSE file for all the details.
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/amdefine.js b/builder/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/amdefine.js
deleted file mode 100644
index 53bf5a68..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/amdefine.js
+++ /dev/null
@@ -1,299 +0,0 @@
-/** vim: et:ts=4:sw=4:sts=4
- * @license amdefine 0.1.0 Copyright (c) 2011, The Dojo Foundation All Rights Reserved.
- * Available via the MIT or new BSD license.
- * see: http://github.com/jrburke/amdefine for details
- */
-
-/*jslint node: true */
-/*global module, process */
-'use strict';
-
-/**
- * Creates a define for node.
- * @param {Object} module the "module" object that is defined by Node for the
- * current module.
- * @param {Function} [requireFn]. Node's require function for the current module.
- * It only needs to be passed in Node versions before 0.5, when module.require
- * did not exist.
- * @returns {Function} a define function that is usable for the current node
- * module.
- */
-function amdefine(module, requireFn) {
- 'use strict';
- var defineCache = {},
- loaderCache = {},
- alreadyCalled = false,
- path = require('path'),
- makeRequire, stringRequire;
-
- /**
- * Trims the . and .. from an array of path segments.
- * It will keep a leading path segment if a .. will become
- * the first path segment, to help with module name lookups,
- * which act like paths, but can be remapped. But the end result,
- * all paths that use this function should look normalized.
- * NOTE: this method MODIFIES the input array.
- * @param {Array} ary the array of path segments.
- */
- function trimDots(ary) {
- var i, part;
- for (i = 0; ary[i]; i+= 1) {
- part = ary[i];
- if (part === '.') {
- ary.splice(i, 1);
- i -= 1;
- } else if (part === '..') {
- if (i === 1 && (ary[2] === '..' || ary[0] === '..')) {
- //End of the line. Keep at least one non-dot
- //path segment at the front so it can be mapped
- //correctly to disk. Otherwise, there is likely
- //no path mapping for a path starting with '..'.
- //This can still fail, but catches the most reasonable
- //uses of ..
- break;
- } else if (i > 0) {
- ary.splice(i - 1, 2);
- i -= 2;
- }
- }
- }
- }
-
- function normalize(name, baseName) {
- var baseParts;
-
- //Adjust any relative paths.
- if (name && name.charAt(0) === '.') {
- //If have a base name, try to normalize against it,
- //otherwise, assume it is a top-level require that will
- //be relative to baseUrl in the end.
- if (baseName) {
- baseParts = baseName.split('/');
- baseParts = baseParts.slice(0, baseParts.length - 1);
- baseParts = baseParts.concat(name.split('/'));
- trimDots(baseParts);
- name = baseParts.join('/');
- }
- }
-
- return name;
- }
-
- /**
- * Create the normalize() function passed to a loader plugin's
- * normalize method.
- */
- function makeNormalize(relName) {
- return function (name) {
- return normalize(name, relName);
- };
- }
-
- function makeLoad(id) {
- function load(value) {
- loaderCache[id] = value;
- }
-
- load.fromText = function (id, text) {
- //This one is difficult because the text can/probably uses
- //define, and any relative paths and requires should be relative
- //to that id was it would be found on disk. But this would require
- //bootstrapping a module/require fairly deeply from node core.
- //Not sure how best to go about that yet.
- throw new Error('amdefine does not implement load.fromText');
- };
-
- return load;
- }
-
- makeRequire = function (systemRequire, exports, module, relId) {
- function amdRequire(deps, callback) {
- if (typeof deps === 'string') {
- //Synchronous, single module require('')
- return stringRequire(systemRequire, exports, module, deps, relId);
- } else {
- //Array of dependencies with a callback.
-
- //Convert the dependencies to modules.
- deps = deps.map(function (depName) {
- return stringRequire(systemRequire, exports, module, depName, relId);
- });
-
- //Wait for next tick to call back the require call.
- process.nextTick(function () {
- callback.apply(null, deps);
- });
- }
- }
-
- amdRequire.toUrl = function (filePath) {
- if (filePath.indexOf('.') === 0) {
- return normalize(filePath, path.dirname(module.filename));
- } else {
- return filePath;
- }
- };
-
- return amdRequire;
- };
-
- //Favor explicit value, passed in if the module wants to support Node 0.4.
- requireFn = requireFn || function req() {
- return module.require.apply(module, arguments);
- };
-
- function runFactory(id, deps, factory) {
- var r, e, m, result;
-
- if (id) {
- e = loaderCache[id] = {};
- m = {
- id: id,
- uri: __filename,
- exports: e
- };
- r = makeRequire(requireFn, e, m, id);
- } else {
- //Only support one define call per file
- if (alreadyCalled) {
- throw new Error('amdefine with no module ID cannot be called more than once per file.');
- }
- alreadyCalled = true;
-
- //Use the real variables from node
- //Use module.exports for exports, since
- //the exports in here is amdefine exports.
- e = module.exports;
- m = module;
- r = makeRequire(requireFn, e, m, module.id);
- }
-
- //If there are dependencies, they are strings, so need
- //to convert them to dependency values.
- if (deps) {
- deps = deps.map(function (depName) {
- return r(depName);
- });
- }
-
- //Call the factory with the right dependencies.
- if (typeof factory === 'function') {
- result = factory.apply(m.exports, deps);
- } else {
- result = factory;
- }
-
- if (result !== undefined) {
- m.exports = result;
- if (id) {
- loaderCache[id] = m.exports;
- }
- }
- }
-
- stringRequire = function (systemRequire, exports, module, id, relId) {
- //Split the ID by a ! so that
- var index = id.indexOf('!'),
- originalId = id,
- prefix, plugin;
-
- if (index === -1) {
- id = normalize(id, relId);
-
- //Straight module lookup. If it is one of the special dependencies,
- //deal with it, otherwise, delegate to node.
- if (id === 'require') {
- return makeRequire(systemRequire, exports, module, relId);
- } else if (id === 'exports') {
- return exports;
- } else if (id === 'module') {
- return module;
- } else if (loaderCache.hasOwnProperty(id)) {
- return loaderCache[id];
- } else if (defineCache[id]) {
- runFactory.apply(null, defineCache[id]);
- return loaderCache[id];
- } else {
- if(systemRequire) {
- return systemRequire(originalId);
- } else {
- throw new Error('No module with ID: ' + id);
- }
- }
- } else {
- //There is a plugin in play.
- prefix = id.substring(0, index);
- id = id.substring(index + 1, id.length);
-
- plugin = stringRequire(systemRequire, exports, module, prefix, relId);
-
- if (plugin.normalize) {
- id = plugin.normalize(id, makeNormalize(relId));
- } else {
- //Normalize the ID normally.
- id = normalize(id, relId);
- }
-
- if (loaderCache[id]) {
- return loaderCache[id];
- } else {
- plugin.load(id, makeRequire(systemRequire, exports, module, relId), makeLoad(id), {});
-
- return loaderCache[id];
- }
- }
- };
-
- //Create a define function specific to the module asking for amdefine.
- function define(id, deps, factory) {
- if (Array.isArray(id)) {
- factory = deps;
- deps = id;
- id = undefined;
- } else if (typeof id !== 'string') {
- factory = id;
- id = deps = undefined;
- }
-
- if (deps && !Array.isArray(deps)) {
- factory = deps;
- deps = undefined;
- }
-
- if (!deps) {
- deps = ['require', 'exports', 'module'];
- }
-
- //Set up properties for this module. If an ID, then use
- //internal cache. If no ID, then use the external variables
- //for this node module.
- if (id) {
- //Put the module in deep freeze until there is a
- //require call for it.
- defineCache[id] = [id, deps, factory];
- } else {
- runFactory(id, deps, factory);
- }
- }
-
- //define.require, which has access to all the values in the
- //cache. Useful for AMD modules that all have IDs in the file,
- //but need to finally export a value to node based on one of those
- //IDs.
- define.require = function (id) {
- if (loaderCache[id]) {
- return loaderCache[id];
- }
-
- if (defineCache[id]) {
- runFactory.apply(null, defineCache[id]);
- return loaderCache[id];
- }
- };
-
- define.amd = {};
-
- return define;
-}
-
-module.exports = amdefine;
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/intercept.js b/builder/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/intercept.js
deleted file mode 100644
index 771a9830..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/intercept.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/*jshint node: true */
-var inserted,
- Module = require('module'),
- fs = require('fs'),
- existingExtFn = Module._extensions['.js'],
- amdefineRegExp = /amdefine\.js/;
-
-inserted = "if (typeof define !== 'function') {var define = require('amdefine')(module)}";
-
-//From the node/lib/module.js source:
-function stripBOM(content) {
- // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
- // because the buffer-to-string conversion in `fs.readFileSync()`
- // translates it to FEFF, the UTF-16 BOM.
- if (content.charCodeAt(0) === 0xFEFF) {
- content = content.slice(1);
- }
- return content;
-}
-
-//Also adapted from the node/lib/module.js source:
-function intercept(module, filename) {
- var content = stripBOM(fs.readFileSync(filename, 'utf8'));
-
- if (!amdefineRegExp.test(module.id)) {
- content = inserted + content;
- }
-
- module._compile(content, filename);
-}
-
-intercept._id = 'amdefine/intercept';
-
-if (!existingExtFn._id || existingExtFn._id !== intercept._id) {
- Module._extensions['.js'] = intercept;
-}
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/package.json b/builder/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/package.json
deleted file mode 100644
index 7f945c8f..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/package.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "name": "amdefine",
- "description": "Provide AMD's define() API for declaring modules in the AMD format",
- "version": "0.1.0",
- "homepage": "http://github.com/jrburke/amdefine",
- "author": {
- "name": "James Burke",
- "email": "jrburke@gmail.com",
- "url": "http://github.com/jrburke"
- },
- "licenses": [
- {
- "type": "BSD",
- "url": "https://github.com/jrburke/amdefine/blob/master/LICENSE"
- },
- {
- "type": "MIT",
- "url": "https://github.com/jrburke/amdefine/blob/master/LICENSE"
- }
- ],
- "repository": {
- "type": "git",
- "url": "https://github.com/jrburke/amdefine.git"
- },
- "main": "./amdefine.js",
- "engines": {
- "node": ">=0.4.2"
- },
- "readme": "# amdefine\n\nA module that can be used to implement AMD's define() in Node. This allows you\nto code to the AMD API and have the module work in node programs without\nrequiring those other programs to use AMD.\n\n## Usage\n\n**1)** Update your package.json to indicate amdefine as a dependency:\n\n```javascript\n \"dependencies\": {\n \"amdefine\": \">=0.1.0\"\n }\n```\n\nThen run `npm install` to get amdefine into your project.\n\n**2)** At the top of each module that uses define(), place this code:\n\n```javascript\nif (typeof define !== 'function') { var define = require('amdefine')(module) }\n```\n\n**Only use these snippets** when loading amdefine. If you preserve the basic structure,\nwith the braces, it will be stripped out when using the [RequireJS optimizer](#optimizer).\n\nYou can add spaces, line breaks and even require amdefine with a local path, but\nkeep the rest of the structure to get the stripping behavior.\n\nAs you may know, because `if` statements in JavaScript don't have their own scope, the var\ndeclaration in the above snippet is made whether the `if` expression is truthy or not. If\nRequireJS is loaded then the declaration is superfluous because `define` is already already\ndeclared in the same scope in RequireJS. Fortunately JavaScript handles multiple `var`\ndeclarations of the same variable in the same scope gracefully.\n\nIf you want to deliver amdefine.js with your code rather than specifying it as a dependency\nwith npm, then just download the latest release and refer to it using a relative path:\n\n[Latest Version](https://github.com/jrburke/amdefine/raw/latest/amdefine.js)\n\n### amdefine/intercept\n\nConsider this very experimental.\n\nInstead of pasting the piece of text for the amdefine setup of a `define`\nvariable in each module you create or consume, you can use `amdefine/intercept`\ninstead. It will automatically insert the above snippet in each .js file loaded\nby Node.\n\n**Warning**: you should only use this if you are creating an application that\nis consuming AMD style defined()'d modules that are distributed via npm and want\nto run that code in Node.\n\nFor library code where you are not sure if it will be used by others in Node or\nin the browser, then explicitly depending on amdefine and placing the code\nsnippet above is suggested path, instead of using `amdefine/intercept`. The\nintercept module affects all .js files loaded in the Node app, and it is\ninconsiderate to modify global state like that unless you are also controlling\nthe top level app.\n\n#### Why distribute AMD-style nodes via npm?\n\nnpm has a lot of weaknesses for front-end use (installed layout is not great,\nshould have better support for the `baseUrl + moduleID + '.js' style of loading,\nsingle file JS installs), but some people want a JS package manager and are\nwilling to live with those constraints. If that is you, but still want to author\nin AMD style modules to get dynamic require([]), better direct source usage and\npowerful loader plugin support in the browser, then this tool can help.\n\n#### amdefine/intercept usage\n\nJust require it in your top level app module (for example index.js, server.js):\n\n```javascript\nrequire('amdefine/intercept');\n```\n\nThe module does not return a value, so no need to assign the result to a local\nvariable.\n\nThen just require() code as you normally would with Node's require(). Any .js\nloaded after the intercept require will have the amdefine check injected in\nthe .js source as it is loaded. It does not modify the source on disk, just\nprepends some content to the text of the module as it is loaded by Node.\n\n#### How amdefine/intercept works\n\nIt overrides the `Module._extensions['.js']` in Node to automatically prepend\nthe amdefine snippet above. So, it will affect any .js file loaded by your\napp.\n\n## define() usage\n\nIt is best if you use the anonymous forms of define() in your module:\n\n```javascript\ndefine(function (require) {\n var dependency = require('dependency');\n});\n```\n\nor\n\n```javascript\ndefine(['dependency'], function (dependency) {\n\n});\n```\n\n## RequireJS optimizer integration. \n\nVersion 1.0.3 of the [RequireJS optimizer](http://requirejs.org/docs/optimization.html)\nwill have support for stripping the `if (typeof define !== 'function')` check\nmentioned above, so you can include this snippet for code that runs in the\nbrowser, but avoid taking the cost of the if() statement once the code is\noptimized for deployment.\n\n## Node 0.4 Support\n\nIf you want to support Node 0.4, then add `require` as the second parameter to amdefine:\n\n```javascript\n//Only if you want Node 0.4. If using 0.5 or later, use the above snippet.\nif (typeof define !== 'function') { var define = require('amdefine')(module, require) }\n```\n\n## Limitations\n\n### Synchronous vs Asynchronous\n\namdefine creates a define() function that is callable by your code. It will\nexecute and trace dependencies and call the factory function *synchronously*,\nto keep the behavior in line with Node's synchronous dependency tracing.\n\nThe exception: calling AMD's callback-style require() from inside a factory\nfunction. The require callback is called on process.nextTick():\n\n```javascript\ndefine(function (require) {\n require(['a'], function(a) {\n //'a' is loaded synchronously, but\n //this callback is called on process.nextTick().\n });\n});\n```\n\n### Loader Plugins\n\nLoader plugins are supported as long as they call their load() callbacks\nsynchronously. So ones that do network requests will not work. However plugins\nlike [text](http://requirejs.org/docs/api.html#text) can load text files locally.\n\nThe plugin API's `load.fromText()` is **not supported** in amdefine, so this means\ntranspiler plugins like the [CoffeeScript loader plugin](https://github.com/jrburke/require-cs)\nwill not work. This may be fixable, but it is a bit complex, and I do not have\nenough node-fu to figure it out yet. See the source for amdefine.js if you want\nto get an idea of the issues involved.\n\n## Tests\n\nTo run the tests, cd to **tests** and run:\n\n```\nnode all.js\nnode all-intercept.js\n```\n\n## License\n\nNew BSD and MIT. Check the LICENSE file for all the details.\n",
- "readmeFilename": "README.md",
- "bugs": {
- "url": "https://github.com/jrburke/amdefine/issues"
- },
- "_id": "amdefine@0.1.0",
- "dist": {
- "shasum": "ed7b98baba7678bf33fe16f9c44f25c2ee2732cf"
- },
- "_from": "amdefine@>=0.0.4",
- "_resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.0.tgz"
-}
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/package.json b/builder/node_modules/uglify-js/node_modules/source-map/package.json
deleted file mode 100644
index 513b6cc6..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/package.json
+++ /dev/null
@@ -1,130 +0,0 @@
-{
- "name": "source-map",
- "description": "Generates and consumes source maps",
- "version": "0.1.33",
- "homepage": "https://github.com/mozilla/source-map",
- "author": {
- "name": "Nick Fitzgerald",
- "email": "nfitzgerald@mozilla.com"
- },
- "contributors": [
- {
- "name": "Tobias Koppers",
- "email": "tobias.koppers@googlemail.com"
- },
- {
- "name": "Duncan Beevers",
- "email": "duncan@dweebd.com"
- },
- {
- "name": "Stephen Crane",
- "email": "scrane@mozilla.com"
- },
- {
- "name": "Ryan Seddon",
- "email": "seddon.ryan@gmail.com"
- },
- {
- "name": "Miles Elam",
- "email": "miles.elam@deem.com"
- },
- {
- "name": "Mihai Bazon",
- "email": "mihai.bazon@gmail.com"
- },
- {
- "name": "Michael Ficarra",
- "email": "github.public.email@michael.ficarra.me"
- },
- {
- "name": "Todd Wolfson",
- "email": "todd@twolfson.com"
- },
- {
- "name": "Alexander Solovyov",
- "email": "alexander@solovyov.net"
- },
- {
- "name": "Felix Gnass",
- "email": "fgnass@gmail.com"
- },
- {
- "name": "Conrad Irwin",
- "email": "conrad.irwin@gmail.com"
- },
- {
- "name": "usrbincc",
- "email": "usrbincc@yahoo.com"
- },
- {
- "name": "David Glasser",
- "email": "glasser@davidglasser.net"
- },
- {
- "name": "Chase Douglas",
- "email": "chase@newrelic.com"
- },
- {
- "name": "Evan Wallace",
- "email": "evan.exe@gmail.com"
- },
- {
- "name": "Heather Arthur",
- "email": "fayearthur@gmail.com"
- },
- {
- "name": "Hugh Kennedy",
- "email": "hughskennedy@gmail.com"
- },
- {
- "name": "David Glasser",
- "email": "glasser@davidglasser.net"
- },
- {
- "name": "Simon Lydell",
- "email": "simon.lydell@gmail.com"
- },
- {
- "name": "Jmeas Smith",
- "email": "jellyes2@gmail.com"
- }
- ],
- "repository": {
- "type": "git",
- "url": "http://github.com/mozilla/source-map.git"
- },
- "directories": {
- "lib": "./lib"
- },
- "main": "./lib/source-map.js",
- "engines": {
- "node": ">=0.8.0"
- },
- "licenses": [
- {
- "type": "BSD",
- "url": "http://opensource.org/licenses/BSD-3-Clause"
- }
- ],
- "dependencies": {
- "amdefine": ">=0.0.4"
- },
- "devDependencies": {
- "dryice": ">=0.4.8"
- },
- "scripts": {
- "test": "node test/run-tests.js",
- "build": "node Makefile.dryice.js"
- },
- "readme": "# Source Map\n\nThis is a library to generate and consume the source map format\n[described here][format].\n\nThis library is written in the Asynchronous Module Definition format, and works\nin the following environments:\n\n* Modern Browsers supporting ECMAScript 5 (either after the build, or with an\n AMD loader such as RequireJS)\n\n* Inside Firefox (as a JSM file, after the build)\n\n* With NodeJS versions 0.8.X and higher\n\n## Node\n\n $ npm install source-map\n\n## Building from Source (for everywhere else)\n\nInstall Node and then run\n\n $ git clone https://fitzgen@github.com/mozilla/source-map.git\n $ cd source-map\n $ npm link .\n\nNext, run\n\n $ node Makefile.dryice.js\n\nThis should spew a bunch of stuff to stdout, and create the following files:\n\n* `dist/source-map.js` - The unminified browser version.\n\n* `dist/source-map.min.js` - The minified browser version.\n\n* `dist/SourceMap.jsm` - The JavaScript Module for inclusion in Firefox source.\n\n## Examples\n\n### Consuming a source map\n\n var rawSourceMap = {\n version: 3,\n file: 'min.js',\n names: ['bar', 'baz', 'n'],\n sources: ['one.js', 'two.js'],\n sourceRoot: 'http://example.com/www/js/',\n mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'\n };\n\n var smc = new SourceMapConsumer(rawSourceMap);\n\n console.log(smc.sources);\n // [ 'http://example.com/www/js/one.js',\n // 'http://example.com/www/js/two.js' ]\n\n console.log(smc.originalPositionFor({\n line: 2,\n column: 28\n }));\n // { source: 'http://example.com/www/js/two.js',\n // line: 2,\n // column: 10,\n // name: 'n' }\n\n console.log(smc.generatedPositionFor({\n source: 'http://example.com/www/js/two.js',\n line: 2,\n column: 10\n }));\n // { line: 2, column: 28 }\n\n smc.eachMapping(function (m) {\n // ...\n });\n\n### Generating a source map\n\nIn depth guide:\n[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/)\n\n#### With SourceNode (high level API)\n\n function compile(ast) {\n switch (ast.type) {\n case 'BinaryExpression':\n return new SourceNode(\n ast.location.line,\n ast.location.column,\n ast.location.source,\n [compile(ast.left), \" + \", compile(ast.right)]\n );\n case 'Literal':\n return new SourceNode(\n ast.location.line,\n ast.location.column,\n ast.location.source,\n String(ast.value)\n );\n // ...\n default:\n throw new Error(\"Bad AST\");\n }\n }\n\n var ast = parse(\"40 + 2\", \"add.js\");\n console.log(compile(ast).toStringWithSourceMap({\n file: 'add.js'\n }));\n // { code: '40 + 2',\n // map: [object SourceMapGenerator] }\n\n#### With SourceMapGenerator (low level API)\n\n var map = new SourceMapGenerator({\n file: \"source-mapped.js\"\n });\n\n map.addMapping({\n generated: {\n line: 10,\n column: 35\n },\n source: \"foo.js\",\n original: {\n line: 33,\n column: 2\n },\n name: \"christopher\"\n });\n\n console.log(map.toString());\n // '{\"version\":3,\"file\":\"source-mapped.js\",\"sources\":[\"foo.js\"],\"names\":[\"christopher\"],\"mappings\":\";;;;;;;;;mCAgCEA\"}'\n\n## API\n\nGet a reference to the module:\n\n // NodeJS\n var sourceMap = require('source-map');\n\n // Browser builds\n var sourceMap = window.sourceMap;\n\n // Inside Firefox\n let sourceMap = {};\n Components.utils.import('resource:///modules/devtools/SourceMap.jsm', sourceMap);\n\n### SourceMapConsumer\n\nA SourceMapConsumer instance represents a parsed source map which we can query\nfor information about the original file positions by giving it a file position\nin the generated source.\n\n#### new SourceMapConsumer(rawSourceMap)\n\nThe only parameter is the raw source map (either as a string which can be\n`JSON.parse`'d, or an object). According to the spec, source maps have the\nfollowing attributes:\n\n* `version`: Which version of the source map spec this map is following.\n\n* `sources`: An array of URLs to the original source files.\n\n* `names`: An array of identifiers which can be referrenced by individual\n mappings.\n\n* `sourceRoot`: Optional. The URL root from which all sources are relative.\n\n* `sourcesContent`: Optional. An array of contents of the original source files.\n\n* `mappings`: A string of base64 VLQs which contain the actual mappings.\n\n* `file`: Optional. The generated filename this source map is associated with.\n\n#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition)\n\nReturns the original source, line, and column information for the generated\nsource's line and column positions provided. The only argument is an object with\nthe following properties:\n\n* `line`: The line number in the generated source.\n\n* `column`: The column number in the generated source.\n\nand an object is returned with the following properties:\n\n* `source`: The original source file, or null if this information is not\n available.\n\n* `line`: The line number in the original source, or null if this information is\n not available.\n\n* `column`: The column number in the original source, or null or null if this\n information is not available.\n\n* `name`: The original identifier, or null if this information is not available.\n\n#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition)\n\nReturns the generated line and column information for the original source,\nline, and column positions provided. The only argument is an object with\nthe following properties:\n\n* `source`: The filename of the original source.\n\n* `line`: The line number in the original source.\n\n* `column`: The column number in the original source.\n\nand an object is returned with the following properties:\n\n* `line`: The line number in the generated source, or null.\n\n* `column`: The column number in the generated source, or null.\n\n#### SourceMapConsumer.prototype.sourceContentFor(source)\n\nReturns the original source content for the source provided. The only\nargument is the URL of the original source file.\n\n#### SourceMapConsumer.prototype.eachMapping(callback, context, order)\n\nIterate over each mapping between an original source/line/column and a\ngenerated line/column in this source map.\n\n* `callback`: The function that is called with each mapping. Mappings have the\n form `{ source, generatedLine, generatedColumn, originalLine, originalColumn,\n name }`\n\n* `context`: Optional. If specified, this object will be the value of `this`\n every time that `callback` is called.\n\n* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or\n `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over\n the mappings sorted by the generated file's line/column order or the\n original's source/line/column order, respectively. Defaults to\n `SourceMapConsumer.GENERATED_ORDER`.\n\n### SourceMapGenerator\n\nAn instance of the SourceMapGenerator represents a source map which is being\nbuilt incrementally.\n\n#### new SourceMapGenerator([startOfSourceMap])\n\nYou may pass an object with the following properties:\n\n* `file`: The filename of the generated source that this source map is\n associated with.\n\n* `sourceRoot`: A root for all relative URLs in this source map.\n\n#### SourceMapGenerator.fromSourceMap(sourceMapConsumer)\n\nCreates a new SourceMapGenerator based on a SourceMapConsumer\n\n* `sourceMapConsumer` The SourceMap.\n\n#### SourceMapGenerator.prototype.addMapping(mapping)\n\nAdd a single mapping from original source line and column to the generated\nsource's line and column for this source map being created. The mapping object\nshould have the following properties:\n\n* `generated`: An object with the generated line and column positions.\n\n* `original`: An object with the original line and column positions.\n\n* `source`: The original source file (relative to the sourceRoot).\n\n* `name`: An optional original token name for this mapping.\n\n#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)\n\nSet the source content for an original source file.\n\n* `sourceFile` the URL of the original source file.\n\n* `sourceContent` the content of the source file.\n\n#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])\n\nApplies a SourceMap for a source file to the SourceMap.\nEach mapping to the supplied source file is rewritten using the\nsupplied SourceMap. Note: The resolution for the resulting mappings\nis the minimium of this map and the supplied map.\n\n* `sourceMapConsumer`: The SourceMap to be applied.\n\n* `sourceFile`: Optional. The filename of the source file.\n If omitted, sourceMapConsumer.file will be used, if it exists.\n Otherwise an error will be thrown.\n\n* `sourceMapPath`: Optional. The dirname of the path to the SourceMap\n to be applied. If relative, it is relative to the SourceMap.\n\n This parameter is needed when the two SourceMaps aren't in the same\n directory, and the SourceMap to be applied contains relative source\n paths. If so, those relative source paths need to be rewritten\n relative to the SourceMap.\n\n If omitted, it is assumed that both SourceMaps are in the same directory,\n thus not needing any rewriting. (Supplying `'.'` has the same effect.)\n\n#### SourceMapGenerator.prototype.toString()\n\nRenders the source map being generated to a string.\n\n### SourceNode\n\nSourceNodes provide a way to abstract over interpolating and/or concatenating\nsnippets of generated JavaScript source code, while maintaining the line and\ncolumn information associated between those snippets and the original source\ncode. This is useful as the final intermediate representation a compiler might\nuse before outputting the generated JS and source map.\n\n#### new SourceNode([line, column, source[, chunk[, name]]])\n\n* `line`: The original line number associated with this source node, or null if\n it isn't associated with an original line.\n\n* `column`: The original column number associated with this source node, or null\n if it isn't associated with an original column.\n\n* `source`: The original source's filename; null if no filename is provided.\n\n* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see\n below.\n\n* `name`: Optional. The original identifier.\n\n#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer)\n\nCreates a SourceNode from generated code and a SourceMapConsumer.\n\n* `code`: The generated code\n\n* `sourceMapConsumer` The SourceMap for the generated code\n\n#### SourceNode.prototype.add(chunk)\n\nAdd a chunk of generated JS to this source node.\n\n* `chunk`: A string snippet of generated JS code, another instance of\n `SourceNode`, or an array where each member is one of those things.\n\n#### SourceNode.prototype.prepend(chunk)\n\nPrepend a chunk of generated JS to this source node.\n\n* `chunk`: A string snippet of generated JS code, another instance of\n `SourceNode`, or an array where each member is one of those things.\n\n#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent)\n\nSet the source content for a source file. This will be added to the\n`SourceMap` in the `sourcesContent` field.\n\n* `sourceFile`: The filename of the source file\n\n* `sourceContent`: The content of the source file\n\n#### SourceNode.prototype.walk(fn)\n\nWalk over the tree of JS snippets in this node and its children. The walking\nfunction is called once for each snippet of JS and is passed that snippet and\nthe its original associated source's line/column location.\n\n* `fn`: The traversal function.\n\n#### SourceNode.prototype.walkSourceContents(fn)\n\nWalk over the tree of SourceNodes. The walking function is called for each\nsource file content and is passed the filename and source content.\n\n* `fn`: The traversal function.\n\n#### SourceNode.prototype.join(sep)\n\nLike `Array.prototype.join` except for SourceNodes. Inserts the separator\nbetween each of this source node's children.\n\n* `sep`: The separator.\n\n#### SourceNode.prototype.replaceRight(pattern, replacement)\n\nCall `String.prototype.replace` on the very right-most source snippet. Useful\nfor trimming whitespace from the end of a source node, etc.\n\n* `pattern`: The pattern to replace.\n\n* `replacement`: The thing to replace the pattern with.\n\n#### SourceNode.prototype.toString()\n\nReturn the string representation of this source node. Walks over the tree and\nconcatenates all the various snippets together to one string.\n\n### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])\n\nReturns the string representation of this tree of source nodes, plus a\nSourceMapGenerator which contains all the mappings between the generated and\noriginal sources.\n\nThe arguments are the same as those to `new SourceMapGenerator`.\n\n## Tests\n\n[](https://travis-ci.org/mozilla/source-map)\n\nInstall NodeJS version 0.8.0 or greater, then run `node test/run-tests.js`.\n\nTo add new tests, create a new file named `test/test-.js`\nand export your test functions with names that start with \"test\", for example\n\n exports[\"test doing the foo bar\"] = function (assert, util) {\n ...\n };\n\nThe new test will be located automatically when you run the suite.\n\nThe `util` argument is the test utility module located at `test/source-map/util`.\n\nThe `assert` argument is a cut down version of node's assert module. You have\naccess to the following assertion functions:\n\n* `doesNotThrow`\n\n* `equal`\n\n* `ok`\n\n* `strictEqual`\n\n* `throws`\n\n(The reason for the restricted set of test functions is because we need the\ntests to run inside Firefox's test suite as well and so the assert module is\nshimmed in that environment. See `build/assert-shim.js`.)\n\n[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit\n[feature]: https://wiki.mozilla.org/DevTools/Features/SourceMap\n[Dryice]: https://github.com/mozilla/dryice\n",
- "readmeFilename": "README.md",
- "bugs": {
- "url": "https://github.com/mozilla/source-map/issues"
- },
- "_id": "source-map@0.1.33",
- "dist": {
- "shasum": "4ee9d7d5140d389137b960fab4a107ecb3e74e9c"
- },
- "_from": "source-map@~0.1.33",
- "_resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.33.tgz"
-}
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/test/run-tests.js b/builder/node_modules/uglify-js/node_modules/source-map/test/run-tests.js
deleted file mode 100644
index 64a7c3a3..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/test/run-tests.js
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/usr/bin/env node
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-var assert = require('assert');
-var fs = require('fs');
-var path = require('path');
-var util = require('./source-map/util');
-
-function run(tests) {
- var total = 0;
- var passed = 0;
-
- for (var i = 0; i < tests.length; i++) {
- for (var k in tests[i].testCase) {
- if (/^test/.test(k)) {
- total++;
- try {
- tests[i].testCase[k](assert, util);
- passed++;
- }
- catch (e) {
- console.log('FAILED ' + tests[i].name + ': ' + k + '!');
- console.log(e.stack);
- }
- }
- }
- }
-
- console.log('');
- console.log(passed + ' / ' + total + ' tests passed.');
- console.log('');
-
- return total - passed;
-}
-
-function isTestFile(f) {
- var testToRun = process.argv[2];
- return testToRun
- ? path.basename(testToRun) === f
- : /^test\-.*?\.js/.test(f);
-}
-
-function toModule(f) {
- return './source-map/' + f.replace(/\.js$/, '');
-}
-
-var requires = fs.readdirSync(path.join(__dirname, 'source-map'))
- .filter(isTestFile)
- .map(toModule);
-
-var code = run(requires.map(require).map(function (mod, i) {
- return {
- name: requires[i],
- testCase: mod
- };
-}));
-
-process.exit(code);
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-api.js b/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-api.js
deleted file mode 100644
index 3801233c..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-api.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2012 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-if (typeof define !== 'function') {
- var define = require('amdefine')(module, require);
-}
-define(function (require, exports, module) {
-
- var sourceMap;
- try {
- sourceMap = require('../../lib/source-map');
- } catch (e) {
- sourceMap = {};
- Components.utils.import('resource:///modules/devtools/SourceMap.jsm', sourceMap);
- }
-
- exports['test that the api is properly exposed in the top level'] = function (assert, util) {
- assert.equal(typeof sourceMap.SourceMapGenerator, "function");
- assert.equal(typeof sourceMap.SourceMapConsumer, "function");
- assert.equal(typeof sourceMap.SourceNode, "function");
- };
-
-});
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-array-set.js b/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-array-set.js
deleted file mode 100644
index b5797edd..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-array-set.js
+++ /dev/null
@@ -1,104 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-if (typeof define !== 'function') {
- var define = require('amdefine')(module, require);
-}
-define(function (require, exports, module) {
-
- var ArraySet = require('../../lib/source-map/array-set').ArraySet;
-
- function makeTestSet() {
- var set = new ArraySet();
- for (var i = 0; i < 100; i++) {
- set.add(String(i));
- }
- return set;
- }
-
- exports['test .has() membership'] = function (assert, util) {
- var set = makeTestSet();
- for (var i = 0; i < 100; i++) {
- assert.ok(set.has(String(i)));
- }
- };
-
- exports['test .indexOf() elements'] = function (assert, util) {
- var set = makeTestSet();
- for (var i = 0; i < 100; i++) {
- assert.strictEqual(set.indexOf(String(i)), i);
- }
- };
-
- exports['test .at() indexing'] = function (assert, util) {
- var set = makeTestSet();
- for (var i = 0; i < 100; i++) {
- assert.strictEqual(set.at(i), String(i));
- }
- };
-
- exports['test creating from an array'] = function (assert, util) {
- var set = ArraySet.fromArray(['foo', 'bar', 'baz', 'quux', 'hasOwnProperty']);
-
- assert.ok(set.has('foo'));
- assert.ok(set.has('bar'));
- assert.ok(set.has('baz'));
- assert.ok(set.has('quux'));
- assert.ok(set.has('hasOwnProperty'));
-
- assert.strictEqual(set.indexOf('foo'), 0);
- assert.strictEqual(set.indexOf('bar'), 1);
- assert.strictEqual(set.indexOf('baz'), 2);
- assert.strictEqual(set.indexOf('quux'), 3);
-
- assert.strictEqual(set.at(0), 'foo');
- assert.strictEqual(set.at(1), 'bar');
- assert.strictEqual(set.at(2), 'baz');
- assert.strictEqual(set.at(3), 'quux');
- };
-
- exports['test that you can add __proto__; see github issue #30'] = function (assert, util) {
- var set = new ArraySet();
- set.add('__proto__');
- assert.ok(set.has('__proto__'));
- assert.strictEqual(set.at(0), '__proto__');
- assert.strictEqual(set.indexOf('__proto__'), 0);
- };
-
- exports['test .fromArray() with duplicates'] = function (assert, util) {
- var set = ArraySet.fromArray(['foo', 'foo']);
- assert.ok(set.has('foo'));
- assert.strictEqual(set.at(0), 'foo');
- assert.strictEqual(set.indexOf('foo'), 0);
- assert.strictEqual(set.toArray().length, 1);
-
- set = ArraySet.fromArray(['foo', 'foo'], true);
- assert.ok(set.has('foo'));
- assert.strictEqual(set.at(0), 'foo');
- assert.strictEqual(set.at(1), 'foo');
- assert.strictEqual(set.indexOf('foo'), 0);
- assert.strictEqual(set.toArray().length, 2);
- };
-
- exports['test .add() with duplicates'] = function (assert, util) {
- var set = new ArraySet();
- set.add('foo');
-
- set.add('foo');
- assert.ok(set.has('foo'));
- assert.strictEqual(set.at(0), 'foo');
- assert.strictEqual(set.indexOf('foo'), 0);
- assert.strictEqual(set.toArray().length, 1);
-
- set.add('foo', true);
- assert.ok(set.has('foo'));
- assert.strictEqual(set.at(0), 'foo');
- assert.strictEqual(set.at(1), 'foo');
- assert.strictEqual(set.indexOf('foo'), 0);
- assert.strictEqual(set.toArray().length, 2);
- };
-
-});
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-base64-vlq.js b/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-base64-vlq.js
deleted file mode 100644
index 653a874e..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-base64-vlq.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-if (typeof define !== 'function') {
- var define = require('amdefine')(module, require);
-}
-define(function (require, exports, module) {
-
- var base64VLQ = require('../../lib/source-map/base64-vlq');
-
- exports['test normal encoding and decoding'] = function (assert, util) {
- var result;
- for (var i = -255; i < 256; i++) {
- result = base64VLQ.decode(base64VLQ.encode(i));
- assert.ok(result);
- assert.equal(result.value, i);
- assert.equal(result.rest, "");
- }
- };
-
-});
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-base64.js b/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-base64.js
deleted file mode 100644
index ff3a2445..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-base64.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-if (typeof define !== 'function') {
- var define = require('amdefine')(module, require);
-}
-define(function (require, exports, module) {
-
- var base64 = require('../../lib/source-map/base64');
-
- exports['test out of range encoding'] = function (assert, util) {
- assert.throws(function () {
- base64.encode(-1);
- });
- assert.throws(function () {
- base64.encode(64);
- });
- };
-
- exports['test out of range decoding'] = function (assert, util) {
- assert.throws(function () {
- base64.decode('=');
- });
- };
-
- exports['test normal encoding and decoding'] = function (assert, util) {
- for (var i = 0; i < 64; i++) {
- assert.equal(base64.decode(base64.encode(i)), i);
- }
- };
-
-});
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-binary-search.js b/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-binary-search.js
deleted file mode 100644
index ee306830..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-binary-search.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-if (typeof define !== 'function') {
- var define = require('amdefine')(module, require);
-}
-define(function (require, exports, module) {
-
- var binarySearch = require('../../lib/source-map/binary-search');
-
- function numberCompare(a, b) {
- return a - b;
- }
-
- exports['test too high'] = function (assert, util) {
- var needle = 30;
- var haystack = [2,4,6,8,10,12,14,16,18,20];
-
- assert.doesNotThrow(function () {
- binarySearch.search(needle, haystack, numberCompare);
- });
-
- assert.equal(binarySearch.search(needle, haystack, numberCompare), 20);
- };
-
- exports['test too low'] = function (assert, util) {
- var needle = 1;
- var haystack = [2,4,6,8,10,12,14,16,18,20];
-
- assert.doesNotThrow(function () {
- binarySearch.search(needle, haystack, numberCompare);
- });
-
- assert.equal(binarySearch.search(needle, haystack, numberCompare), null);
- };
-
- exports['test exact search'] = function (assert, util) {
- var needle = 4;
- var haystack = [2,4,6,8,10,12,14,16,18,20];
-
- assert.equal(binarySearch.search(needle, haystack, numberCompare), 4);
- };
-
- exports['test fuzzy search'] = function (assert, util) {
- var needle = 19;
- var haystack = [2,4,6,8,10,12,14,16,18,20];
-
- assert.equal(binarySearch.search(needle, haystack, numberCompare), 18);
- };
-
-});
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-dog-fooding.js b/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-dog-fooding.js
deleted file mode 100644
index 26757b2d..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-dog-fooding.js
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-if (typeof define !== 'function') {
- var define = require('amdefine')(module, require);
-}
-define(function (require, exports, module) {
-
- var SourceMapConsumer = require('../../lib/source-map/source-map-consumer').SourceMapConsumer;
- var SourceMapGenerator = require('../../lib/source-map/source-map-generator').SourceMapGenerator;
-
- exports['test eating our own dog food'] = function (assert, util) {
- var smg = new SourceMapGenerator({
- file: 'testing.js',
- sourceRoot: '/wu/tang'
- });
-
- smg.addMapping({
- source: 'gza.coffee',
- original: { line: 1, column: 0 },
- generated: { line: 2, column: 2 }
- });
-
- smg.addMapping({
- source: 'gza.coffee',
- original: { line: 2, column: 0 },
- generated: { line: 3, column: 2 }
- });
-
- smg.addMapping({
- source: 'gza.coffee',
- original: { line: 3, column: 0 },
- generated: { line: 4, column: 2 }
- });
-
- smg.addMapping({
- source: 'gza.coffee',
- original: { line: 4, column: 0 },
- generated: { line: 5, column: 2 }
- });
-
- smg.addMapping({
- source: 'gza.coffee',
- original: { line: 5, column: 10 },
- generated: { line: 6, column: 12 }
- });
-
- var smc = new SourceMapConsumer(smg.toString());
-
- // Exact
- util.assertMapping(2, 2, '/wu/tang/gza.coffee', 1, 0, null, smc, assert);
- util.assertMapping(3, 2, '/wu/tang/gza.coffee', 2, 0, null, smc, assert);
- util.assertMapping(4, 2, '/wu/tang/gza.coffee', 3, 0, null, smc, assert);
- util.assertMapping(5, 2, '/wu/tang/gza.coffee', 4, 0, null, smc, assert);
- util.assertMapping(6, 12, '/wu/tang/gza.coffee', 5, 10, null, smc, assert);
-
- // Fuzzy
-
- // Generated to original
- util.assertMapping(2, 0, null, null, null, null, smc, assert, true);
- util.assertMapping(2, 9, '/wu/tang/gza.coffee', 1, 0, null, smc, assert, true);
- util.assertMapping(3, 0, null, null, null, null, smc, assert, true);
- util.assertMapping(3, 9, '/wu/tang/gza.coffee', 2, 0, null, smc, assert, true);
- util.assertMapping(4, 0, null, null, null, null, smc, assert, true);
- util.assertMapping(4, 9, '/wu/tang/gza.coffee', 3, 0, null, smc, assert, true);
- util.assertMapping(5, 0, null, null, null, null, smc, assert, true);
- util.assertMapping(5, 9, '/wu/tang/gza.coffee', 4, 0, null, smc, assert, true);
- util.assertMapping(6, 0, null, null, null, null, smc, assert, true);
- util.assertMapping(6, 9, null, null, null, null, smc, assert, true);
- util.assertMapping(6, 13, '/wu/tang/gza.coffee', 5, 10, null, smc, assert, true);
-
- // Original to generated
- util.assertMapping(2, 2, '/wu/tang/gza.coffee', 1, 1, null, smc, assert, null, true);
- util.assertMapping(3, 2, '/wu/tang/gza.coffee', 2, 3, null, smc, assert, null, true);
- util.assertMapping(4, 2, '/wu/tang/gza.coffee', 3, 6, null, smc, assert, null, true);
- util.assertMapping(5, 2, '/wu/tang/gza.coffee', 4, 9, null, smc, assert, null, true);
- util.assertMapping(5, 2, '/wu/tang/gza.coffee', 5, 9, null, smc, assert, null, true);
- util.assertMapping(6, 12, '/wu/tang/gza.coffee', 6, 19, null, smc, assert, null, true);
- };
-
-});
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-consumer.js b/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-consumer.js
deleted file mode 100644
index acd24d5e..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-consumer.js
+++ /dev/null
@@ -1,475 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-if (typeof define !== 'function') {
- var define = require('amdefine')(module, require);
-}
-define(function (require, exports, module) {
-
- var SourceMapConsumer = require('../../lib/source-map/source-map-consumer').SourceMapConsumer;
- var SourceMapGenerator = require('../../lib/source-map/source-map-generator').SourceMapGenerator;
-
- exports['test that we can instantiate with a string or an object'] = function (assert, util) {
- assert.doesNotThrow(function () {
- var map = new SourceMapConsumer(util.testMap);
- });
- assert.doesNotThrow(function () {
- var map = new SourceMapConsumer(JSON.stringify(util.testMap));
- });
- };
-
- exports['test that the `sources` field has the original sources'] = function (assert, util) {
- var map = new SourceMapConsumer(util.testMap);
- var sources = map.sources;
-
- assert.equal(sources[0], '/the/root/one.js');
- assert.equal(sources[1], '/the/root/two.js');
- assert.equal(sources.length, 2);
- };
-
- exports['test that the source root is reflected in a mapping\'s source field'] = function (assert, util) {
- var map = new SourceMapConsumer(util.testMap);
- var mapping;
-
- mapping = map.originalPositionFor({
- line: 2,
- column: 1
- });
- assert.equal(mapping.source, '/the/root/two.js');
-
- mapping = map.originalPositionFor({
- line: 1,
- column: 1
- });
- assert.equal(mapping.source, '/the/root/one.js');
- };
-
- exports['test mapping tokens back exactly'] = function (assert, util) {
- var map = new SourceMapConsumer(util.testMap);
-
- util.assertMapping(1, 1, '/the/root/one.js', 1, 1, null, map, assert);
- util.assertMapping(1, 5, '/the/root/one.js', 1, 5, null, map, assert);
- util.assertMapping(1, 9, '/the/root/one.js', 1, 11, null, map, assert);
- util.assertMapping(1, 18, '/the/root/one.js', 1, 21, 'bar', map, assert);
- util.assertMapping(1, 21, '/the/root/one.js', 2, 3, null, map, assert);
- util.assertMapping(1, 28, '/the/root/one.js', 2, 10, 'baz', map, assert);
- util.assertMapping(1, 32, '/the/root/one.js', 2, 14, 'bar', map, assert);
-
- util.assertMapping(2, 1, '/the/root/two.js', 1, 1, null, map, assert);
- util.assertMapping(2, 5, '/the/root/two.js', 1, 5, null, map, assert);
- util.assertMapping(2, 9, '/the/root/two.js', 1, 11, null, map, assert);
- util.assertMapping(2, 18, '/the/root/two.js', 1, 21, 'n', map, assert);
- util.assertMapping(2, 21, '/the/root/two.js', 2, 3, null, map, assert);
- util.assertMapping(2, 28, '/the/root/two.js', 2, 10, 'n', map, assert);
- };
-
- exports['test mapping tokens fuzzy'] = function (assert, util) {
- var map = new SourceMapConsumer(util.testMap);
-
- // Finding original positions
- util.assertMapping(1, 20, '/the/root/one.js', 1, 21, 'bar', map, assert, true);
- util.assertMapping(1, 30, '/the/root/one.js', 2, 10, 'baz', map, assert, true);
- util.assertMapping(2, 12, '/the/root/two.js', 1, 11, null, map, assert, true);
-
- // Finding generated positions
- util.assertMapping(1, 18, '/the/root/one.js', 1, 22, 'bar', map, assert, null, true);
- util.assertMapping(1, 28, '/the/root/one.js', 2, 13, 'baz', map, assert, null, true);
- util.assertMapping(2, 9, '/the/root/two.js', 1, 16, null, map, assert, null, true);
- };
-
- exports['test mappings and end of lines'] = function (assert, util) {
- var smg = new SourceMapGenerator({
- file: 'foo.js'
- });
- smg.addMapping({
- original: { line: 1, column: 1 },
- generated: { line: 1, column: 1 },
- source: 'bar.js'
- });
- smg.addMapping({
- original: { line: 2, column: 2 },
- generated: { line: 2, column: 2 },
- source: 'bar.js'
- });
-
- var map = SourceMapConsumer.fromSourceMap(smg);
-
- // When finding original positions, mappings end at the end of the line.
- util.assertMapping(2, 1, null, null, null, null, map, assert, true)
-
- // When finding generated positions, mappings do not end at the end of the line.
- util.assertMapping(1, 1, 'bar.js', 2, 1, null, map, assert, null, true);
- };
-
- exports['test creating source map consumers with )]}\' prefix'] = function (assert, util) {
- assert.doesNotThrow(function () {
- var map = new SourceMapConsumer(")]}'" + JSON.stringify(util.testMap));
- });
- };
-
- exports['test eachMapping'] = function (assert, util) {
- var map = new SourceMapConsumer(util.testMap);
- var previousLine = -Infinity;
- var previousColumn = -Infinity;
- map.eachMapping(function (mapping) {
- assert.ok(mapping.generatedLine >= previousLine);
-
- if (mapping.source) {
- assert.equal(mapping.source.indexOf(util.testMap.sourceRoot), 0);
- }
-
- if (mapping.generatedLine === previousLine) {
- assert.ok(mapping.generatedColumn >= previousColumn);
- previousColumn = mapping.generatedColumn;
- }
- else {
- previousLine = mapping.generatedLine;
- previousColumn = -Infinity;
- }
- });
- };
-
- exports['test iterating over mappings in a different order'] = function (assert, util) {
- var map = new SourceMapConsumer(util.testMap);
- var previousLine = -Infinity;
- var previousColumn = -Infinity;
- var previousSource = "";
- map.eachMapping(function (mapping) {
- assert.ok(mapping.source >= previousSource);
-
- if (mapping.source === previousSource) {
- assert.ok(mapping.originalLine >= previousLine);
-
- if (mapping.originalLine === previousLine) {
- assert.ok(mapping.originalColumn >= previousColumn);
- previousColumn = mapping.originalColumn;
- }
- else {
- previousLine = mapping.originalLine;
- previousColumn = -Infinity;
- }
- }
- else {
- previousSource = mapping.source;
- previousLine = -Infinity;
- previousColumn = -Infinity;
- }
- }, null, SourceMapConsumer.ORIGINAL_ORDER);
- };
-
- exports['test that we can set the context for `this` in eachMapping'] = function (assert, util) {
- var map = new SourceMapConsumer(util.testMap);
- var context = {};
- map.eachMapping(function () {
- assert.equal(this, context);
- }, context);
- };
-
- exports['test that the `sourcesContent` field has the original sources'] = function (assert, util) {
- var map = new SourceMapConsumer(util.testMapWithSourcesContent);
- var sourcesContent = map.sourcesContent;
-
- assert.equal(sourcesContent[0], ' ONE.foo = function (bar) {\n return baz(bar);\n };');
- assert.equal(sourcesContent[1], ' TWO.inc = function (n) {\n return n + 1;\n };');
- assert.equal(sourcesContent.length, 2);
- };
-
- exports['test that we can get the original sources for the sources'] = function (assert, util) {
- var map = new SourceMapConsumer(util.testMapWithSourcesContent);
- var sources = map.sources;
-
- assert.equal(map.sourceContentFor(sources[0]), ' ONE.foo = function (bar) {\n return baz(bar);\n };');
- assert.equal(map.sourceContentFor(sources[1]), ' TWO.inc = function (n) {\n return n + 1;\n };');
- assert.equal(map.sourceContentFor("one.js"), ' ONE.foo = function (bar) {\n return baz(bar);\n };');
- assert.equal(map.sourceContentFor("two.js"), ' TWO.inc = function (n) {\n return n + 1;\n };');
- assert.throws(function () {
- map.sourceContentFor("");
- }, Error);
- assert.throws(function () {
- map.sourceContentFor("/the/root/three.js");
- }, Error);
- assert.throws(function () {
- map.sourceContentFor("three.js");
- }, Error);
- };
-
- exports['test sourceRoot + generatedPositionFor'] = function (assert, util) {
- var map = new SourceMapGenerator({
- sourceRoot: 'foo/bar',
- file: 'baz.js'
- });
- map.addMapping({
- original: { line: 1, column: 1 },
- generated: { line: 2, column: 2 },
- source: 'bang.coffee'
- });
- map.addMapping({
- original: { line: 5, column: 5 },
- generated: { line: 6, column: 6 },
- source: 'bang.coffee'
- });
- map = new SourceMapConsumer(map.toString());
-
- // Should handle without sourceRoot.
- var pos = map.generatedPositionFor({
- line: 1,
- column: 1,
- source: 'bang.coffee'
- });
-
- assert.equal(pos.line, 2);
- assert.equal(pos.column, 2);
-
- // Should handle with sourceRoot.
- var pos = map.generatedPositionFor({
- line: 1,
- column: 1,
- source: 'foo/bar/bang.coffee'
- });
-
- assert.equal(pos.line, 2);
- assert.equal(pos.column, 2);
- };
-
- exports['test sourceRoot + originalPositionFor'] = function (assert, util) {
- var map = new SourceMapGenerator({
- sourceRoot: 'foo/bar',
- file: 'baz.js'
- });
- map.addMapping({
- original: { line: 1, column: 1 },
- generated: { line: 2, column: 2 },
- source: 'bang.coffee'
- });
- map = new SourceMapConsumer(map.toString());
-
- var pos = map.originalPositionFor({
- line: 2,
- column: 2,
- });
-
- // Should always have the prepended source root
- assert.equal(pos.source, 'foo/bar/bang.coffee');
- assert.equal(pos.line, 1);
- assert.equal(pos.column, 1);
- };
-
- exports['test github issue #56'] = function (assert, util) {
- var map = new SourceMapGenerator({
- sourceRoot: 'http://',
- file: 'www.example.com/foo.js'
- });
- map.addMapping({
- original: { line: 1, column: 1 },
- generated: { line: 2, column: 2 },
- source: 'www.example.com/original.js'
- });
- map = new SourceMapConsumer(map.toString());
-
- var sources = map.sources;
- assert.equal(sources.length, 1);
- assert.equal(sources[0], 'http://www.example.com/original.js');
- };
-
- exports['test github issue #43'] = function (assert, util) {
- var map = new SourceMapGenerator({
- sourceRoot: 'http://example.com',
- file: 'foo.js'
- });
- map.addMapping({
- original: { line: 1, column: 1 },
- generated: { line: 2, column: 2 },
- source: 'http://cdn.example.com/original.js'
- });
- map = new SourceMapConsumer(map.toString());
-
- var sources = map.sources;
- assert.equal(sources.length, 1,
- 'Should only be one source.');
- assert.equal(sources[0], 'http://cdn.example.com/original.js',
- 'Should not be joined with the sourceRoot.');
- };
-
- exports['test absolute path, but same host sources'] = function (assert, util) {
- var map = new SourceMapGenerator({
- sourceRoot: 'http://example.com/foo/bar',
- file: 'foo.js'
- });
- map.addMapping({
- original: { line: 1, column: 1 },
- generated: { line: 2, column: 2 },
- source: '/original.js'
- });
- map = new SourceMapConsumer(map.toString());
-
- var sources = map.sources;
- assert.equal(sources.length, 1,
- 'Should only be one source.');
- assert.equal(sources[0], 'http://example.com/original.js',
- 'Source should be relative the host of the source root.');
- };
-
- exports['test github issue #64'] = function (assert, util) {
- var map = new SourceMapConsumer({
- "version": 3,
- "file": "foo.js",
- "sourceRoot": "http://example.com/",
- "sources": ["/a"],
- "names": [],
- "mappings": "AACA",
- "sourcesContent": ["foo"]
- });
-
- assert.equal(map.sourceContentFor("a"), "foo");
- assert.equal(map.sourceContentFor("/a"), "foo");
- };
-
- exports['test bug 885597'] = function (assert, util) {
- var map = new SourceMapConsumer({
- "version": 3,
- "file": "foo.js",
- "sourceRoot": "file:///Users/AlGore/Invented/The/Internet/",
- "sources": ["/a"],
- "names": [],
- "mappings": "AACA",
- "sourcesContent": ["foo"]
- });
-
- var s = map.sources[0];
- assert.equal(map.sourceContentFor(s), "foo");
- };
-
- exports['test github issue #72, duplicate sources'] = function (assert, util) {
- var map = new SourceMapConsumer({
- "version": 3,
- "file": "foo.js",
- "sources": ["source1.js", "source1.js", "source3.js"],
- "names": [],
- "mappings": ";EAAC;;IAEE;;MEEE",
- "sourceRoot": "http://example.com"
- });
-
- var pos = map.originalPositionFor({
- line: 2,
- column: 2
- });
- assert.equal(pos.source, 'http://example.com/source1.js');
- assert.equal(pos.line, 1);
- assert.equal(pos.column, 1);
-
- var pos = map.originalPositionFor({
- line: 4,
- column: 4
- });
- assert.equal(pos.source, 'http://example.com/source1.js');
- assert.equal(pos.line, 3);
- assert.equal(pos.column, 3);
-
- var pos = map.originalPositionFor({
- line: 6,
- column: 6
- });
- assert.equal(pos.source, 'http://example.com/source3.js');
- assert.equal(pos.line, 5);
- assert.equal(pos.column, 5);
- };
-
- exports['test github issue #72, duplicate names'] = function (assert, util) {
- var map = new SourceMapConsumer({
- "version": 3,
- "file": "foo.js",
- "sources": ["source.js"],
- "names": ["name1", "name1", "name3"],
- "mappings": ";EAACA;;IAEEA;;MAEEE",
- "sourceRoot": "http://example.com"
- });
-
- var pos = map.originalPositionFor({
- line: 2,
- column: 2
- });
- assert.equal(pos.name, 'name1');
- assert.equal(pos.line, 1);
- assert.equal(pos.column, 1);
-
- var pos = map.originalPositionFor({
- line: 4,
- column: 4
- });
- assert.equal(pos.name, 'name1');
- assert.equal(pos.line, 3);
- assert.equal(pos.column, 3);
-
- var pos = map.originalPositionFor({
- line: 6,
- column: 6
- });
- assert.equal(pos.name, 'name3');
- assert.equal(pos.line, 5);
- assert.equal(pos.column, 5);
- };
-
- exports['test SourceMapConsumer.fromSourceMap'] = function (assert, util) {
- var smg = new SourceMapGenerator({
- sourceRoot: 'http://example.com/',
- file: 'foo.js'
- });
- smg.addMapping({
- original: { line: 1, column: 1 },
- generated: { line: 2, column: 2 },
- source: 'bar.js'
- });
- smg.addMapping({
- original: { line: 2, column: 2 },
- generated: { line: 4, column: 4 },
- source: 'baz.js',
- name: 'dirtMcGirt'
- });
- smg.setSourceContent('baz.js', 'baz.js content');
-
- var smc = SourceMapConsumer.fromSourceMap(smg);
- assert.equal(smc.file, 'foo.js');
- assert.equal(smc.sourceRoot, 'http://example.com/');
- assert.equal(smc.sources.length, 2);
- assert.equal(smc.sources[0], 'http://example.com/bar.js');
- assert.equal(smc.sources[1], 'http://example.com/baz.js');
- assert.equal(smc.sourceContentFor('baz.js'), 'baz.js content');
-
- var pos = smc.originalPositionFor({
- line: 2,
- column: 2
- });
- assert.equal(pos.line, 1);
- assert.equal(pos.column, 1);
- assert.equal(pos.source, 'http://example.com/bar.js');
- assert.equal(pos.name, null);
-
- pos = smc.generatedPositionFor({
- line: 1,
- column: 1,
- source: 'http://example.com/bar.js'
- });
- assert.equal(pos.line, 2);
- assert.equal(pos.column, 2);
-
- pos = smc.originalPositionFor({
- line: 4,
- column: 4
- });
- assert.equal(pos.line, 2);
- assert.equal(pos.column, 2);
- assert.equal(pos.source, 'http://example.com/baz.js');
- assert.equal(pos.name, 'dirtMcGirt');
-
- pos = smc.generatedPositionFor({
- line: 2,
- column: 2,
- source: 'http://example.com/baz.js'
- });
- assert.equal(pos.line, 4);
- assert.equal(pos.column, 4);
- };
-});
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-generator.js b/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-generator.js
deleted file mode 100644
index 16241dd3..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-generator.js
+++ /dev/null
@@ -1,540 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-if (typeof define !== 'function') {
- var define = require('amdefine')(module, require);
-}
-define(function (require, exports, module) {
-
- var SourceMapGenerator = require('../../lib/source-map/source-map-generator').SourceMapGenerator;
- var SourceMapConsumer = require('../../lib/source-map/source-map-consumer').SourceMapConsumer;
- var SourceNode = require('../../lib/source-map/source-node').SourceNode;
- var util = require('./util');
-
- exports['test some simple stuff'] = function (assert, util) {
- var map = new SourceMapGenerator({
- file: 'foo.js',
- sourceRoot: '.'
- });
- assert.ok(true);
-
- var map = new SourceMapGenerator();
- assert.ok(true);
- };
-
- exports['test JSON serialization'] = function (assert, util) {
- var map = new SourceMapGenerator({
- file: 'foo.js',
- sourceRoot: '.'
- });
- assert.equal(map.toString(), JSON.stringify(map));
- };
-
- exports['test adding mappings (case 1)'] = function (assert, util) {
- var map = new SourceMapGenerator({
- file: 'generated-foo.js',
- sourceRoot: '.'
- });
-
- assert.doesNotThrow(function () {
- map.addMapping({
- generated: { line: 1, column: 1 }
- });
- });
- };
-
- exports['test adding mappings (case 2)'] = function (assert, util) {
- var map = new SourceMapGenerator({
- file: 'generated-foo.js',
- sourceRoot: '.'
- });
-
- assert.doesNotThrow(function () {
- map.addMapping({
- generated: { line: 1, column: 1 },
- source: 'bar.js',
- original: { line: 1, column: 1 }
- });
- });
- };
-
- exports['test adding mappings (case 3)'] = function (assert, util) {
- var map = new SourceMapGenerator({
- file: 'generated-foo.js',
- sourceRoot: '.'
- });
-
- assert.doesNotThrow(function () {
- map.addMapping({
- generated: { line: 1, column: 1 },
- source: 'bar.js',
- original: { line: 1, column: 1 },
- name: 'someToken'
- });
- });
- };
-
- exports['test adding mappings (invalid)'] = function (assert, util) {
- var map = new SourceMapGenerator({
- file: 'generated-foo.js',
- sourceRoot: '.'
- });
-
- // Not enough info.
- assert.throws(function () {
- map.addMapping({});
- });
-
- // Original file position, but no source.
- assert.throws(function () {
- map.addMapping({
- generated: { line: 1, column: 1 },
- original: { line: 1, column: 1 }
- });
- });
- };
-
- exports['test that the correct mappings are being generated'] = function (assert, util) {
- var map = new SourceMapGenerator({
- file: 'min.js',
- sourceRoot: '/the/root'
- });
-
- map.addMapping({
- generated: { line: 1, column: 1 },
- original: { line: 1, column: 1 },
- source: 'one.js'
- });
- map.addMapping({
- generated: { line: 1, column: 5 },
- original: { line: 1, column: 5 },
- source: 'one.js'
- });
- map.addMapping({
- generated: { line: 1, column: 9 },
- original: { line: 1, column: 11 },
- source: 'one.js'
- });
- map.addMapping({
- generated: { line: 1, column: 18 },
- original: { line: 1, column: 21 },
- source: 'one.js',
- name: 'bar'
- });
- map.addMapping({
- generated: { line: 1, column: 21 },
- original: { line: 2, column: 3 },
- source: 'one.js'
- });
- map.addMapping({
- generated: { line: 1, column: 28 },
- original: { line: 2, column: 10 },
- source: 'one.js',
- name: 'baz'
- });
- map.addMapping({
- generated: { line: 1, column: 32 },
- original: { line: 2, column: 14 },
- source: 'one.js',
- name: 'bar'
- });
-
- map.addMapping({
- generated: { line: 2, column: 1 },
- original: { line: 1, column: 1 },
- source: 'two.js'
- });
- map.addMapping({
- generated: { line: 2, column: 5 },
- original: { line: 1, column: 5 },
- source: 'two.js'
- });
- map.addMapping({
- generated: { line: 2, column: 9 },
- original: { line: 1, column: 11 },
- source: 'two.js'
- });
- map.addMapping({
- generated: { line: 2, column: 18 },
- original: { line: 1, column: 21 },
- source: 'two.js',
- name: 'n'
- });
- map.addMapping({
- generated: { line: 2, column: 21 },
- original: { line: 2, column: 3 },
- source: 'two.js'
- });
- map.addMapping({
- generated: { line: 2, column: 28 },
- original: { line: 2, column: 10 },
- source: 'two.js',
- name: 'n'
- });
-
- map = JSON.parse(map.toString());
-
- util.assertEqualMaps(assert, map, util.testMap);
- };
-
- exports['test that source content can be set'] = function (assert, util) {
- var map = new SourceMapGenerator({
- file: 'min.js',
- sourceRoot: '/the/root'
- });
- map.addMapping({
- generated: { line: 1, column: 1 },
- original: { line: 1, column: 1 },
- source: 'one.js'
- });
- map.addMapping({
- generated: { line: 2, column: 1 },
- original: { line: 1, column: 1 },
- source: 'two.js'
- });
- map.setSourceContent('one.js', 'one file content');
-
- map = JSON.parse(map.toString());
- assert.equal(map.sources[0], 'one.js');
- assert.equal(map.sources[1], 'two.js');
- assert.equal(map.sourcesContent[0], 'one file content');
- assert.equal(map.sourcesContent[1], null);
- };
-
- exports['test .fromSourceMap'] = function (assert, util) {
- var map = SourceMapGenerator.fromSourceMap(new SourceMapConsumer(util.testMap));
- util.assertEqualMaps(assert, map.toJSON(), util.testMap);
- };
-
- exports['test .fromSourceMap with sourcesContent'] = function (assert, util) {
- var map = SourceMapGenerator.fromSourceMap(
- new SourceMapConsumer(util.testMapWithSourcesContent));
- util.assertEqualMaps(assert, map.toJSON(), util.testMapWithSourcesContent);
- };
-
- exports['test applySourceMap'] = function (assert, util) {
- var node = new SourceNode(null, null, null, [
- new SourceNode(2, 0, 'fileX', 'lineX2\n'),
- 'genA1\n',
- new SourceNode(2, 0, 'fileY', 'lineY2\n'),
- 'genA2\n',
- new SourceNode(1, 0, 'fileX', 'lineX1\n'),
- 'genA3\n',
- new SourceNode(1, 0, 'fileY', 'lineY1\n')
- ]);
- var mapStep1 = node.toStringWithSourceMap({
- file: 'fileA'
- }).map;
- mapStep1.setSourceContent('fileX', 'lineX1\nlineX2\n');
- mapStep1 = mapStep1.toJSON();
-
- node = new SourceNode(null, null, null, [
- 'gen1\n',
- new SourceNode(1, 0, 'fileA', 'lineA1\n'),
- new SourceNode(2, 0, 'fileA', 'lineA2\n'),
- new SourceNode(3, 0, 'fileA', 'lineA3\n'),
- new SourceNode(4, 0, 'fileA', 'lineA4\n'),
- new SourceNode(1, 0, 'fileB', 'lineB1\n'),
- new SourceNode(2, 0, 'fileB', 'lineB2\n'),
- 'gen2\n'
- ]);
- var mapStep2 = node.toStringWithSourceMap({
- file: 'fileGen'
- }).map;
- mapStep2.setSourceContent('fileB', 'lineB1\nlineB2\n');
- mapStep2 = mapStep2.toJSON();
-
- node = new SourceNode(null, null, null, [
- 'gen1\n',
- new SourceNode(2, 0, 'fileX', 'lineA1\n'),
- new SourceNode(2, 0, 'fileA', 'lineA2\n'),
- new SourceNode(2, 0, 'fileY', 'lineA3\n'),
- new SourceNode(4, 0, 'fileA', 'lineA4\n'),
- new SourceNode(1, 0, 'fileB', 'lineB1\n'),
- new SourceNode(2, 0, 'fileB', 'lineB2\n'),
- 'gen2\n'
- ]);
- var expectedMap = node.toStringWithSourceMap({
- file: 'fileGen'
- }).map;
- expectedMap.setSourceContent('fileX', 'lineX1\nlineX2\n');
- expectedMap.setSourceContent('fileB', 'lineB1\nlineB2\n');
- expectedMap = expectedMap.toJSON();
-
- // apply source map "mapStep1" to "mapStep2"
- var generator = SourceMapGenerator.fromSourceMap(new SourceMapConsumer(mapStep2));
- generator.applySourceMap(new SourceMapConsumer(mapStep1));
- var actualMap = generator.toJSON();
-
- util.assertEqualMaps(assert, actualMap, expectedMap);
- };
-
- exports['test applySourceMap throws when file is missing'] = function (assert, util) {
- var map = new SourceMapGenerator({
- file: 'test.js'
- });
- var map2 = new SourceMapGenerator();
- assert.throws(function() {
- map.applySourceMap(new SourceMapConsumer(map2.toJSON()));
- });
- };
-
- exports['test the two additional parameters of applySourceMap'] = function (assert, util) {
- // Assume the following directory structure:
- //
- // http://foo.org/
- // bar.coffee
- // app/
- // coffee/
- // foo.coffee
- // temp/
- // bundle.js
- // temp_maps/
- // bundle.js.map
- // public/
- // bundle.min.js
- // bundle.min.js.map
- //
- // http://www.example.com/
- // baz.coffee
-
- var bundleMap = new SourceMapGenerator({
- file: 'bundle.js'
- });
- bundleMap.addMapping({
- generated: { line: 3, column: 3 },
- original: { line: 2, column: 2 },
- source: '../coffee/foo.coffee'
- });
- bundleMap.addMapping({
- generated: { line: 13, column: 13 },
- original: { line: 12, column: 12 },
- source: '/bar.coffee'
- });
- bundleMap.addMapping({
- generated: { line: 23, column: 23 },
- original: { line: 22, column: 22 },
- source: 'http://www.example.com/baz.coffee'
- });
- bundleMap = new SourceMapConsumer(bundleMap.toJSON());
-
- var minifiedMap = new SourceMapGenerator({
- file: 'bundle.min.js',
- sourceRoot: '..'
- });
- minifiedMap.addMapping({
- generated: { line: 1, column: 1 },
- original: { line: 3, column: 3 },
- source: 'temp/bundle.js'
- });
- minifiedMap.addMapping({
- generated: { line: 11, column: 11 },
- original: { line: 13, column: 13 },
- source: 'temp/bundle.js'
- });
- minifiedMap.addMapping({
- generated: { line: 21, column: 21 },
- original: { line: 23, column: 23 },
- source: 'temp/bundle.js'
- });
- minifiedMap = new SourceMapConsumer(minifiedMap.toJSON());
-
- var expectedMap = function (sources) {
- var map = new SourceMapGenerator({
- file: 'bundle.min.js',
- sourceRoot: '..'
- });
- map.addMapping({
- generated: { line: 1, column: 1 },
- original: { line: 2, column: 2 },
- source: sources[0]
- });
- map.addMapping({
- generated: { line: 11, column: 11 },
- original: { line: 12, column: 12 },
- source: sources[1]
- });
- map.addMapping({
- generated: { line: 21, column: 21 },
- original: { line: 22, column: 22 },
- source: sources[2]
- });
- return map.toJSON();
- }
-
- var actualMap = function (aSourceMapPath) {
- var map = SourceMapGenerator.fromSourceMap(minifiedMap);
- // Note that relying on `bundleMap.file` (which is simply 'bundle.js')
- // instead of supplying the second parameter wouldn't work here.
- map.applySourceMap(bundleMap, '../temp/bundle.js', aSourceMapPath);
- return map.toJSON();
- }
-
- util.assertEqualMaps(assert, actualMap('../temp_maps'), expectedMap([
- 'coffee/foo.coffee',
- '/bar.coffee',
- 'http://www.example.com/baz.coffee'
- ]));
-
- util.assertEqualMaps(assert, actualMap('/app/temp_maps'), expectedMap([
- '/app/coffee/foo.coffee',
- '/bar.coffee',
- 'http://www.example.com/baz.coffee'
- ]));
-
- util.assertEqualMaps(assert, actualMap('http://foo.org/app/temp_maps'), expectedMap([
- 'http://foo.org/app/coffee/foo.coffee',
- 'http://foo.org/bar.coffee',
- 'http://www.example.com/baz.coffee'
- ]));
- };
-
- exports['test sorting with duplicate generated mappings'] = function (assert, util) {
- var map = new SourceMapGenerator({
- file: 'test.js'
- });
- map.addMapping({
- generated: { line: 3, column: 0 },
- original: { line: 2, column: 0 },
- source: 'a.js'
- });
- map.addMapping({
- generated: { line: 2, column: 0 }
- });
- map.addMapping({
- generated: { line: 2, column: 0 }
- });
- map.addMapping({
- generated: { line: 1, column: 0 },
- original: { line: 1, column: 0 },
- source: 'a.js'
- });
-
- util.assertEqualMaps(assert, map.toJSON(), {
- version: 3,
- file: 'test.js',
- sources: ['a.js'],
- names: [],
- mappings: 'AAAA;A;AACA'
- });
- };
-
- exports['test ignore duplicate mappings.'] = function (assert, util) {
- var init = { file: 'min.js', sourceRoot: '/the/root' };
- var map1, map2;
-
- // null original source location
- var nullMapping1 = {
- generated: { line: 1, column: 0 }
- };
- var nullMapping2 = {
- generated: { line: 2, column: 2 }
- };
-
- map1 = new SourceMapGenerator(init);
- map2 = new SourceMapGenerator(init);
-
- map1.addMapping(nullMapping1);
- map1.addMapping(nullMapping1);
-
- map2.addMapping(nullMapping1);
-
- util.assertEqualMaps(assert, map1.toJSON(), map2.toJSON());
-
- map1.addMapping(nullMapping2);
- map1.addMapping(nullMapping1);
-
- map2.addMapping(nullMapping2);
-
- util.assertEqualMaps(assert, map1.toJSON(), map2.toJSON());
-
- // original source location
- var srcMapping1 = {
- generated: { line: 1, column: 0 },
- original: { line: 11, column: 0 },
- source: 'srcMapping1.js'
- };
- var srcMapping2 = {
- generated: { line: 2, column: 2 },
- original: { line: 11, column: 0 },
- source: 'srcMapping2.js'
- };
-
- map1 = new SourceMapGenerator(init);
- map2 = new SourceMapGenerator(init);
-
- map1.addMapping(srcMapping1);
- map1.addMapping(srcMapping1);
-
- map2.addMapping(srcMapping1);
-
- util.assertEqualMaps(assert, map1.toJSON(), map2.toJSON());
-
- map1.addMapping(srcMapping2);
- map1.addMapping(srcMapping1);
-
- map2.addMapping(srcMapping2);
-
- util.assertEqualMaps(assert, map1.toJSON(), map2.toJSON());
-
- // full original source and name information
- var fullMapping1 = {
- generated: { line: 1, column: 0 },
- original: { line: 11, column: 0 },
- source: 'fullMapping1.js',
- name: 'fullMapping1'
- };
- var fullMapping2 = {
- generated: { line: 2, column: 2 },
- original: { line: 11, column: 0 },
- source: 'fullMapping2.js',
- name: 'fullMapping2'
- };
-
- map1 = new SourceMapGenerator(init);
- map2 = new SourceMapGenerator(init);
-
- map1.addMapping(fullMapping1);
- map1.addMapping(fullMapping1);
-
- map2.addMapping(fullMapping1);
-
- util.assertEqualMaps(assert, map1.toJSON(), map2.toJSON());
-
- map1.addMapping(fullMapping2);
- map1.addMapping(fullMapping1);
-
- map2.addMapping(fullMapping2);
-
- util.assertEqualMaps(assert, map1.toJSON(), map2.toJSON());
- };
-
- exports['test github issue #72, check for duplicate names or sources'] = function (assert, util) {
- var map = new SourceMapGenerator({
- file: 'test.js'
- });
- map.addMapping({
- generated: { line: 1, column: 1 },
- original: { line: 2, column: 2 },
- source: 'a.js',
- name: 'foo'
- });
- map.addMapping({
- generated: { line: 3, column: 3 },
- original: { line: 4, column: 4 },
- source: 'a.js',
- name: 'foo'
- });
- util.assertEqualMaps(assert, map.toJSON(), {
- version: 3,
- file: 'test.js',
- sources: ['a.js'],
- names: ['foo'],
- mappings: 'CACEA;;GAEEA'
- });
- };
-
-});
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-node.js b/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-node.js
deleted file mode 100644
index e7afc4e7..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-node.js
+++ /dev/null
@@ -1,439 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-if (typeof define !== 'function') {
- var define = require('amdefine')(module, require);
-}
-define(function (require, exports, module) {
-
- var SourceMapGenerator = require('../../lib/source-map/source-map-generator').SourceMapGenerator;
- var SourceMapConsumer = require('../../lib/source-map/source-map-consumer').SourceMapConsumer;
- var SourceNode = require('../../lib/source-map/source-node').SourceNode;
-
- exports['test .add()'] = function (assert, util) {
- var node = new SourceNode(null, null, null);
-
- // Adding a string works.
- node.add('function noop() {}');
-
- // Adding another source node works.
- node.add(new SourceNode(null, null, null));
-
- // Adding an array works.
- node.add(['function foo() {',
- new SourceNode(null, null, null,
- 'return 10;'),
- '}']);
-
- // Adding other stuff doesn't.
- assert.throws(function () {
- node.add({});
- });
- assert.throws(function () {
- node.add(function () {});
- });
- };
-
- exports['test .prepend()'] = function (assert, util) {
- var node = new SourceNode(null, null, null);
-
- // Prepending a string works.
- node.prepend('function noop() {}');
- assert.equal(node.children[0], 'function noop() {}');
- assert.equal(node.children.length, 1);
-
- // Prepending another source node works.
- node.prepend(new SourceNode(null, null, null));
- assert.equal(node.children[0], '');
- assert.equal(node.children[1], 'function noop() {}');
- assert.equal(node.children.length, 2);
-
- // Prepending an array works.
- node.prepend(['function foo() {',
- new SourceNode(null, null, null,
- 'return 10;'),
- '}']);
- assert.equal(node.children[0], 'function foo() {');
- assert.equal(node.children[1], 'return 10;');
- assert.equal(node.children[2], '}');
- assert.equal(node.children[3], '');
- assert.equal(node.children[4], 'function noop() {}');
- assert.equal(node.children.length, 5);
-
- // Prepending other stuff doesn't.
- assert.throws(function () {
- node.prepend({});
- });
- assert.throws(function () {
- node.prepend(function () {});
- });
- };
-
- exports['test .toString()'] = function (assert, util) {
- assert.equal((new SourceNode(null, null, null,
- ['function foo() {',
- new SourceNode(null, null, null, 'return 10;'),
- '}'])).toString(),
- 'function foo() {return 10;}');
- };
-
- exports['test .join()'] = function (assert, util) {
- assert.equal((new SourceNode(null, null, null,
- ['a', 'b', 'c', 'd'])).join(', ').toString(),
- 'a, b, c, d');
- };
-
- exports['test .walk()'] = function (assert, util) {
- var node = new SourceNode(null, null, null,
- ['(function () {\n',
- ' ', new SourceNode(1, 0, 'a.js', ['someCall()']), ';\n',
- ' ', new SourceNode(2, 0, 'b.js', ['if (foo) bar()']), ';\n',
- '}());']);
- var expected = [
- { str: '(function () {\n', source: null, line: null, column: null },
- { str: ' ', source: null, line: null, column: null },
- { str: 'someCall()', source: 'a.js', line: 1, column: 0 },
- { str: ';\n', source: null, line: null, column: null },
- { str: ' ', source: null, line: null, column: null },
- { str: 'if (foo) bar()', source: 'b.js', line: 2, column: 0 },
- { str: ';\n', source: null, line: null, column: null },
- { str: '}());', source: null, line: null, column: null },
- ];
- var i = 0;
- node.walk(function (chunk, loc) {
- assert.equal(expected[i].str, chunk);
- assert.equal(expected[i].source, loc.source);
- assert.equal(expected[i].line, loc.line);
- assert.equal(expected[i].column, loc.column);
- i++;
- });
- };
-
- exports['test .replaceRight'] = function (assert, util) {
- var node;
-
- // Not nested
- node = new SourceNode(null, null, null, 'hello world');
- node.replaceRight(/world/, 'universe');
- assert.equal(node.toString(), 'hello universe');
-
- // Nested
- node = new SourceNode(null, null, null,
- [new SourceNode(null, null, null, 'hey sexy mama, '),
- new SourceNode(null, null, null, 'want to kill all humans?')]);
- node.replaceRight(/kill all humans/, 'watch Futurama');
- assert.equal(node.toString(), 'hey sexy mama, want to watch Futurama?');
- };
-
- exports['test .toStringWithSourceMap()'] = function (assert, util) {
- var node = new SourceNode(null, null, null,
- ['(function () {\n',
- ' ',
- new SourceNode(1, 0, 'a.js', 'someCall', 'originalCall'),
- new SourceNode(1, 8, 'a.js', '()'),
- ';\n',
- ' ', new SourceNode(2, 0, 'b.js', ['if (foo) bar()']), ';\n',
- '}());']);
- var map = node.toStringWithSourceMap({
- file: 'foo.js'
- }).map;
- var mapWithoutOptions = node.toStringWithSourceMap().map;
-
- assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator');
- assert.ok(mapWithoutOptions instanceof SourceMapGenerator, 'mapWithoutOptions instanceof SourceMapGenerator');
- mapWithoutOptions._file = 'foo.js';
- util.assertEqualMaps(assert, map.toJSON(), mapWithoutOptions.toJSON());
-
- map = new SourceMapConsumer(map.toString());
-
- var actual;
-
- actual = map.originalPositionFor({
- line: 1,
- column: 4
- });
- assert.equal(actual.source, null);
- assert.equal(actual.line, null);
- assert.equal(actual.column, null);
-
- actual = map.originalPositionFor({
- line: 2,
- column: 2
- });
- assert.equal(actual.source, 'a.js');
- assert.equal(actual.line, 1);
- assert.equal(actual.column, 0);
- assert.equal(actual.name, 'originalCall');
-
- actual = map.originalPositionFor({
- line: 3,
- column: 2
- });
- assert.equal(actual.source, 'b.js');
- assert.equal(actual.line, 2);
- assert.equal(actual.column, 0);
-
- actual = map.originalPositionFor({
- line: 3,
- column: 16
- });
- assert.equal(actual.source, null);
- assert.equal(actual.line, null);
- assert.equal(actual.column, null);
-
- actual = map.originalPositionFor({
- line: 4,
- column: 2
- });
- assert.equal(actual.source, null);
- assert.equal(actual.line, null);
- assert.equal(actual.column, null);
- };
-
- exports['test .fromStringWithSourceMap()'] = function (assert, util) {
- var node = SourceNode.fromStringWithSourceMap(
- util.testGeneratedCode,
- new SourceMapConsumer(util.testMap));
-
- var result = node.toStringWithSourceMap({
- file: 'min.js'
- });
- var map = result.map;
- var code = result.code;
-
- assert.equal(code, util.testGeneratedCode);
- assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator');
- map = map.toJSON();
- assert.equal(map.version, util.testMap.version);
- assert.equal(map.file, util.testMap.file);
- assert.equal(map.mappings, util.testMap.mappings);
- };
-
- exports['test .fromStringWithSourceMap() empty map'] = function (assert, util) {
- var node = SourceNode.fromStringWithSourceMap(
- util.testGeneratedCode,
- new SourceMapConsumer(util.emptyMap));
- var result = node.toStringWithSourceMap({
- file: 'min.js'
- });
- var map = result.map;
- var code = result.code;
-
- assert.equal(code, util.testGeneratedCode);
- assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator');
- map = map.toJSON();
- assert.equal(map.version, util.emptyMap.version);
- assert.equal(map.file, util.emptyMap.file);
- assert.equal(map.mappings.length, util.emptyMap.mappings.length);
- assert.equal(map.mappings, util.emptyMap.mappings);
- };
-
- exports['test .fromStringWithSourceMap() complex version'] = function (assert, util) {
- var input = new SourceNode(null, null, null, [
- "(function() {\n",
- " var Test = {};\n",
- " ", new SourceNode(1, 0, "a.js", "Test.A = { value: 1234 };\n"),
- " ", new SourceNode(2, 0, "a.js", "Test.A.x = 'xyz';"), "\n",
- "}());\n",
- "/* Generated Source */"]);
- input = input.toStringWithSourceMap({
- file: 'foo.js'
- });
-
- var node = SourceNode.fromStringWithSourceMap(
- input.code,
- new SourceMapConsumer(input.map.toString()));
-
- var result = node.toStringWithSourceMap({
- file: 'foo.js'
- });
- var map = result.map;
- var code = result.code;
-
- assert.equal(code, input.code);
- assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator');
- map = map.toJSON();
- var inputMap = input.map.toJSON();
- util.assertEqualMaps(assert, map, inputMap);
- };
-
- exports['test .toStringWithSourceMap() merging duplicate mappings'] = function (assert, util) {
- var input = new SourceNode(null, null, null, [
- new SourceNode(1, 0, "a.js", "(function"),
- new SourceNode(1, 0, "a.js", "() {\n"),
- " ",
- new SourceNode(1, 0, "a.js", "var Test = "),
- new SourceNode(1, 0, "b.js", "{};\n"),
- new SourceNode(2, 0, "b.js", "Test"),
- new SourceNode(2, 0, "b.js", ".A", "A"),
- new SourceNode(2, 20, "b.js", " = { value: ", "A"),
- "1234",
- new SourceNode(2, 40, "b.js", " };\n", "A"),
- "}());\n",
- "/* Generated Source */"
- ]);
- input = input.toStringWithSourceMap({
- file: 'foo.js'
- });
-
- var correctMap = new SourceMapGenerator({
- file: 'foo.js'
- });
- correctMap.addMapping({
- generated: { line: 1, column: 0 },
- source: 'a.js',
- original: { line: 1, column: 0 }
- });
- // Here is no need for a empty mapping,
- // because mappings ends at eol
- correctMap.addMapping({
- generated: { line: 2, column: 2 },
- source: 'a.js',
- original: { line: 1, column: 0 }
- });
- correctMap.addMapping({
- generated: { line: 2, column: 13 },
- source: 'b.js',
- original: { line: 1, column: 0 }
- });
- correctMap.addMapping({
- generated: { line: 3, column: 0 },
- source: 'b.js',
- original: { line: 2, column: 0 }
- });
- correctMap.addMapping({
- generated: { line: 3, column: 4 },
- source: 'b.js',
- name: 'A',
- original: { line: 2, column: 0 }
- });
- correctMap.addMapping({
- generated: { line: 3, column: 6 },
- source: 'b.js',
- name: 'A',
- original: { line: 2, column: 20 }
- });
- // This empty mapping is required,
- // because there is a hole in the middle of the line
- correctMap.addMapping({
- generated: { line: 3, column: 18 }
- });
- correctMap.addMapping({
- generated: { line: 3, column: 22 },
- source: 'b.js',
- name: 'A',
- original: { line: 2, column: 40 }
- });
- // Here is no need for a empty mapping,
- // because mappings ends at eol
-
- var inputMap = input.map.toJSON();
- correctMap = correctMap.toJSON();
- util.assertEqualMaps(assert, inputMap, correctMap);
- };
-
- exports['test .toStringWithSourceMap() multi-line SourceNodes'] = function (assert, util) {
- var input = new SourceNode(null, null, null, [
- new SourceNode(1, 0, "a.js", "(function() {\nvar nextLine = 1;\nanotherLine();\n"),
- new SourceNode(2, 2, "b.js", "Test.call(this, 123);\n"),
- new SourceNode(2, 2, "b.js", "this['stuff'] = 'v';\n"),
- new SourceNode(2, 2, "b.js", "anotherLine();\n"),
- "/*\nGenerated\nSource\n*/\n",
- new SourceNode(3, 4, "c.js", "anotherLine();\n"),
- "/*\nGenerated\nSource\n*/"
- ]);
- input = input.toStringWithSourceMap({
- file: 'foo.js'
- });
-
- var correctMap = new SourceMapGenerator({
- file: 'foo.js'
- });
- correctMap.addMapping({
- generated: { line: 1, column: 0 },
- source: 'a.js',
- original: { line: 1, column: 0 }
- });
- correctMap.addMapping({
- generated: { line: 2, column: 0 },
- source: 'a.js',
- original: { line: 1, column: 0 }
- });
- correctMap.addMapping({
- generated: { line: 3, column: 0 },
- source: 'a.js',
- original: { line: 1, column: 0 }
- });
- correctMap.addMapping({
- generated: { line: 4, column: 0 },
- source: 'b.js',
- original: { line: 2, column: 2 }
- });
- correctMap.addMapping({
- generated: { line: 5, column: 0 },
- source: 'b.js',
- original: { line: 2, column: 2 }
- });
- correctMap.addMapping({
- generated: { line: 6, column: 0 },
- source: 'b.js',
- original: { line: 2, column: 2 }
- });
- correctMap.addMapping({
- generated: { line: 11, column: 0 },
- source: 'c.js',
- original: { line: 3, column: 4 }
- });
-
- var inputMap = input.map.toJSON();
- correctMap = correctMap.toJSON();
- util.assertEqualMaps(assert, inputMap, correctMap);
- };
-
- exports['test setSourceContent with toStringWithSourceMap'] = function (assert, util) {
- var aNode = new SourceNode(1, 1, 'a.js', 'a');
- aNode.setSourceContent('a.js', 'someContent');
- var node = new SourceNode(null, null, null,
- ['(function () {\n',
- ' ', aNode,
- ' ', new SourceNode(1, 1, 'b.js', 'b'),
- '}());']);
- node.setSourceContent('b.js', 'otherContent');
- var map = node.toStringWithSourceMap({
- file: 'foo.js'
- }).map;
-
- assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator');
- map = new SourceMapConsumer(map.toString());
-
- assert.equal(map.sources.length, 2);
- assert.equal(map.sources[0], 'a.js');
- assert.equal(map.sources[1], 'b.js');
- assert.equal(map.sourcesContent.length, 2);
- assert.equal(map.sourcesContent[0], 'someContent');
- assert.equal(map.sourcesContent[1], 'otherContent');
- };
-
- exports['test walkSourceContents'] = function (assert, util) {
- var aNode = new SourceNode(1, 1, 'a.js', 'a');
- aNode.setSourceContent('a.js', 'someContent');
- var node = new SourceNode(null, null, null,
- ['(function () {\n',
- ' ', aNode,
- ' ', new SourceNode(1, 1, 'b.js', 'b'),
- '}());']);
- node.setSourceContent('b.js', 'otherContent');
- var results = [];
- node.walkSourceContents(function (sourceFile, sourceContent) {
- results.push([sourceFile, sourceContent]);
- });
- assert.equal(results.length, 2);
- assert.equal(results[0][0], 'a.js');
- assert.equal(results[0][1], 'someContent');
- assert.equal(results[1][0], 'b.js');
- assert.equal(results[1][1], 'otherContent');
- };
-});
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-util.js b/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-util.js
deleted file mode 100644
index 22e9a9e3..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/test-util.js
+++ /dev/null
@@ -1,127 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2014 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-if (typeof define !== 'function') {
- var define = require('amdefine')(module, require);
-}
-define(function (require, exports, module) {
-
- var libUtil = require('../../lib/source-map/util');
-
- exports['test urls'] = function (assert, util) {
- var assertUrl = function (url) {
- assert.equal(url, libUtil.urlGenerate(libUtil.urlParse(url)));
- };
- assertUrl('http://');
- assertUrl('http://www.example.com');
- assertUrl('http://user:pass@www.example.com');
- assertUrl('http://www.example.com:80');
- assertUrl('http://www.example.com/');
- assertUrl('http://www.example.com/foo/bar');
- assertUrl('http://www.example.com/foo/bar/');
- assertUrl('http://user:pass@www.example.com:80/foo/bar/');
-
- assertUrl('//');
- assertUrl('//www.example.com');
- assertUrl('file:///www.example.com');
-
- assert.equal(libUtil.urlParse('a//b'), null);
- };
-
- exports['test normalize()'] = function (assert, util) {
- assert.equal(libUtil.normalize('/..'), '/');
- assert.equal(libUtil.normalize('/../'), '/');
- assert.equal(libUtil.normalize('/../../../..'), '/');
- assert.equal(libUtil.normalize('/../../../../a/b/c'), '/a/b/c');
- assert.equal(libUtil.normalize('/a/b/c/../../../d/../../e'), '/e');
-
- assert.equal(libUtil.normalize('..'), '..');
- assert.equal(libUtil.normalize('../'), '../');
- assert.equal(libUtil.normalize('../../a/'), '../../a/');
- assert.equal(libUtil.normalize('a/..'), '.');
- assert.equal(libUtil.normalize('a/../../..'), '../..');
-
- assert.equal(libUtil.normalize('/.'), '/');
- assert.equal(libUtil.normalize('/./'), '/');
- assert.equal(libUtil.normalize('/./././.'), '/');
- assert.equal(libUtil.normalize('/././././a/b/c'), '/a/b/c');
- assert.equal(libUtil.normalize('/a/b/c/./././d/././e'), '/a/b/c/d/e');
-
- assert.equal(libUtil.normalize('.'), '.');
- assert.equal(libUtil.normalize('./'), '.');
- assert.equal(libUtil.normalize('././a'), 'a');
- assert.equal(libUtil.normalize('a/./'), 'a/');
- assert.equal(libUtil.normalize('a/././.'), 'a');
-
- assert.equal(libUtil.normalize('/a/b//c////d/////'), '/a/b/c/d/');
- assert.equal(libUtil.normalize('///a/b//c////d/////'), '///a/b/c/d/');
- assert.equal(libUtil.normalize('a/b//c////d'), 'a/b/c/d');
-
- assert.equal(libUtil.normalize('.///.././../a/b//./..'), '../../a')
-
- assert.equal(libUtil.normalize('http://www.example.com'), 'http://www.example.com');
- assert.equal(libUtil.normalize('http://www.example.com/'), 'http://www.example.com/');
- assert.equal(libUtil.normalize('http://www.example.com/./..//a/b/c/.././d//'), 'http://www.example.com/a/b/d/');
- };
-
- exports['test join()'] = function (assert, util) {
- assert.equal(libUtil.join('a', 'b'), 'a/b');
- assert.equal(libUtil.join('a/', 'b'), 'a/b');
- assert.equal(libUtil.join('a//', 'b'), 'a/b');
- assert.equal(libUtil.join('a', 'b/'), 'a/b/');
- assert.equal(libUtil.join('a', 'b//'), 'a/b/');
- assert.equal(libUtil.join('a/', '/b'), '/b');
- assert.equal(libUtil.join('a//', '//b'), '//b');
-
- assert.equal(libUtil.join('a', '..'), '.');
- assert.equal(libUtil.join('a', '../b'), 'b');
- assert.equal(libUtil.join('a/b', '../c'), 'a/c');
-
- assert.equal(libUtil.join('a', '.'), 'a');
- assert.equal(libUtil.join('a', './b'), 'a/b');
- assert.equal(libUtil.join('a/b', './c'), 'a/b/c');
-
- assert.equal(libUtil.join('a', 'http://www.example.com'), 'http://www.example.com');
- assert.equal(libUtil.join('a', 'data:foo,bar'), 'data:foo,bar');
-
-
- assert.equal(libUtil.join('http://foo.org/a', 'b'), 'http://foo.org/a/b');
- assert.equal(libUtil.join('http://foo.org/a/', 'b'), 'http://foo.org/a/b');
- assert.equal(libUtil.join('http://foo.org/a//', 'b'), 'http://foo.org/a/b');
- assert.equal(libUtil.join('http://foo.org/a', 'b/'), 'http://foo.org/a/b/');
- assert.equal(libUtil.join('http://foo.org/a', 'b//'), 'http://foo.org/a/b/');
- assert.equal(libUtil.join('http://foo.org/a/', '/b'), 'http://foo.org/b');
- assert.equal(libUtil.join('http://foo.org/a//', '//b'), 'http://b');
-
- assert.equal(libUtil.join('http://foo.org/a', '..'), 'http://foo.org/');
- assert.equal(libUtil.join('http://foo.org/a', '../b'), 'http://foo.org/b');
- assert.equal(libUtil.join('http://foo.org/a/b', '../c'), 'http://foo.org/a/c');
-
- assert.equal(libUtil.join('http://foo.org/a', '.'), 'http://foo.org/a');
- assert.equal(libUtil.join('http://foo.org/a', './b'), 'http://foo.org/a/b');
- assert.equal(libUtil.join('http://foo.org/a/b', './c'), 'http://foo.org/a/b/c');
-
- assert.equal(libUtil.join('http://foo.org/a', 'http://www.example.com'), 'http://www.example.com');
- assert.equal(libUtil.join('http://foo.org/a', 'data:foo,bar'), 'data:foo,bar');
-
-
- assert.equal(libUtil.join('http://foo.org', 'a'), 'http://foo.org/a');
- assert.equal(libUtil.join('http://foo.org/', 'a'), 'http://foo.org/a');
- assert.equal(libUtil.join('http://foo.org//', 'a'), 'http://foo.org/a');
- assert.equal(libUtil.join('http://foo.org', '/a'), 'http://foo.org/a');
- assert.equal(libUtil.join('http://foo.org/', '/a'), 'http://foo.org/a');
- assert.equal(libUtil.join('http://foo.org//', '/a'), 'http://foo.org/a');
-
-
- assert.equal(libUtil.join('http://', 'www.example.com'), 'http://www.example.com');
- assert.equal(libUtil.join('file:///', 'www.example.com'), 'file:///www.example.com');
- assert.equal(libUtil.join('http://', 'ftp://example.com'), 'ftp://example.com');
-
- assert.equal(libUtil.join('http://www.example.com', '//foo.org/bar'), 'http://foo.org/bar');
- assert.equal(libUtil.join('//www.example.com', '//foo.org/bar'), '//foo.org/bar');
- };
-
-});
diff --git a/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/util.js b/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/util.js
deleted file mode 100644
index 288046bf..00000000
--- a/builder/node_modules/uglify-js/node_modules/source-map/test/source-map/util.js
+++ /dev/null
@@ -1,161 +0,0 @@
-/* -*- Mode: js; js-indent-level: 2; -*- */
-/*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
-if (typeof define !== 'function') {
- var define = require('amdefine')(module, require);
-}
-define(function (require, exports, module) {
-
- var util = require('../../lib/source-map/util');
-
- // This is a test mapping which maps functions from two different files
- // (one.js and two.js) to a minified generated source.
- //
- // Here is one.js:
- //
- // ONE.foo = function (bar) {
- // return baz(bar);
- // };
- //
- // Here is two.js:
- //
- // TWO.inc = function (n) {
- // return n + 1;
- // };
- //
- // And here is the generated code (min.js):
- //
- // ONE.foo=function(a){return baz(a);};
- // TWO.inc=function(a){return a+1;};
- exports.testGeneratedCode = " ONE.foo=function(a){return baz(a);};\n"+
- " TWO.inc=function(a){return a+1;};";
- exports.testMap = {
- version: 3,
- file: 'min.js',
- names: ['bar', 'baz', 'n'],
- sources: ['one.js', 'two.js'],
- sourceRoot: '/the/root',
- mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'
- };
- exports.testMapWithSourcesContent = {
- version: 3,
- file: 'min.js',
- names: ['bar', 'baz', 'n'],
- sources: ['one.js', 'two.js'],
- sourcesContent: [
- ' ONE.foo = function (bar) {\n' +
- ' return baz(bar);\n' +
- ' };',
- ' TWO.inc = function (n) {\n' +
- ' return n + 1;\n' +
- ' };'
- ],
- sourceRoot: '/the/root',
- mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'
- };
- exports.emptyMap = {
- version: 3,
- file: 'min.js',
- names: [],
- sources: [],
- mappings: ''
- };
-
-
- function assertMapping(generatedLine, generatedColumn, originalSource,
- originalLine, originalColumn, name, map, assert,
- dontTestGenerated, dontTestOriginal) {
- if (!dontTestOriginal) {
- var origMapping = map.originalPositionFor({
- line: generatedLine,
- column: generatedColumn
- });
- assert.equal(origMapping.name, name,
- 'Incorrect name, expected ' + JSON.stringify(name)
- + ', got ' + JSON.stringify(origMapping.name));
- assert.equal(origMapping.line, originalLine,
- 'Incorrect line, expected ' + JSON.stringify(originalLine)
- + ', got ' + JSON.stringify(origMapping.line));
- assert.equal(origMapping.column, originalColumn,
- 'Incorrect column, expected ' + JSON.stringify(originalColumn)
- + ', got ' + JSON.stringify(origMapping.column));
-
- var expectedSource;
-
- if (originalSource && map.sourceRoot && originalSource.indexOf(map.sourceRoot) === 0) {
- expectedSource = originalSource;
- } else if (originalSource) {
- expectedSource = map.sourceRoot
- ? util.join(map.sourceRoot, originalSource)
- : originalSource;
- } else {
- expectedSource = null;
- }
-
- assert.equal(origMapping.source, expectedSource,
- 'Incorrect source, expected ' + JSON.stringify(expectedSource)
- + ', got ' + JSON.stringify(origMapping.source));
- }
-
- if (!dontTestGenerated) {
- var genMapping = map.generatedPositionFor({
- source: originalSource,
- line: originalLine,
- column: originalColumn
- });
- assert.equal(genMapping.line, generatedLine,
- 'Incorrect line, expected ' + JSON.stringify(generatedLine)
- + ', got ' + JSON.stringify(genMapping.line));
- assert.equal(genMapping.column, generatedColumn,
- 'Incorrect column, expected ' + JSON.stringify(generatedColumn)
- + ', got ' + JSON.stringify(genMapping.column));
- }
- }
- exports.assertMapping = assertMapping;
-
- function assertEqualMaps(assert, actualMap, expectedMap) {
- assert.equal(actualMap.version, expectedMap.version, "version mismatch");
- assert.equal(actualMap.file, expectedMap.file, "file mismatch");
- assert.equal(actualMap.names.length,
- expectedMap.names.length,
- "names length mismatch: " +
- actualMap.names.join(", ") + " != " + expectedMap.names.join(", "));
- for (var i = 0; i < actualMap.names.length; i++) {
- assert.equal(actualMap.names[i],
- expectedMap.names[i],
- "names[" + i + "] mismatch: " +
- actualMap.names.join(", ") + " != " + expectedMap.names.join(", "));
- }
- assert.equal(actualMap.sources.length,
- expectedMap.sources.length,
- "sources length mismatch: " +
- actualMap.sources.join(", ") + " != " + expectedMap.sources.join(", "));
- for (var i = 0; i < actualMap.sources.length; i++) {
- assert.equal(actualMap.sources[i],
- expectedMap.sources[i],
- "sources[" + i + "] length mismatch: " +
- actualMap.sources.join(", ") + " != " + expectedMap.sources.join(", "));
- }
- assert.equal(actualMap.sourceRoot,
- expectedMap.sourceRoot,
- "sourceRoot mismatch: " +
- actualMap.sourceRoot + " != " + expectedMap.sourceRoot);
- assert.equal(actualMap.mappings, expectedMap.mappings,
- "mappings mismatch:\nActual: " + actualMap.mappings + "\nExpected: " + expectedMap.mappings);
- if (actualMap.sourcesContent) {
- assert.equal(actualMap.sourcesContent.length,
- expectedMap.sourcesContent.length,
- "sourcesContent length mismatch");
- for (var i = 0; i < actualMap.sourcesContent.length; i++) {
- assert.equal(actualMap.sourcesContent[i],
- expectedMap.sourcesContent[i],
- "sourcesContent[" + i + "] mismatch");
- }
- }
- }
- exports.assertEqualMaps = assertEqualMaps;
-
-});
diff --git a/builder/node_modules/uglify-js/node_modules/uglify-to-browserify/.npmignore b/builder/node_modules/uglify-js/node_modules/uglify-to-browserify/.npmignore
deleted file mode 100644
index 3e56974b..00000000
--- a/builder/node_modules/uglify-js/node_modules/uglify-to-browserify/.npmignore
+++ /dev/null
@@ -1,14 +0,0 @@
-lib-cov
-*.seed
-*.log
-*.csv
-*.dat
-*.out
-*.pid
-*.gz
-pids
-logs
-results
-npm-debug.log
-node_modules
-/test/output.js
diff --git a/builder/node_modules/uglify-js/node_modules/uglify-to-browserify/.travis.yml b/builder/node_modules/uglify-js/node_modules/uglify-to-browserify/.travis.yml
deleted file mode 100644
index 87f8cd91..00000000
--- a/builder/node_modules/uglify-js/node_modules/uglify-to-browserify/.travis.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-language: node_js
-node_js:
- - "0.10"
\ No newline at end of file
diff --git a/builder/node_modules/uglify-js/node_modules/uglify-to-browserify/LICENSE b/builder/node_modules/uglify-js/node_modules/uglify-to-browserify/LICENSE
deleted file mode 100644
index 35cc606f..00000000
--- a/builder/node_modules/uglify-js/node_modules/uglify-to-browserify/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2013 Forbes Lindesay
-
-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.
\ No newline at end of file
diff --git a/builder/node_modules/uglify-js/node_modules/uglify-to-browserify/README.md b/builder/node_modules/uglify-js/node_modules/uglify-to-browserify/README.md
deleted file mode 100644
index c5dde969..00000000
--- a/builder/node_modules/uglify-js/node_modules/uglify-to-browserify/README.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# uglify-to-browserify
-
-A transform to make UglifyJS work in browserify.
-
-[](https://travis-ci.org/ForbesLindesay/uglify-to-browserify)
-[](https://gemnasium.com/ForbesLindesay/uglify-to-browserify)
-[](http://badge.fury.io/js/uglify-to-browserify)
-
-## Installation
-
- npm install uglify-to-browserify
-
-## License
-
- MIT
\ No newline at end of file
diff --git a/builder/node_modules/uglify-js/node_modules/uglify-to-browserify/index.js b/builder/node_modules/uglify-js/node_modules/uglify-to-browserify/index.js
deleted file mode 100644
index c1741b27..00000000
--- a/builder/node_modules/uglify-js/node_modules/uglify-to-browserify/index.js
+++ /dev/null
@@ -1,49 +0,0 @@
-'use strict'
-
-var fs = require('fs')
-var PassThrough = require('stream').PassThrough
-var Transform = require('stream').Transform
-
-if (typeof Transform === 'undefined') {
- throw new Error('UglifyJS only supports browserify when using node >= 0.10.x')
-}
-
-var cache = {}
-module.exports = transform
-function transform(file) {
- if (!/tools\/node\.js$/.test(file.replace(/\\/g,'/'))) return new PassThrough();
- if (cache[file]) return makeStream(cache[file])
- var uglify = require(file)
- var src = 'var sys = require("util");\nvar MOZ_SourceMap = require("source-map");\nvar UglifyJS = exports;\n' + uglify.FILES.map(function (path) { return fs.readFileSync(path, 'utf8') }).join('\n')
-
- var ast = uglify.parse(src)
- ast.figure_out_scope()
-
- var variables = ast.variables
- .map(function (node, name) {
- return name
- })
-
- src += '\n\n' + variables.map(function (v) { return 'exports.' + v + ' = ' + v + ';' }).join('\n') + '\n\n'
-
- src += 'exports.AST_Node.warn_function = function (txt) { if (typeof console != "undefined" && typeof console.warn === "function") console.warn(txt) }\n\n'
-
- src += 'exports.minify = ' + uglify.minify.toString() + ';\n\n'
- src += 'exports.describe_ast = ' + uglify.describe_ast.toString() + ';'
-
- // TODO: remove once https://github.com/substack/node-browserify/issues/631 is resolved
- src = src.replace(/"for"/g, '"fo" + "r"')
-
- cache[file] = src
- return makeStream(src);
-}
-
-function makeStream(src) {
- var res = new Transform();
- res._transform = function (chunk, encoding, callback) { callback() }
- res._flush = function (callback) {
- res.push(src)
- callback()
- }
- return res;
-}
diff --git a/builder/node_modules/uglify-js/node_modules/uglify-to-browserify/package.json b/builder/node_modules/uglify-js/node_modules/uglify-to-browserify/package.json
deleted file mode 100644
index ba725171..00000000
--- a/builder/node_modules/uglify-js/node_modules/uglify-to-browserify/package.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "name": "uglify-to-browserify",
- "version": "1.0.2",
- "description": "A transform to make UglifyJS work in browserify.",
- "keywords": [],
- "dependencies": {},
- "devDependencies": {
- "uglify-js": "~2.4.0",
- "source-map": "~0.1.27"
- },
- "scripts": {
- "test": "node test/index.js"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/ForbesLindesay/uglify-to-browserify.git"
- },
- "author": {
- "name": "ForbesLindesay"
- },
- "license": "MIT",
- "readme": "# uglify-to-browserify\r\n\r\nA transform to make UglifyJS work in browserify.\r\n\r\n[](https://travis-ci.org/ForbesLindesay/uglify-to-browserify)\r\n[](https://gemnasium.com/ForbesLindesay/uglify-to-browserify)\r\n[](http://badge.fury.io/js/uglify-to-browserify)\r\n\r\n## Installation\r\n\r\n npm install uglify-to-browserify\r\n\r\n## License\r\n\r\n MIT",
- "readmeFilename": "README.md",
- "bugs": {
- "url": "https://github.com/ForbesLindesay/uglify-to-browserify/issues"
- },
- "homepage": "https://github.com/ForbesLindesay/uglify-to-browserify",
- "_id": "uglify-to-browserify@1.0.2",
- "dist": {
- "shasum": "6a39ace3bfd036cea06045a93fa26c44ddc481c1"
- },
- "_from": "uglify-to-browserify@~1.0.0",
- "_resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz"
-}
diff --git a/builder/node_modules/uglify-js/node_modules/uglify-to-browserify/test/index.js b/builder/node_modules/uglify-js/node_modules/uglify-to-browserify/test/index.js
deleted file mode 100644
index 6befb6b2..00000000
--- a/builder/node_modules/uglify-js/node_modules/uglify-to-browserify/test/index.js
+++ /dev/null
@@ -1,22 +0,0 @@
-var fs = require('fs')
-var br = require('../')
-var test = fs.readFileSync(require.resolve('uglify-js/test/run-tests.js'), 'utf8')
- .replace(/^#.*\n/, '')
-
-var transform = br(require.resolve('uglify-js'))
-transform.pipe(fs.createWriteStream(__dirname + '/output.js'))
- .on('close', function () {
- Function('module,require', test)({
- filename: require.resolve('uglify-js/test/run-tests.js')
- },
- function (name) {
- if (name === '../tools/node') {
- return require('./output.js')
- } else if (/^[a-z]+$/.test(name)) {
- return require(name)
- } else {
- throw new Error('I didn\'t expect you to require ' + name)
- }
- })
- })
-transform.end(fs.readFileSync(require.resolve('uglify-js'), 'utf8'))
\ No newline at end of file
diff --git a/builder/node_modules/uglify-js/package.json b/builder/node_modules/uglify-js/package.json
deleted file mode 100644
index c90acd19..00000000
--- a/builder/node_modules/uglify-js/package.json
+++ /dev/null
@@ -1,49 +0,0 @@
-{
- "name": "uglify-js",
- "description": "JavaScript parser, mangler/compressor and beautifier toolkit",
- "homepage": "http://lisperator.net/uglifyjs",
- "main": "tools/node.js",
- "version": "2.4.13",
- "engines": {
- "node": ">=0.4.0"
- },
- "maintainers": [
- {
- "name": "Mihai Bazon",
- "email": "mihai.bazon@gmail.com",
- "url": "http://lisperator.net/"
- }
- ],
- "repository": {
- "type": "git",
- "url": "https://github.com/mishoo/UglifyJS2.git"
- },
- "dependencies": {
- "async": "~0.2.6",
- "source-map": "~0.1.33",
- "optimist": "~0.3.5",
- "uglify-to-browserify": "~1.0.0"
- },
- "browserify": {
- "transform": [
- "uglify-to-browserify"
- ]
- },
- "bin": {
- "uglifyjs": "bin/uglifyjs"
- },
- "scripts": {
- "test": "node test/run-tests.js"
- },
- "readme": "UglifyJS 2\n==========\n[](https://travis-ci.org/mishoo/UglifyJS2)\n\nUglifyJS is a JavaScript parser, minifier, compressor or beautifier toolkit.\n\nThis page documents the command line utility. For\n[API and internals documentation see my website](http://lisperator.net/uglifyjs/).\nThere's also an\n[in-browser online demo](http://lisperator.net/uglifyjs/#demo) (for Firefox,\nChrome and probably Safari).\n\nInstall\n-------\n\nFirst make sure you have installed the latest version of [node.js](http://nodejs.org/)\n(You may need to restart your computer after this step).\n\nFrom NPM for use as a command line app:\n\n npm install uglify-js -g\n\nFrom NPM for programmatic use:\n\n npm install uglify-js\n\nFrom Git:\n\n git clone git://github.com/mishoo/UglifyJS2.git\n cd UglifyJS2\n npm link .\n\nUsage\n-----\n\n uglifyjs [input files] [options]\n\nUglifyJS2 can take multiple input files. It's recommended that you pass the\ninput files first, then pass the options. UglifyJS will parse input files\nin sequence and apply any compression options. The files are parsed in the\nsame global scope, that is, a reference from a file to some\nvariable/function declared in another file will be matched properly.\n\nIf you want to read from STDIN instead, pass a single dash instead of input\nfiles.\n\nThe available options are:\n\n```\n --source-map Specify an output file where to generate source map.\n [string]\n --source-map-root The path to the original source to be included in the\n source map. [string]\n --source-map-url The path to the source map to be added in //#\n sourceMappingURL. Defaults to the value passed with\n --source-map. [string]\n --source-map-include-sources\n Pass this flag if you want to include the content of\n source files in the source map as sourcesContent\n property. [boolean]\n --in-source-map Input source map, useful if you're compressing JS that was\n generated from some other original code.\n --screw-ie8 Pass this flag if you don't care about full compliance\n with Internet Explorer 6-8 quirks (by default UglifyJS\n will try to be IE-proof). [boolean]\n --expr Parse a single expression, rather than a program (for\n parsing JSON) [boolean]\n -p, --prefix Skip prefix for original filenames that appear in source\n maps. For example -p 3 will drop 3 directories from file\n names and ensure they are relative paths. You can also\n specify -p relative, which will make UglifyJS figure out\n itself the relative paths between original sources, the\n source map and the output file. [string]\n -o, --output Output file (default STDOUT).\n -b, --beautify Beautify output/specify output options. [string]\n -m, --mangle Mangle names/pass mangler options. [string]\n -r, --reserved Reserved names to exclude from mangling.\n -c, --compress Enable compressor/pass compressor options. Pass options\n like -c hoist_vars=false,if_return=false. Use -c with no\n argument to use the default compression options. [string]\n -d, --define Global definitions [string]\n -e, --enclose Embed everything in a big function, with a configurable\n parameter/argument list. [string]\n --comments Preserve copyright comments in the output. By default this\n works like Google Closure, keeping JSDoc-style comments\n that contain \"@license\" or \"@preserve\". You can optionally\n pass one of the following arguments to this flag:\n - \"all\" to keep all comments\n - a valid JS regexp (needs to start with a slash) to keep\n only comments that match.\n Note that currently not *all* comments can be kept when\n compression is on, because of dead code removal or\n cascading statements into sequences. [string]\n --preamble Preamble to prepend to the output. You can use this to\n insert a comment, for example for licensing information.\n This will not be parsed, but the source map will adjust\n for its presence.\n --stats Display operations run time on STDERR. [boolean]\n --acorn Use Acorn for parsing. [boolean]\n --spidermonkey Assume input files are SpiderMonkey AST format (as JSON).\n [boolean]\n --self Build itself (UglifyJS2) as a library (implies\n --wrap=UglifyJS --export-all) [boolean]\n --wrap Embed everything in a big function, making the “exports”\n and “global” variables available. You need to pass an\n argument to this option to specify the name that your\n module will take when included in, say, a browser.\n [string]\n --export-all Only used when --wrap, this tells UglifyJS to add code to\n automatically export all globals. [boolean]\n --lint Display some scope warnings [boolean]\n -v, --verbose Verbose [boolean]\n -V, --version Print version number and exit. [boolean]\n```\n\nSpecify `--output` (`-o`) to declare the output file. Otherwise the output\ngoes to STDOUT.\n\n## Source map options\n\nUglifyJS2 can generate a source map file, which is highly useful for\ndebugging your compressed JavaScript. To get a source map, pass\n`--source-map output.js.map` (full path to the file where you want the\nsource map dumped).\n\nAdditionally you might need `--source-map-root` to pass the URL where the\noriginal files can be found. In case you are passing full paths to input\nfiles to UglifyJS, you can use `--prefix` (`-p`) to specify the number of\ndirectories to drop from the path prefix when declaring files in the source\nmap.\n\nFor example:\n\n uglifyjs /home/doe/work/foo/src/js/file1.js \\\n /home/doe/work/foo/src/js/file2.js \\\n -o foo.min.js \\\n --source-map foo.min.js.map \\\n --source-map-root http://foo.com/src \\\n -p 5 -c -m\n\nThe above will compress and mangle `file1.js` and `file2.js`, will drop the\noutput in `foo.min.js` and the source map in `foo.min.js.map`. The source\nmapping will refer to `http://foo.com/src/js/file1.js` and\n`http://foo.com/src/js/file2.js` (in fact it will list `http://foo.com/src`\nas the source map root, and the original files as `js/file1.js` and\n`js/file2.js`).\n\n### Composed source map\n\nWhen you're compressing JS code that was output by a compiler such as\nCoffeeScript, mapping to the JS code won't be too helpful. Instead, you'd\nlike to map back to the original code (i.e. CoffeeScript). UglifyJS has an\noption to take an input source map. Assuming you have a mapping from\nCoffeeScript → compiled JS, UglifyJS can generate a map from CoffeeScript →\ncompressed JS by mapping every token in the compiled JS to its original\nlocation.\n\nTo use this feature you need to pass `--in-source-map\n/path/to/input/source.map`. Normally the input source map should also point\nto the file containing the generated JS, so if that's correct you can omit\ninput files from the command line.\n\n## Mangler options\n\nTo enable the mangler you need to pass `--mangle` (`-m`). The following\n(comma-separated) options are supported:\n\n- `sort` — to assign shorter names to most frequently used variables. This\n saves a few hundred bytes on jQuery before gzip, but the output is\n _bigger_ after gzip (and seems to happen for other libraries I tried it\n on) therefore it's not enabled by default.\n\n- `toplevel` — mangle names declared in the toplevel scope (disabled by\n default).\n\n- `eval` — mangle names visible in scopes where `eval` or `with` are used\n (disabled by default).\n\nWhen mangling is enabled but you want to prevent certain names from being\nmangled, you can declare those names with `--reserved` (`-r`) — pass a\ncomma-separated list of names. For example:\n\n uglifyjs ... -m -r '$,require,exports'\n\nto prevent the `require`, `exports` and `$` names from being changed.\n\n## Compressor options\n\nYou need to pass `--compress` (`-c`) to enable the compressor. Optionally\nyou can pass a comma-separated list of options. Options are in the form\n`foo=bar`, or just `foo` (the latter implies a boolean option that you want\nto set `true`; it's effectively a shortcut for `foo=true`).\n\n- `sequences` -- join consecutive simple statements using the comma operator\n\n- `properties` -- rewrite property access using the dot notation, for\n example `foo[\"bar\"] → foo.bar`\n\n- `dead_code` -- remove unreachable code\n\n- `drop_debugger` -- remove `debugger;` statements\n\n- `unsafe` (default: false) -- apply \"unsafe\" transformations (discussion below)\n\n- `conditionals` -- apply optimizations for `if`-s and conditional\n expressions\n\n- `comparisons` -- apply certain optimizations to binary nodes, for example:\n `!(a <= b) → a > b` (only when `unsafe`), attempts to negate binary nodes,\n e.g. `a = !b && !c && !d && !e → a=!(b||c||d||e)` etc.\n\n- `evaluate` -- attempt to evaluate constant expressions\n\n- `booleans` -- various optimizations for boolean context, for example `!!a\n ? b : c → a ? b : c`\n\n- `loops` -- optimizations for `do`, `while` and `for` loops when we can\n statically determine the condition\n\n- `unused` -- drop unreferenced functions and variables\n\n- `hoist_funs` -- hoist function declarations\n\n- `hoist_vars` (default: false) -- hoist `var` declarations (this is `false`\n by default because it seems to increase the size of the output in general)\n\n- `if_return` -- optimizations for if/return and if/continue\n\n- `join_vars` -- join consecutive `var` statements\n\n- `cascade` -- small optimization for sequences, transform `x, x` into `x`\n and `x = something(), x` into `x = something()`\n\n- `warnings` -- display warnings when dropping unreachable code or unused\n declarations etc.\n\n- `negate_iife` -- negate \"Immediately-Called Function Expressions\"\n where the return value is discarded, to avoid the parens that the\n code generator would insert.\n\n- `pure_getters` -- the default is `false`. If you pass `true` for\n this, UglifyJS will assume that object property access\n (e.g. `foo.bar` or `foo[\"bar\"]`) doesn't have any side effects.\n\n- `pure_funcs` -- default `null`. You can pass an array of names and\n UglifyJS will assume that those functions do not produce side\n effects. DANGER: will not check if the name is redefined in scope.\n An example case here, for instance `var q = Math.floor(a/b)`. If\n variable `q` is not used elsewhere, UglifyJS will drop it, but will\n still keep the `Math.floor(a/b)`, not knowing what it does. You can\n pass `pure_funcs: [ 'Math.floor' ]` to let it know that this\n function won't produce any side effect, in which case the whole\n statement would get discarded. The current implementation adds some\n overhead (compression will be slower).\n\n- `drop_console` -- default `false`. Pass `true` to discard calls to\n `console.*` functions.\n\n### The `unsafe` option\n\nIt enables some transformations that *might* break code logic in certain\ncontrived cases, but should be fine for most code. You might want to try it\non your own code, it should reduce the minified size. Here's what happens\nwhen this flag is on:\n\n- `new Array(1, 2, 3)` or `Array(1, 2, 3)` → `[1, 2, 3 ]`\n- `new Object()` → `{}`\n- `String(exp)` or `exp.toString()` → `\"\" + exp`\n- `new Object/RegExp/Function/Error/Array (...)` → we discard the `new`\n- `typeof foo == \"undefined\"` → `foo === void 0`\n- `void 0` → `undefined` (if there is a variable named \"undefined\" in\n scope; we do it because the variable name will be mangled, typically\n reduced to a single character).\n\n### Conditional compilation\n\nYou can use the `--define` (`-d`) switch in order to declare global\nvariables that UglifyJS will assume to be constants (unless defined in\nscope). For example if you pass `--define DEBUG=false` then, coupled with\ndead code removal UglifyJS will discard the following from the output:\n```javascript\nif (DEBUG) {\n\tconsole.log(\"debug stuff\");\n}\n```\n\nUglifyJS will warn about the condition being always false and about dropping\nunreachable code; for now there is no option to turn off only this specific\nwarning, you can pass `warnings=false` to turn off *all* warnings.\n\nAnother way of doing that is to declare your globals as constants in a\nseparate file and include it into the build. For example you can have a\n`build/defines.js` file with the following:\n```javascript\nconst DEBUG = false;\nconst PRODUCTION = true;\n// etc.\n```\n\nand build your code like this:\n\n uglifyjs build/defines.js js/foo.js js/bar.js... -c\n\nUglifyJS will notice the constants and, since they cannot be altered, it\nwill evaluate references to them to the value itself and drop unreachable\ncode as usual. The possible downside of this approach is that the build\nwill contain the `const` declarations.\n\n\n## Beautifier options\n\nThe code generator tries to output shortest code possible by default. In\ncase you want beautified output, pass `--beautify` (`-b`). Optionally you\ncan pass additional arguments that control the code output:\n\n- `beautify` (default `true`) -- whether to actually beautify the output.\n Passing `-b` will set this to true, but you might need to pass `-b` even\n when you want to generate minified code, in order to specify additional\n arguments, so you can use `-b beautify=false` to override it.\n- `indent-level` (default 4)\n- `indent-start` (default 0) -- prefix all lines by that many spaces\n- `quote-keys` (default `false`) -- pass `true` to quote all keys in literal\n objects\n- `space-colon` (default `true`) -- insert a space after the colon signs\n- `ascii-only` (default `false`) -- escape Unicode characters in strings and\n regexps\n- `inline-script` (default `false`) -- escape the slash in occurrences of\n `= (x = f(…))
- *
- * For example, let the equation be:
- * (a = parseInt('100')) <= a
- *
- * If a was an integer and has the value of 99,
- * (a = parseInt('100')) <= a → 100 <= 100 → true
- *
- * When transformed incorrectly:
- * a >= (a = parseInt('100')) → 99 >= 100 → false
- */
-
-tranformation_sort_order_equal: {
- options = {
- comparisons: true,
- };
-
- input: { (a = parseInt('100')) == a }
- expect: { (a = parseInt('100')) == a }
-}
-
-tranformation_sort_order_unequal: {
- options = {
- comparisons: true,
- };
-
- input: { (a = parseInt('100')) != a }
- expect: { (a = parseInt('100')) != a }
-}
-
-tranformation_sort_order_lesser_or_equal: {
- options = {
- comparisons: true,
- };
-
- input: { (a = parseInt('100')) <= a }
- expect: { (a = parseInt('100')) <= a }
-}
-tranformation_sort_order_greater_or_equal: {
- options = {
- comparisons: true,
- };
-
- input: { (a = parseInt('100')) >= a }
- expect: { (a = parseInt('100')) >= a }
-}
\ No newline at end of file
diff --git a/builder/node_modules/uglify-js/test/compress/issue-22.js b/builder/node_modules/uglify-js/test/compress/issue-22.js
deleted file mode 100644
index a8b7bc60..00000000
--- a/builder/node_modules/uglify-js/test/compress/issue-22.js
+++ /dev/null
@@ -1,17 +0,0 @@
-return_with_no_value_in_if_body: {
- options = { conditionals: true };
- input: {
- function foo(bar) {
- if (bar) {
- return;
- } else {
- return 1;
- }
- }
- }
- expect: {
- function foo (bar) {
- return bar ? void 0 : 1;
- }
- }
-}
diff --git a/builder/node_modules/uglify-js/test/compress/issue-267.js b/builder/node_modules/uglify-js/test/compress/issue-267.js
deleted file mode 100644
index 7233d9f1..00000000
--- a/builder/node_modules/uglify-js/test/compress/issue-267.js
+++ /dev/null
@@ -1,11 +0,0 @@
-issue_267: {
- options = { comparisons: true };
- input: {
- x = a % b / b * c * 2;
- x = a % b * 2
- }
- expect: {
- x = a % b / b * c * 2;
- x = a % b * 2;
- }
-}
diff --git a/builder/node_modules/uglify-js/test/compress/issue-269.js b/builder/node_modules/uglify-js/test/compress/issue-269.js
deleted file mode 100644
index 1d41dea6..00000000
--- a/builder/node_modules/uglify-js/test/compress/issue-269.js
+++ /dev/null
@@ -1,66 +0,0 @@
-issue_269_1: {
- options = {unsafe: true};
- input: {
- f(
- String(x),
- Number(x),
- Boolean(x),
-
- String(),
- Number(),
- Boolean()
- );
- }
- expect: {
- f(
- x + '', +x, !!x,
- '', 0, false
- );
- }
-}
-
-issue_269_dangers: {
- options = {unsafe: true};
- input: {
- f(
- String(x, x),
- Number(x, x),
- Boolean(x, x)
- );
- }
- expect: {
- f(String(x, x), Number(x, x), Boolean(x, x));
- }
-}
-
-issue_269_in_scope: {
- options = {unsafe: true};
- input: {
- var String, Number, Boolean;
- f(
- String(x),
- Number(x, x),
- Boolean(x)
- );
- }
- expect: {
- var String, Number, Boolean;
- f(String(x), Number(x, x), Boolean(x));
- }
-}
-
-strings_concat: {
- options = {unsafe: true};
- input: {
- f(
- String(x + 'str'),
- String('str' + x)
- );
- }
- expect: {
- f(
- x + 'str',
- 'str' + x
- );
- }
-}
diff --git a/builder/node_modules/uglify-js/test/compress/issue-44.js b/builder/node_modules/uglify-js/test/compress/issue-44.js
deleted file mode 100644
index 7a972f9e..00000000
--- a/builder/node_modules/uglify-js/test/compress/issue-44.js
+++ /dev/null
@@ -1,31 +0,0 @@
-issue_44_valid_ast_1: {
- options = { unused: true };
- input: {
- function a(b) {
- for (var i = 0, e = b.qoo(); ; i++) {}
- }
- }
- expect: {
- function a(b) {
- var i = 0;
- for (b.qoo(); ; i++);
- }
- }
-}
-
-issue_44_valid_ast_2: {
- options = { unused: true };
- input: {
- function a(b) {
- if (foo) for (var i = 0, e = b.qoo(); ; i++) {}
- }
- }
- expect: {
- function a(b) {
- if (foo) {
- var i = 0;
- for (b.qoo(); ; i++);
- }
- }
- }
-}
diff --git a/builder/node_modules/uglify-js/test/compress/issue-59.js b/builder/node_modules/uglify-js/test/compress/issue-59.js
deleted file mode 100644
index 82b38806..00000000
--- a/builder/node_modules/uglify-js/test/compress/issue-59.js
+++ /dev/null
@@ -1,30 +0,0 @@
-keep_continue: {
- options = {
- dead_code: true,
- evaluate: true
- };
- input: {
- while (a) {
- if (b) {
- switch (true) {
- case c():
- d();
- }
- continue;
- }
- f();
- }
- }
- expect: {
- while (a) {
- if (b) {
- switch (true) {
- case c():
- d();
- }
- continue;
- }
- f();
- }
- }
-}
diff --git a/builder/node_modules/uglify-js/test/compress/labels.js b/builder/node_modules/uglify-js/test/compress/labels.js
deleted file mode 100644
index 044b7a7e..00000000
--- a/builder/node_modules/uglify-js/test/compress/labels.js
+++ /dev/null
@@ -1,163 +0,0 @@
-labels_1: {
- options = { if_return: true, conditionals: true, dead_code: true };
- input: {
- out: {
- if (foo) break out;
- console.log("bar");
- }
- };
- expect: {
- foo || console.log("bar");
- }
-}
-
-labels_2: {
- options = { if_return: true, conditionals: true, dead_code: true };
- input: {
- out: {
- if (foo) print("stuff");
- else break out;
- console.log("here");
- }
- };
- expect: {
- if (foo) {
- print("stuff");
- console.log("here");
- }
- }
-}
-
-labels_3: {
- options = { if_return: true, conditionals: true, dead_code: true };
- input: {
- for (var i = 0; i < 5; ++i) {
- if (i < 3) continue;
- console.log(i);
- }
- };
- expect: {
- for (var i = 0; i < 5; ++i)
- i < 3 || console.log(i);
- }
-}
-
-labels_4: {
- options = { if_return: true, conditionals: true, dead_code: true };
- input: {
- out: for (var i = 0; i < 5; ++i) {
- if (i < 3) continue out;
- console.log(i);
- }
- };
- expect: {
- for (var i = 0; i < 5; ++i)
- i < 3 || console.log(i);
- }
-}
-
-labels_5: {
- options = { if_return: true, conditionals: true, dead_code: true };
- // should keep the break-s in the following
- input: {
- while (foo) {
- if (bar) break;
- console.log("foo");
- }
- out: while (foo) {
- if (bar) break out;
- console.log("foo");
- }
- };
- expect: {
- while (foo) {
- if (bar) break;
- console.log("foo");
- }
- out: while (foo) {
- if (bar) break out;
- console.log("foo");
- }
- }
-}
-
-labels_6: {
- input: {
- out: break out;
- };
- expect: {}
-}
-
-labels_7: {
- options = { if_return: true, conditionals: true, dead_code: true };
- input: {
- while (foo) {
- x();
- y();
- continue;
- }
- };
- expect: {
- while (foo) {
- x();
- y();
- }
- }
-}
-
-labels_8: {
- options = { if_return: true, conditionals: true, dead_code: true };
- input: {
- while (foo) {
- x();
- y();
- break;
- }
- };
- expect: {
- while (foo) {
- x();
- y();
- break;
- }
- }
-}
-
-labels_9: {
- options = { if_return: true, conditionals: true, dead_code: true };
- input: {
- out: while (foo) {
- x();
- y();
- continue out;
- z();
- k();
- }
- };
- expect: {
- while (foo) {
- x();
- y();
- }
- }
-}
-
-labels_10: {
- options = { if_return: true, conditionals: true, dead_code: true };
- input: {
- out: while (foo) {
- x();
- y();
- break out;
- z();
- k();
- }
- };
- expect: {
- out: while (foo) {
- x();
- y();
- break out;
- }
- }
-}
diff --git a/builder/node_modules/uglify-js/test/compress/loops.js b/builder/node_modules/uglify-js/test/compress/loops.js
deleted file mode 100644
index cdf1f045..00000000
--- a/builder/node_modules/uglify-js/test/compress/loops.js
+++ /dev/null
@@ -1,123 +0,0 @@
-while_becomes_for: {
- options = { loops: true };
- input: {
- while (foo()) bar();
- }
- expect: {
- for (; foo(); ) bar();
- }
-}
-
-drop_if_break_1: {
- options = { loops: true };
- input: {
- for (;;)
- if (foo()) break;
- }
- expect: {
- for (; !foo(););
- }
-}
-
-drop_if_break_2: {
- options = { loops: true };
- input: {
- for (;bar();)
- if (foo()) break;
- }
- expect: {
- for (; bar() && !foo(););
- }
-}
-
-drop_if_break_3: {
- options = { loops: true };
- input: {
- for (;bar();) {
- if (foo()) break;
- stuff1();
- stuff2();
- }
- }
- expect: {
- for (; bar() && !foo();) {
- stuff1();
- stuff2();
- }
- }
-}
-
-drop_if_break_4: {
- options = { loops: true, sequences: true };
- input: {
- for (;bar();) {
- x();
- y();
- if (foo()) break;
- z();
- k();
- }
- }
- expect: {
- for (; bar() && (x(), y(), !foo());) z(), k();
- }
-}
-
-drop_if_else_break_1: {
- options = { loops: true };
- input: {
- for (;;) if (foo()) bar(); else break;
- }
- expect: {
- for (; foo(); ) bar();
- }
-}
-
-drop_if_else_break_2: {
- options = { loops: true };
- input: {
- for (;bar();) {
- if (foo()) baz();
- else break;
- }
- }
- expect: {
- for (; bar() && foo();) baz();
- }
-}
-
-drop_if_else_break_3: {
- options = { loops: true };
- input: {
- for (;bar();) {
- if (foo()) baz();
- else break;
- stuff1();
- stuff2();
- }
- }
- expect: {
- for (; bar() && foo();) {
- baz();
- stuff1();
- stuff2();
- }
- }
-}
-
-drop_if_else_break_4: {
- options = { loops: true, sequences: true };
- input: {
- for (;bar();) {
- x();
- y();
- if (foo()) baz();
- else break;
- z();
- k();
- }
- }
- expect: {
- for (; bar() && (x(), y(), foo());) baz(), z(), k();
- }
-}
diff --git a/builder/node_modules/uglify-js/test/compress/negate-iife.js b/builder/node_modules/uglify-js/test/compress/negate-iife.js
deleted file mode 100644
index 89c3f064..00000000
--- a/builder/node_modules/uglify-js/test/compress/negate-iife.js
+++ /dev/null
@@ -1,76 +0,0 @@
-negate_iife_1: {
- options = {
- negate_iife: true
- };
- input: {
- (function(){ stuff() })();
- }
- expect: {
- !function(){ stuff() }();
- }
-}
-
-negate_iife_2: {
- options = {
- negate_iife: true
- };
- input: {
- (function(){ return {} })().x = 10; // should not transform this one
- }
- expect: {
- (function(){ return {} })().x = 10;
- }
-}
-
-negate_iife_3: {
- options = {
- negate_iife: true,
- };
- input: {
- (function(){ return true })() ? console.log(true) : console.log(false);
- }
- expect: {
- !function(){ return true }() ? console.log(false) : console.log(true);
- }
-}
-
-negate_iife_3: {
- options = {
- negate_iife: true,
- sequences: true
- };
- input: {
- (function(){ return true })() ? console.log(true) : console.log(false);
- (function(){
- console.log("something");
- })();
- }
- expect: {
- !function(){ return true }() ? console.log(false) : console.log(true), function(){
- console.log("something");
- }();
- }
-}
-
-negate_iife_4: {
- options = {
- negate_iife: true,
- sequences: true,
- conditionals: true,
- };
- input: {
- if ((function(){ return true })()) {
- foo(true);
- } else {
- bar(false);
- }
- (function(){
- console.log("something");
- })();
- }
- expect: {
- !function(){ return true }() ? bar(false) : foo(true), function(){
- console.log("something");
- }();
- }
-}
diff --git a/builder/node_modules/uglify-js/test/compress/properties.js b/builder/node_modules/uglify-js/test/compress/properties.js
deleted file mode 100644
index 85045961..00000000
--- a/builder/node_modules/uglify-js/test/compress/properties.js
+++ /dev/null
@@ -1,54 +0,0 @@
-keep_properties: {
- options = {
- properties: false
- };
- input: {
- a["foo"] = "bar";
- }
- expect: {
- a["foo"] = "bar";
- }
-}
-
-dot_properties: {
- options = {
- properties: true
- };
- input: {
- a["foo"] = "bar";
- a["if"] = "if";
- a["*"] = "asterisk";
- a["\u0EB3"] = "unicode";
- a[""] = "whitespace";
- a["1_1"] = "foo";
- }
- expect: {
- a.foo = "bar";
- a["if"] = "if";
- a["*"] = "asterisk";
- a.\u0EB3 = "unicode";
- a[""] = "whitespace";
- a["1_1"] = "foo";
- }
-}
-
-dot_properties_es5: {
- options = {
- properties: true,
- screw_ie8: true
- };
- input: {
- a["foo"] = "bar";
- a["if"] = "if";
- a["*"] = "asterisk";
- a["\u0EB3"] = "unicode";
- a[""] = "whitespace";
- }
- expect: {
- a.foo = "bar";
- a.if = "if";
- a["*"] = "asterisk";
- a.\u0EB3 = "unicode";
- a[""] = "whitespace";
- }
-}
diff --git a/builder/node_modules/uglify-js/test/compress/sequences.js b/builder/node_modules/uglify-js/test/compress/sequences.js
deleted file mode 100644
index 46695714..00000000
--- a/builder/node_modules/uglify-js/test/compress/sequences.js
+++ /dev/null
@@ -1,163 +0,0 @@
-make_sequences_1: {
- options = {
- sequences: true
- };
- input: {
- foo();
- bar();
- baz();
- }
- expect: {
- foo(),bar(),baz();
- }
-}
-
-make_sequences_2: {
- options = {
- sequences: true
- };
- input: {
- if (boo) {
- foo();
- bar();
- baz();
- } else {
- x();
- y();
- z();
- }
- }
- expect: {
- if (boo) foo(),bar(),baz();
- else x(),y(),z();
- }
-}
-
-make_sequences_3: {
- options = {
- sequences: true
- };
- input: {
- function f() {
- foo();
- bar();
- return baz();
- }
- function g() {
- foo();
- bar();
- throw new Error();
- }
- }
- expect: {
- function f() {
- return foo(), bar(), baz();
- }
- function g() {
- throw foo(), bar(), new Error();
- }
- }
-}
-
-make_sequences_4: {
- options = {
- sequences: true
- };
- input: {
- x = 5;
- if (y) z();
-
- x = 5;
- for (i = 0; i < 5; i++) console.log(i);
-
- x = 5;
- for (; i < 5; i++) console.log(i);
-
- x = 5;
- switch (y) {}
-
- x = 5;
- with (obj) {}
- }
- expect: {
- if (x = 5, y) z();
- for (x = 5, i = 0; i < 5; i++) console.log(i);
- for (x = 5; i < 5; i++) console.log(i);
- switch (x = 5, y) {}
- with (x = 5, obj);
- }
-}
-
-lift_sequences_1: {
- options = { sequences: true };
- input: {
- foo = !(x(), y(), bar());
- }
- expect: {
- x(), y(), foo = !bar();
- }
-}
-
-lift_sequences_2: {
- options = { sequences: true, evaluate: true };
- input: {
- foo.x = (foo = {}, 10);
- bar = (bar = {}, 10);
- }
- expect: {
- foo.x = (foo = {}, 10),
- bar = {}, bar = 10;
- }
-}
-
-lift_sequences_3: {
- options = { sequences: true, conditionals: true };
- input: {
- x = (foo(), bar(), baz()) ? 10 : 20;
- }
- expect: {
- foo(), bar(), x = baz() ? 10 : 20;
- }
-}
-
-lift_sequences_4: {
- options = { side_effects: true };
- input: {
- x = (foo, bar, baz);
- }
- expect: {
- x = baz;
- }
-}
-
-for_sequences: {
- options = { sequences: true };
- input: {
- // 1
- foo();
- bar();
- for (; false;);
- // 2
- foo();
- bar();
- for (x = 5; false;);
- // 3
- x = (foo in bar);
- for (; false;);
- // 4
- x = (foo in bar);
- for (y = 5; false;);
- }
- expect: {
- // 1
- for (foo(), bar(); false;);
- // 2
- for (foo(), bar(), x = 5; false;);
- // 3
- x = (foo in bar);
- for (; false;);
- // 4
- x = (foo in bar);
- for (y = 5; false;);
- }
-}
diff --git a/builder/node_modules/uglify-js/test/compress/switch.js b/builder/node_modules/uglify-js/test/compress/switch.js
deleted file mode 100644
index 62e39cf7..00000000
--- a/builder/node_modules/uglify-js/test/compress/switch.js
+++ /dev/null
@@ -1,260 +0,0 @@
-constant_switch_1: {
- options = { dead_code: true, evaluate: true };
- input: {
- switch (1+1) {
- case 1: foo(); break;
- case 1+1: bar(); break;
- case 1+1+1: baz(); break;
- }
- }
- expect: {
- bar();
- }
-}
-
-constant_switch_2: {
- options = { dead_code: true, evaluate: true };
- input: {
- switch (1) {
- case 1: foo();
- case 1+1: bar(); break;
- case 1+1+1: baz();
- }
- }
- expect: {
- foo();
- bar();
- }
-}
-
-constant_switch_3: {
- options = { dead_code: true, evaluate: true };
- input: {
- switch (10) {
- case 1: foo();
- case 1+1: bar(); break;
- case 1+1+1: baz();
- default:
- def();
- }
- }
- expect: {
- def();
- }
-}
-
-constant_switch_4: {
- options = { dead_code: true, evaluate: true };
- input: {
- switch (2) {
- case 1:
- x();
- if (foo) break;
- y();
- break;
- case 1+1:
- bar();
- default:
- def();
- }
- }
- expect: {
- bar();
- def();
- }
-}
-
-constant_switch_5: {
- options = { dead_code: true, evaluate: true };
- input: {
- switch (1) {
- case 1:
- x();
- if (foo) break;
- y();
- break;
- case 1+1:
- bar();
- default:
- def();
- }
- }
- expect: {
- // the break inside the if ruins our job
- // we can still get rid of irrelevant cases.
- switch (1) {
- case 1:
- x();
- if (foo) break;
- y();
- }
- // XXX: we could optimize this better by inventing an outer
- // labeled block, but that's kinda tricky.
- }
-}
-
-constant_switch_6: {
- options = { dead_code: true, evaluate: true };
- input: {
- OUT: {
- foo();
- switch (1) {
- case 1:
- x();
- if (foo) break OUT;
- y();
- case 1+1:
- bar();
- break;
- default:
- def();
- }
- }
- }
- expect: {
- OUT: {
- foo();
- x();
- if (foo) break OUT;
- y();
- bar();
- }
- }
-}
-
-constant_switch_7: {
- options = { dead_code: true, evaluate: true };
- input: {
- OUT: {
- foo();
- switch (1) {
- case 1:
- x();
- if (foo) break OUT;
- for (var x = 0; x < 10; x++) {
- if (x > 5) break; // this break refers to the for, not to the switch; thus it
- // shouldn't ruin our optimization
- console.log(x);
- }
- y();
- case 1+1:
- bar();
- break;
- default:
- def();
- }
- }
- }
- expect: {
- OUT: {
- foo();
- x();
- if (foo) break OUT;
- for (var x = 0; x < 10; x++) {
- if (x > 5) break;
- console.log(x);
- }
- y();
- bar();
- }
- }
-}
-
-constant_switch_8: {
- options = { dead_code: true, evaluate: true };
- input: {
- OUT: switch (1) {
- case 1:
- x();
- for (;;) break OUT;
- y();
- break;
- case 1+1:
- bar();
- default:
- def();
- }
- }
- expect: {
- OUT: {
- x();
- for (;;) break OUT;
- y();
- }
- }
-}
-
-constant_switch_9: {
- options = { dead_code: true, evaluate: true };
- input: {
- OUT: switch (1) {
- case 1:
- x();
- for (;;) if (foo) break OUT;
- y();
- case 1+1:
- bar();
- default:
- def();
- }
- }
- expect: {
- OUT: {
- x();
- for (;;) if (foo) break OUT;
- y();
- bar();
- def();
- }
- }
-}
-
-drop_default_1: {
- options = { dead_code: true };
- input: {
- switch (foo) {
- case 'bar': baz();
- default:
- }
- }
- expect: {
- switch (foo) {
- case 'bar': baz();
- }
- }
-}
-
-drop_default_2: {
- options = { dead_code: true };
- input: {
- switch (foo) {
- case 'bar': baz(); break;
- default:
- break;
- }
- }
- expect: {
- switch (foo) {
- case 'bar': baz();
- }
- }
-}
-
-keep_default: {
- options = { dead_code: true };
- input: {
- switch (foo) {
- case 'bar': baz();
- default:
- something();
- break;
- }
- }
- expect: {
- switch (foo) {
- case 'bar': baz();
- default:
- something();
- }
- }
-}
diff --git a/builder/node_modules/uglify-js/test/compress/typeof.js b/builder/node_modules/uglify-js/test/compress/typeof.js
deleted file mode 100644
index cefdd43c..00000000
--- a/builder/node_modules/uglify-js/test/compress/typeof.js
+++ /dev/null
@@ -1,25 +0,0 @@
-typeof_evaluation: {
- options = {
- evaluate: true
- };
- input: {
- a = typeof 1;
- b = typeof 'test';
- c = typeof [];
- d = typeof {};
- e = typeof /./;
- f = typeof false;
- g = typeof function(){};
- h = typeof undefined;
- }
- expect: {
- a='number';
- b='string';
- c=typeof[];
- d=typeof{};
- e=typeof/./;
- f='boolean';
- g='function';
- h='undefined';
- }
-}
diff --git a/builder/node_modules/uglify-js/test/run-tests.js b/builder/node_modules/uglify-js/test/run-tests.js
deleted file mode 100644
index f8e88d48..00000000
--- a/builder/node_modules/uglify-js/test/run-tests.js
+++ /dev/null
@@ -1,179 +0,0 @@
-#! /usr/bin/env node
-
-var U = require("../tools/node");
-var path = require("path");
-var fs = require("fs");
-var assert = require("assert");
-var sys = require("util");
-
-var tests_dir = path.dirname(module.filename);
-var failures = 0;
-var failed_files = {};
-
-run_compress_tests();
-if (failures) {
- sys.error("\n!!! Failed " + failures + " test cases.");
- sys.error("!!! " + Object.keys(failed_files).join(", "));
- process.exit(1);
-}
-
-/* -----[ utils ]----- */
-
-function tmpl() {
- return U.string_template.apply(this, arguments);
-}
-
-function log() {
- var txt = tmpl.apply(this, arguments);
- sys.puts(txt);
-}
-
-function log_directory(dir) {
- log("*** Entering [{dir}]", { dir: dir });
-}
-
-function log_start_file(file) {
- log("--- {file}", { file: file });
-}
-
-function log_test(name) {
- log(" Running test [{name}]", { name: name });
-}
-
-function find_test_files(dir) {
- var files = fs.readdirSync(dir).filter(function(name){
- return /\.js$/i.test(name);
- });
- if (process.argv.length > 2) {
- var x = process.argv.slice(2);
- files = files.filter(function(f){
- return x.indexOf(f) >= 0;
- });
- }
- return files;
-}
-
-function test_directory(dir) {
- return path.resolve(tests_dir, dir);
-}
-
-function as_toplevel(input) {
- if (input instanceof U.AST_BlockStatement) input = input.body;
- else if (input instanceof U.AST_Statement) input = [ input ];
- else throw new Error("Unsupported input syntax");
- var toplevel = new U.AST_Toplevel({ body: input });
- toplevel.figure_out_scope();
- return toplevel;
-}
-
-function run_compress_tests() {
- var dir = test_directory("compress");
- log_directory("compress");
- var files = find_test_files(dir);
- function test_file(file) {
- log_start_file(file);
- function test_case(test) {
- log_test(test.name);
- var options = U.defaults(test.options, {
- warnings: false
- });
- var cmp = new U.Compressor(options, true);
- var expect = make_code(as_toplevel(test.expect), false);
- var input = as_toplevel(test.input);
- var input_code = make_code(test.input);
- var output = input.transform(cmp);
- output.figure_out_scope();
- output = make_code(output, false);
- if (expect != output) {
- log("!!! failed\n---INPUT---\n{input}\n---OUTPUT---\n{output}\n---EXPECTED---\n{expected}\n\n", {
- input: input_code,
- output: output,
- expected: expect
- });
- failures++;
- failed_files[file] = 1;
- }
- }
- var tests = parse_test(path.resolve(dir, file));
- for (var i in tests) if (tests.hasOwnProperty(i)) {
- test_case(tests[i]);
- }
- }
- files.forEach(function(file){
- test_file(file);
- });
-}
-
-function parse_test(file) {
- var script = fs.readFileSync(file, "utf8");
- var ast = U.parse(script, {
- filename: file
- });
- var tests = {};
- var tw = new U.TreeWalker(function(node, descend){
- if (node instanceof U.AST_LabeledStatement
- && tw.parent() instanceof U.AST_Toplevel) {
- var name = node.label.name;
- tests[name] = get_one_test(name, node.body);
- return true;
- }
- if (!(node instanceof U.AST_Toplevel)) croak(node);
- });
- ast.walk(tw);
- return tests;
-
- function croak(node) {
- throw new Error(tmpl("Can't understand test file {file} [{line},{col}]\n{code}", {
- file: file,
- line: node.start.line,
- col: node.start.col,
- code: make_code(node, false)
- }));
- }
-
- function get_one_test(name, block) {
- var test = { name: name, options: {} };
- var tw = new U.TreeWalker(function(node, descend){
- if (node instanceof U.AST_Assign) {
- if (!(node.left instanceof U.AST_SymbolRef)) {
- croak(node);
- }
- var name = node.left.name;
- test[name] = evaluate(node.right);
- return true;
- }
- if (node instanceof U.AST_LabeledStatement) {
- assert.ok(
- node.label.name == "input" || node.label.name == "expect",
- tmpl("Unsupported label {name} [{line},{col}]", {
- name: node.label.name,
- line: node.label.start.line,
- col: node.label.start.col
- })
- );
- var stat = node.body;
- if (stat instanceof U.AST_BlockStatement) {
- if (stat.body.length == 1) stat = stat.body[0];
- else if (stat.body.length == 0) stat = new U.AST_EmptyStatement();
- }
- test[node.label.name] = stat;
- return true;
- }
- });
- block.walk(tw);
- return test;
- };
-}
-
-function make_code(ast, beautify) {
- if (arguments.length == 1) beautify = true;
- var stream = U.OutputStream({ beautify: beautify });
- ast.print(stream);
- return stream.get();
-}
-
-function evaluate(code) {
- if (code instanceof U.AST_Node)
- code = make_code(code);
- return new Function("return(" + code + ")")();
-}
diff --git a/builder/node_modules/uglify-js/tools/node.js b/builder/node_modules/uglify-js/tools/node.js
deleted file mode 100644
index bef296ea..00000000
--- a/builder/node_modules/uglify-js/tools/node.js
+++ /dev/null
@@ -1,182 +0,0 @@
-var path = require("path");
-var fs = require("fs");
-var vm = require("vm");
-var sys = require("util");
-
-var UglifyJS = vm.createContext({
- sys : sys,
- console : console,
- MOZ_SourceMap : require("source-map")
-});
-
-function load_global(file) {
- file = path.resolve(path.dirname(module.filename), file);
- try {
- var code = fs.readFileSync(file, "utf8");
- return vm.runInContext(code, UglifyJS, file);
- } catch(ex) {
- // XXX: in case of a syntax error, the message is kinda
- // useless. (no location information).
- sys.debug("ERROR in file: " + file + " / " + ex);
- process.exit(1);
- }
-};
-
-var FILES = exports.FILES = [
- "../lib/utils.js",
- "../lib/ast.js",
- "../lib/parse.js",
- "../lib/transform.js",
- "../lib/scope.js",
- "../lib/output.js",
- "../lib/compress.js",
- "../lib/sourcemap.js",
- "../lib/mozilla-ast.js"
-].map(function(file){
- return path.join(path.dirname(fs.realpathSync(__filename)), file);
-});
-
-FILES.forEach(load_global);
-
-UglifyJS.AST_Node.warn_function = function(txt) {
- sys.error("WARN: " + txt);
-};
-
-// XXX: perhaps we shouldn't export everything but heck, I'm lazy.
-for (var i in UglifyJS) {
- if (UglifyJS.hasOwnProperty(i)) {
- exports[i] = UglifyJS[i];
- }
-}
-
-exports.minify = function(files, options) {
- options = UglifyJS.defaults(options, {
- spidermonkey : false,
- outSourceMap : null,
- sourceRoot : null,
- inSourceMap : null,
- fromString : false,
- warnings : false,
- mangle : {},
- output : null,
- compress : {}
- });
- UglifyJS.base54.reset();
-
- // 1. parse
- var toplevel = null,
- sourcesContent = {};
-
- if (options.spidermonkey) {
- toplevel = UglifyJS.AST_Node.from_mozilla_ast(files);
- } else {
- if (typeof files == "string")
- files = [ files ];
- files.forEach(function(file){
- var code = options.fromString
- ? file
- : fs.readFileSync(file, "utf8");
- sourcesContent[file] = code;
- toplevel = UglifyJS.parse(code, {
- filename: options.fromString ? "?" : file,
- toplevel: toplevel
- });
- });
- }
-
- // 2. compress
- if (options.compress) {
- var compress = { warnings: options.warnings };
- UglifyJS.merge(compress, options.compress);
- toplevel.figure_out_scope();
- var sq = UglifyJS.Compressor(compress);
- toplevel = toplevel.transform(sq);
- }
-
- // 3. mangle
- if (options.mangle) {
- toplevel.figure_out_scope();
- toplevel.compute_char_frequency();
- toplevel.mangle_names(options.mangle);
- }
-
- // 4. output
- var inMap = options.inSourceMap;
- var output = {};
- if (typeof options.inSourceMap == "string") {
- inMap = fs.readFileSync(options.inSourceMap, "utf8");
- }
- if (options.outSourceMap) {
- output.source_map = UglifyJS.SourceMap({
- file: options.outSourceMap,
- orig: inMap,
- root: options.sourceRoot
- });
- if (options.sourceMapIncludeSources) {
- for (var file in sourcesContent) {
- if (sourcesContent.hasOwnProperty(file)) {
- options.source_map.get().setSourceContent(file, sourcesContent[file]);
- }
- }
- }
-
- }
- if (options.output) {
- UglifyJS.merge(output, options.output);
- }
- var stream = UglifyJS.OutputStream(output);
- toplevel.print(stream);
- return {
- code : stream + "",
- map : output.source_map + ""
- };
-};
-
-// exports.describe_ast = function() {
-// function doitem(ctor) {
-// var sub = {};
-// ctor.SUBCLASSES.forEach(function(ctor){
-// sub[ctor.TYPE] = doitem(ctor);
-// });
-// var ret = {};
-// if (ctor.SELF_PROPS.length > 0) ret.props = ctor.SELF_PROPS;
-// if (ctor.SUBCLASSES.length > 0) ret.sub = sub;
-// return ret;
-// }
-// return doitem(UglifyJS.AST_Node).sub;
-// }
-
-exports.describe_ast = function() {
- var out = UglifyJS.OutputStream({ beautify: true });
- function doitem(ctor) {
- out.print("AST_" + ctor.TYPE);
- var props = ctor.SELF_PROPS.filter(function(prop){
- return !/^\$/.test(prop);
- });
- if (props.length > 0) {
- out.space();
- out.with_parens(function(){
- props.forEach(function(prop, i){
- if (i) out.space();
- out.print(prop);
- });
- });
- }
- if (ctor.documentation) {
- out.space();
- out.print_string(ctor.documentation);
- }
- if (ctor.SUBCLASSES.length > 0) {
- out.space();
- out.with_block(function(){
- ctor.SUBCLASSES.forEach(function(ctor, i){
- out.indent();
- doitem(ctor);
- out.newline();
- });
- });
- }
- };
- doitem(UglifyJS.AST_Node);
- return out + "";
-};
diff --git a/demos/commands.html b/demos/commands.html
index e956d552..f9c73cee 100644
--- a/demos/commands.html
+++ b/demos/commands.html
@@ -1,319 +1,319 @@
-
-
-
- Rangy commands demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Rangy commands demo
-
- Use the buttons to test the available commands. Both panes (WYSIWYG and HTML) are editable (HTML textarea uses
- onchange, so click outside or tab away to get the WYSIWYG pane to update).
-
+ Use the buttons to test the available commands. Both panes (WYSIWYG and HTML) are editable (HTML textarea uses
+ onchange, so click outside or tab away to get the WYSIWYG pane to update).
+
+
+ WYSIWYG:
+
+
+
+
+
+
+
+
+
+
+ HTML:
+
+
+
+
\ No newline at end of file
diff --git a/demos/commands_new.html b/demos/commands_new.html
index ac7cea8f..e592e9d6 100644
--- a/demos/commands_new.html
+++ b/demos/commands_new.html
@@ -1,321 +1,321 @@
-
-
-
- Rangy commands demo
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Rangy commands demo
-
- Use the buttons to test the available commands. Both panes (WYSIWYG and HTML) are editable (HTML textarea uses
- onchange, so click outside or tab away to get the WYSIWYG pane to update).
-
+ Use the buttons to test the available commands. Both panes (WYSIWYG and HTML) are editable (HTML textarea uses
+ onchange, so click outside or tab away to get the WYSIWYG pane to update).
+
+
+ WYSIWYG:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ HTML:
+
+
+
+
\ No newline at end of file
diff --git a/demos/content.html b/demos/content.html
index 57ab8f66..149c85db 100644
--- a/demos/content.html
+++ b/demos/content.html
@@ -1,74 +1,74 @@
-
-
-
- Rangy Bold Demo
-
-
-
-
-
Test
-
Test
-
Test
-
-
2
-
One
-Two
-
Three
-
-
- Association football is a sport played between two teams. It is usually called football, but in
- some countries, such as the United States, it is called soccer. In
- Japan, New Zealand, South Africa, Australia, Canada and
- Republic of Ireland, both words are commonly used.
-
-
- Each team has 11 players on the field. One of these players is the goalkeeper, and the other ten are
- known as "outfield players." The game is played by kicking a ball into the opponent's goal. A
- match has 90 minutes of play, with a break of 15 minutes in the middle. The break in the middle is called
- half-time.
-
-
Competitions
-
- There are many competitions for football, for both football clubs and countries. Football clubs usually play
- other teams in their own country, with a few exceptions. Cardiff City F.C. from Wales for example, play
- in the English leagues and in the English FA Cup.
-
-
Who plays football
-
-Football is the world's most popular sport. It is played in more
-countries than any other game. In fact, FIFA (the Federation
-Internationale de Football Association) has more members than the
-United Nations.
-
-It is played by both males and females.
-
-
-
+ Association football is a sport played between two teams. It is usually called football, but in
+ some countries, such as the United States, it is called soccer. In
+ Japan, New Zealand, South Africa, Australia, Canada and
+ Republic of Ireland, both words are commonly used.
+
+
+ Each team has 11 players on the field. One of these players is the goalkeeper, and the other ten are
+ known as "outfield players." The game is played by kicking a ball into the opponent's goal. A
+ match has 90 minutes of play, with a break of 15 minutes in the middle. The break in the middle is called
+ half-time.
+
+
Competitions
+
+ There are many competitions for football, for both football clubs and countries. Football clubs usually play
+ other teams in their own country, with a few exceptions. Cardiff City F.C. from Wales for example, play
+ in the English leagues and in the English FA Cup.
+
+
Who plays football
+
+Football is the world's most popular sport. It is played in more
+countries than any other game. In fact, FIFA (the Federation
+Internationale de Football Association) has more members than the
+United Nations.
+
+It is played by both males and females.
+
+
+
+
+
\ No newline at end of file
diff --git a/demos/saverestore.html b/demos/saverestore.html
index 5610811b..db590148 100644
--- a/demos/saverestore.html
+++ b/demos/saverestore.html
@@ -1,134 +1,134 @@
-
-
-
- Rangy Selection save/restore module demo
-
-
-
-
-
-
-
Selection save/restore test
-
-
-
Save and restore selection
- Select something in the main page area to the right. Click on the "Save selection" button. Now click somewhere
- on the page to destroy the selection, and then press "Restore selection".
-
-
-
-
-
-
Rangy Save / Restore Selection Module Demo
-
-
-
-
- Please use your mouse and/or keyboard to make selections from the sample content below and use the buttons
- on the left hand size to save and restore the selection.
-
-
-
- Association football is a sport played between two teams. It is usually called football, but in
- some countries, such as the United States, it is called soccer. In
- Japan, New Zealand, South Africa, Australia, Canada and
- Republic of Ireland, both words are commonly used.
-
-
- Each team has 11 players on the field. One of these players is the goalkeeper, and the other ten are
- known as "outfield players." The game is played by kicking a ball into the opponent's goal. A
- match has 90 minutes of play, with a break of 15 minutes in the middle. The break in the middle is called
- half-time.
-
-
Competitions (this section is editable)
-
- There are many competitions for football, for both football clubs and countries. Football clubs usually play
- other teams in their own country, with a few exceptions. Cardiff City F.C. from Wales for example, play
- in the English leagues and in the English FA Cup.
-
-
Who plays football (this section is editable and in pre-formatted text)
-
-Football is the world's most popular sport. It is played in more
-countries than any other game. In fact, FIFA (the Federation
-Internationale de Football Association) has more members than the
-United Nations.
-
-It is played by both males and females.
-
-
-
-
- Some controls to put in a ControlRange: and and
-
+ Select something in the main page area to the right. Click on the "Save selection" button. Now click somewhere
+ on the page to destroy the selection, and then press "Restore selection".
+
+
+
+
+
+
Rangy Save / Restore Selection Module Demo
+
+
+
+
+ Please use your mouse and/or keyboard to make selections from the sample content below and use the buttons
+ on the left hand size to save and restore the selection.
+
+
+
+ Association football is a sport played between two teams. It is usually called football, but in
+ some countries, such as the United States, it is called soccer. In
+ Japan, New Zealand, South Africa, Australia, Canada and
+ Republic of Ireland, both words are commonly used.
+
+
+ Each team has 11 players on the field. One of these players is the goalkeeper, and the other ten are
+ known as "outfield players." The game is played by kicking a ball into the opponent's goal. A
+ match has 90 minutes of play, with a break of 15 minutes in the middle. The break in the middle is called
+ half-time.
+
+
Competitions (this section is editable)
+
+ There are many competitions for football, for both football clubs and countries. Football clubs usually play
+ other teams in their own country, with a few exceptions. Cardiff City F.C. from Wales for example, play
+ in the English leagues and in the English FA Cup.
+
+
Who plays football (this section is editable and in pre-formatted text)
+
+Football is the world's most popular sport. It is played in more
+countries than any other game. In fact, FIFA (the Federation
+Internationale de Football Association) has more members than the
+United Nations.
+
+It is played by both males and females.
+
+
+
+
+ Some controls to put in a ControlRange: and and
+
+
+
\ No newline at end of file
diff --git a/demos/scopedhighlights.html b/demos/scopedhighlights.html
index fd0454e7..c9150142 100644
--- a/demos/scopedhighlights.html
+++ b/demos/scopedhighlights.html
@@ -1,108 +1,108 @@
-
-
-
- Rangy Highlighter Module Demo
-
-
-
-
-
-
-
-
-
-
Highlighter
-
Make a selection in the document and use the buttons below to highlight and unhighlight.
-
-
-
-
Preserving highlights between page requests
-
-
-
-
-
Highlighter module scoped highlights demo
-
- Please use your mouse and/or keyboard to make selections from the sample quotes below and use the buttons
- on the left hand size to create and remove highlights.
-
-
-
"Hello. My name is Inigo Montoya. You killed my father. Prepare to die."
-
"You keep using that word. I do not think it means what you think it means."
-
"I do not mean to pry, but you don't by any chance happen to have six fingers on your right hand?"
-
"Oh, there's something I ought to tell you. I'm not left-handed either."
Make a selection in the document and use the buttons below to highlight and unhighlight.
+
+
+
+
Preserving highlights between page requests
+
+
+
+
+
Highlighter module scoped highlights demo
+
+ Please use your mouse and/or keyboard to make selections from the sample quotes below and use the buttons
+ on the left hand size to create and remove highlights.
+
+
+
"Hello. My name is Inigo Montoya. You killed my father. Prepare to die."
+
"You keep using that word. I do not think it means what you think it means."
+
"I do not mean to pry, but you don't by any chance happen to have six fingers on your right hand?"
+
"Oh, there's something I ought to tell you. I'm not left-handed either."
+
+
+
\ No newline at end of file
diff --git a/package.json b/package.json
index 91c2daef..fedfe635 100644
--- a/package.json
+++ b/package.json
@@ -1,31 +1,44 @@
{
- "name": "rangy",
- "description": "A cross-browser DOM range and selection library",
- "version": "1.3.1-dev",
- "author": {
- "name": "Tim Down",
- "email": "tim@timdown.co.uk",
- "url": "http://timdown.co.uk/"
- },
- "keywords": ["range", "selection", "caret", "DOM"],
- "homepage": "https://github.com/timdown/rangy",
- "bugs": {
- "url": "https://github.com/timdown/rangy/issues"
- },
- "licenses": [
- {
- "type": "MIT",
- "url": "http://www.opensource.org/licenses/mit-license.php"
- }
- ],
- "repository": {
- "type": "git",
- "url": "https://github.com/timdown/rangy.git"
- },
- "main": "lib/rangy-core.js",
- "directories": {
- "lib": "./lib"
- },
- "dependencies": {},
- "devDependencies": {}
-}
\ No newline at end of file
+ "name": "rangy",
+ "description": "A cross-browser DOM range and selection library",
+ "version": "1.3.1-dev",
+ "author": {
+ "name": "Tim Down",
+ "email": "tim@timdown.co.uk",
+ "url": "http://timdown.co.uk/"
+ },
+ "keywords": [
+ "range",
+ "selection",
+ "caret",
+ "DOM"
+ ],
+ "homepage": "https://github.com/timdown/rangy",
+ "bugs": {
+ "url": "https://github.com/timdown/rangy/issues"
+ },
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "http://www.opensource.org/licenses/mit-license.php"
+ }
+ ],
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/timdown/rangy.git"
+ },
+ "main": "lib/rangy-core.js",
+ "directories": {
+ "lib": "./lib"
+ },
+ "scripts": {
+ "build": "node build.js"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "archiver": "^0.21.0",
+ "jshint": "^2.9.1",
+ "rimraf": "^2.5.1",
+ "uglify-js": "^2.6.1"
+ }
+}
diff --git a/roadmap.txt b/roadmap.txt
index fb40358f..2946f332 100644
--- a/roadmap.txt
+++ b/roadmap.txt
@@ -1,45 +1,45 @@
-1.3
----
-
-- [X] TextRange module
- (http://groups.google.com/group/rangy/browse_frm/thread/bd7a351e63a16474)
-- [X] Allow Window, Document, iframe and DOM node as params to range/selection creation methods
-- [X] Add rangy.features.implementsWinGetSelection and rangy.features.implementsDocSelection
-- [X] Check Range and Selection against WHATWG Range spec algorithms
-- [X] Highlighter module. Review and rewrite existing.
-- [X] Added select() method to range
-- [X] Rename CSS class applier module to "class applier module"
-- [X] Add handling for img and similar elements in class applier module
-- [X] AMD support
-- [X] Add getNativeTextRange() to selection for IE 11
-- [X] Add Range setStartAndEnd(). Overloaded? eg. two args collapsed, three args (node, startOffset, endOffset),
- four args (startNode, startOffset, endNode, endOffset) (consider this)
-
-1.4
----
-
-- [?] Consider range.restrict(node)
-- [?] Consider filter option in createClassApplier() options object
-- [ ] Either a utils module or an FAQ page with code snippets for common use cases, including:
- - [X] Simple selection save/restore (bookmark?) (is this necessary?)
- - [ ] Insert HTML
- (http://stackoverflow.com/questions/2213376/how-to-find-cursor-position-in-a-contenteditable-div/2213514#2213514)
-- [?] Some kind of jQuery integration module?
-- [ ] Move IE <= 8 support into a separate optional module
-- [ ] Add withinRange and withinNode options to move(), moveStart() and moveEnd() methods
-- [?] Positions module
- (http://stackoverflow.com/questions/4122315/how-to-find-xy-position-in-javascript-with-offset/4123495#4123495)
-- [ ] Config module or something so that config can work with AMD. See PR #285
- (https://github.com/timdown/rangy/pull/285)
-- [ ] Move to one of the common testing libraries
-- [ ] Update build not to use a fresh Git checkout
-- [ ] Investigate shadow DOM (issue #307)
-
-Possible features for some version
-----------------------------------
-
-- [?] Commands module with basic inline commands (bold, italic, colour, font face, font size, background colour, etc.)
- (http://stackoverflow.com/questions/2887101/apply-style-to-range-of-text-with-javascript-in-uiwebview/2888969#2888969)
-- [?] More commands (block? Insert line break? Think about this, don't want to build a WYSIWYG editor)
-- [ ] Add selection extend()? Don't think this is possible.
-- [ ] Option in TextRange module for alternative ways to extract text for an element (see email from Bruce Augustine)
+1.3
+---
+
+- [X] TextRange module
+ (http://groups.google.com/group/rangy/browse_frm/thread/bd7a351e63a16474)
+- [X] Allow Window, Document, iframe and DOM node as params to range/selection creation methods
+- [X] Add rangy.features.implementsWinGetSelection and rangy.features.implementsDocSelection
+- [X] Check Range and Selection against WHATWG Range spec algorithms
+- [X] Highlighter module. Review and rewrite existing.
+- [X] Added select() method to range
+- [X] Rename CSS class applier module to "class applier module"
+- [X] Add handling for img and similar elements in class applier module
+- [X] AMD support
+- [X] Add getNativeTextRange() to selection for IE 11
+- [X] Add Range setStartAndEnd(). Overloaded? eg. two args collapsed, three args (node, startOffset, endOffset),
+ four args (startNode, startOffset, endNode, endOffset) (consider this)
+
+1.4
+---
+
+- [?] Consider range.restrict(node)
+- [?] Consider filter option in createClassApplier() options object
+- [ ] Either a utils module or an FAQ page with code snippets for common use cases, including:
+ - [X] Simple selection save/restore (bookmark?) (is this necessary?)
+ - [ ] Insert HTML
+ (http://stackoverflow.com/questions/2213376/how-to-find-cursor-position-in-a-contenteditable-div/2213514#2213514)
+- [?] Some kind of jQuery integration module?
+- [ ] Move IE <= 8 support into a separate optional module
+- [ ] Add withinRange and withinNode options to move(), moveStart() and moveEnd() methods
+- [?] Positions module
+ (http://stackoverflow.com/questions/4122315/how-to-find-xy-position-in-javascript-with-offset/4123495#4123495)
+- [ ] Config module or something so that config can work with AMD. See PR #285
+ (https://github.com/timdown/rangy/pull/285)
+- [ ] Move to one of the common testing libraries
+- [ ] Update build not to use a fresh Git checkout
+- [ ] Investigate shadow DOM (issue #307)
+
+Possible features for some version
+----------------------------------
+
+- [?] Commands module with basic inline commands (bold, italic, colour, font face, font size, background colour, etc.)
+ (http://stackoverflow.com/questions/2887101/apply-style-to-range-of-text-with-javascript-in-uiwebview/2888969#2888969)
+- [?] More commands (block? Insert line break? Think about this, don't want to build a WYSIWYG editor)
+- [ ] Add selection extend()? Don't think this is possible.
+- [ ] Option in TextRange module for alternative ways to extract text for an element (see email from Bruce Augustine)
diff --git a/test/bold.html b/test/bold.html
index 9cdd627d..6ee8be54 100644
--- a/test/bold.html
+++ b/test/bold.html
@@ -1,43 +1,43 @@
-
-
-
-
-
-
-
-
-
Some lovely bold content and strong stuff and
- a styled span, yeah, and a classy span
-
-
+
+
+
+
+
+
+
+
+
Some lovely bold content and strong stuff and
+ a styled span, yeah, and a classy span
+
+
\ No newline at end of file
diff --git a/test/classapplier.html b/test/classapplier.html
index 75ee4c9e..affa3f79 100644
--- a/test/classapplier.html
+++ b/test/classapplier.html
@@ -1,86 +1,86 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 29 min: After that let-off, Portugal tear down the other end and sow panic in the Brazilian defence.
-
-
-
-
-
-
-
-
Zero
-
One two
-
Four five
-
29 min: After that let-off, Portugal tear down the other end and sow panic in the Brazilian defence, Juan forced into a clusmy-looking tackle on Tiago, who tumbles theatrically. Portugal players howl for a penalty, the ref books Tiago for diving.
-
28 min: Portugal switch off defensively, allowing Nilmar to collect a through-ball and shoot from eight yards. The keeper pushes it on to the psot and out! Great save. "Klose ..." blurts David Roberts. "... but no cigar."
-
-Some preformatted text.
-
- Wonder how it'll do
-
-with this, plus some line breaks
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 29 min: After that let-off, Portugal tear down the other end and sow panic in the Brazilian defence.
+
+
+
+
+
+
+
+
Zero
+
One two
+
Four five
+
29 min: After that let-off, Portugal tear down the other end and sow panic in the Brazilian defence, Juan forced into a clusmy-looking tackle on Tiago, who tumbles theatrically. Portugal players howl for a penalty, the ref books Tiago for diving.
+
28 min: Portugal switch off defensively, allowing Nilmar to collect a through-ball and shoot from eight yards. The keeper pushes it on to the psot and out! Great save. "Klose ..." blurts David Roberts. "... but no cigar."
+
+Some preformatted text.
+
+ Wonder how it'll do
+
+with this, plus some line breaks
+
+
+
x', htmlAndRangeToString(testEl, range));
- });
-
- s.test("Test whitespace 6 (pre-line whitespace with no line break between paras)", function(t) {
- var applier = rangy.createClassApplier("c1", {ignoreWhiteSpace: true});
-
- var testEl = document.getElementById("test");
- var range = createRangeInHtml(testEl, 'x[
', htmlAndRangeToString(testEl, range));
- });
-
- s.test("Undo to range with empty span with class", function(t) {
- var applier = rangy.createClassApplier("test");
- var testEl = document.getElementById("test");
- var range = createRangeInHtml(testEl, '