|
|
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
|
|
// shim for using process in browser
|
|
|
var process = module.exports = {};
|
|
|
|
|
|
// cached from whatever global is present so that test runners that stub it
|
|
|
// don't break things. But we need to wrap it in a try catch in case it is
|
|
|
// wrapped in strict mode code which doesn't define any globals. It's inside a
|
|
|
// function because try/catches deoptimize in certain engines.
|
|
|
|
|
|
var cachedSetTimeout;
|
|
|
var cachedClearTimeout;
|
|
|
|
|
|
function defaultSetTimout() {
|
|
|
throw new Error('setTimeout has not been defined');
|
|
|
}
|
|
|
function defaultClearTimeout () {
|
|
|
throw new Error('clearTimeout has not been defined');
|
|
|
}
|
|
|
(function () {
|
|
|
try {
|
|
|
if (typeof setTimeout === 'function') {
|
|
|
cachedSetTimeout = setTimeout;
|
|
|
} else {
|
|
|
cachedSetTimeout = defaultSetTimout;
|
|
|
}
|
|
|
} catch (e) {
|
|
|
cachedSetTimeout = defaultSetTimout;
|
|
|
}
|
|
|
try {
|
|
|
if (typeof clearTimeout === 'function') {
|
|
|
cachedClearTimeout = clearTimeout;
|
|
|
} else {
|
|
|
cachedClearTimeout = defaultClearTimeout;
|
|
|
}
|
|
|
} catch (e) {
|
|
|
cachedClearTimeout = defaultClearTimeout;
|
|
|
}
|
|
|
} ())
|
|
|
function runTimeout(fun) {
|
|
|
if (cachedSetTimeout === setTimeout) {
|
|
|
//normal enviroments in sane situations
|
|
|
return setTimeout(fun, 0);
|
|
|
}
|
|
|
// if setTimeout wasn't available but was latter defined
|
|
|
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
|
|
cachedSetTimeout = setTimeout;
|
|
|
return setTimeout(fun, 0);
|
|
|
}
|
|
|
try {
|
|
|
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
|
return cachedSetTimeout(fun, 0);
|
|
|
} catch(e){
|
|
|
try {
|
|
|
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
|
return cachedSetTimeout.call(null, fun, 0);
|
|
|
} catch(e){
|
|
|
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
|
|
|
return cachedSetTimeout.call(this, fun, 0);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
function runClearTimeout(marker) {
|
|
|
if (cachedClearTimeout === clearTimeout) {
|
|
|
//normal enviroments in sane situations
|
|
|
return clearTimeout(marker);
|
|
|
}
|
|
|
// if clearTimeout wasn't available but was latter defined
|
|
|
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
|
|
cachedClearTimeout = clearTimeout;
|
|
|
return clearTimeout(marker);
|
|
|
}
|
|
|
try {
|
|
|
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
|
return cachedClearTimeout(marker);
|
|
|
} catch (e){
|
|
|
try {
|
|
|
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
|
return cachedClearTimeout.call(null, marker);
|
|
|
} catch (e){
|
|
|
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
|
|
|
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
|
|
return cachedClearTimeout.call(this, marker);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
var queue = [];
|
|
|
var draining = false;
|
|
|
var currentQueue;
|
|
|
var queueIndex = -1;
|
|
|
|
|
|
function cleanUpNextTick() {
|
|
|
if (!draining || !currentQueue) {
|
|
|
return;
|
|
|
}
|
|
|
draining = false;
|
|
|
if (currentQueue.length) {
|
|
|
queue = currentQueue.concat(queue);
|
|
|
} else {
|
|
|
queueIndex = -1;
|
|
|
}
|
|
|
if (queue.length) {
|
|
|
drainQueue();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function drainQueue() {
|
|
|
if (draining) {
|
|
|
return;
|
|
|
}
|
|
|
var timeout = runTimeout(cleanUpNextTick);
|
|
|
draining = true;
|
|
|
|
|
|
var len = queue.length;
|
|
|
while(len) {
|
|
|
currentQueue = queue;
|
|
|
queue = [];
|
|
|
while (++queueIndex < len) {
|
|
|
if (currentQueue) {
|
|
|
currentQueue[queueIndex].run();
|
|
|
}
|
|
|
}
|
|
|
queueIndex = -1;
|
|
|
len = queue.length;
|
|
|
}
|
|
|
currentQueue = null;
|
|
|
draining = false;
|
|
|
runClearTimeout(timeout);
|
|
|
}
|
|
|
|
|
|
process.nextTick = function (fun) {
|
|
|
var args = new Array(arguments.length - 1);
|
|
|
if (arguments.length > 1) {
|
|
|
for (var i = 1; i < arguments.length; i++) {
|
|
|
args[i - 1] = arguments[i];
|
|
|
}
|
|
|
}
|
|
|
queue.push(new Item(fun, args));
|
|
|
if (queue.length === 1 && !draining) {
|
|
|
runTimeout(drainQueue);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
// v8 likes predictible objects
|
|
|
function Item(fun, array) {
|
|
|
this.fun = fun;
|
|
|
this.array = array;
|
|
|
}
|
|
|
Item.prototype.run = function () {
|
|
|
this.fun.apply(null, this.array);
|
|
|
};
|
|
|
process.title = 'browser';
|
|
|
process.browser = true;
|
|
|
process.env = {};
|
|
|
process.argv = [];
|
|
|
process.version = ''; // empty string to avoid regexp issues
|
|
|
process.versions = {};
|
|
|
|
|
|
function noop() {}
|
|
|
|
|
|
process.on = noop;
|
|
|
process.addListener = noop;
|
|
|
process.once = noop;
|
|
|
process.off = noop;
|
|
|
process.removeListener = noop;
|
|
|
process.removeAllListeners = noop;
|
|
|
process.emit = noop;
|
|
|
process.prependListener = noop;
|
|
|
process.prependOnceListener = noop;
|
|
|
|
|
|
process.listeners = function (name) { return [] }
|
|
|
|
|
|
process.binding = function (name) {
|
|
|
throw new Error('process.binding is not supported');
|
|
|
};
|
|
|
|
|
|
process.cwd = function () { return '/' };
|
|
|
process.chdir = function (dir) {
|
|
|
throw new Error('process.chdir is not supported');
|
|
|
};
|
|
|
process.umask = function() { return 0; };
|
|
|
|
|
|
},{}],2:[function(require,module,exports){
|
|
|
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
|
|
|
}
|
|
|
}
|
|
|
|
|
|
},{}],3:[function(require,module,exports){
|
|
|
module.exports = function isBuffer(arg) {
|
|
|
return arg && typeof arg === 'object'
|
|
|
&& typeof arg.copy === 'function'
|
|
|
&& typeof arg.fill === 'function'
|
|
|
&& typeof arg.readUInt8 === 'function';
|
|
|
}
|
|
|
},{}],4:[function(require,module,exports){
|
|
|
(function (process,global){
|
|
|
// 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 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);
|
|
|
}
|
|
|
|
|
|
// IE doesn't make error fields non-enumerable
|
|
|
// http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
|
|
|
if (isError(value)
|
|
|
&& (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
|
|
|
return formatError(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))
|
|
|
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) {
|
|
|
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;
|
|
|
|
|
|
exports.isBuffer = require('./support/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 = require('inherits');
|
|
|
|
|
|
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);
|
|
|
}
|
|
|
|
|
|
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
|
},{"./support/isBuffer":3,"_process":1,"inherits":2}],5:[function(require,module,exports){
|
|
|
var hasMap = typeof Map === 'function' && Map.prototype;
|
|
|
var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
|
|
|
var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
|
|
|
var mapForEach = hasMap && Map.prototype.forEach;
|
|
|
var hasSet = typeof Set === 'function' && Set.prototype;
|
|
|
var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
|
|
|
var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
|
|
|
var setForEach = hasSet && Set.prototype.forEach;
|
|
|
var booleanValueOf = Boolean.prototype.valueOf;
|
|
|
var objectToString = Object.prototype.toString;
|
|
|
|
|
|
var util = require('util');
|
|
|
var inspectSymbol = util && util.inspect && isSymbol(util.inspect.custom) ? util.inspect.custom : null;
|
|
|
|
|
|
module.exports = function inspect_ (obj, opts, depth, seen) {
|
|
|
if (typeof obj === 'undefined') {
|
|
|
return 'undefined';
|
|
|
}
|
|
|
if (obj === null) {
|
|
|
return 'null';
|
|
|
}
|
|
|
if (typeof obj === 'boolean') {
|
|
|
return obj ? 'true' : 'false';
|
|
|
}
|
|
|
if (typeof obj === 'string') {
|
|
|
return inspectString(obj);
|
|
|
}
|
|
|
if (typeof obj === 'number') {
|
|
|
if (obj === 0) {
|
|
|
return Infinity / obj > 0 ? '0' : '-0';
|
|
|
}
|
|
|
return String(obj);
|
|
|
}
|
|
|
|
|
|
if (!opts) opts = {};
|
|
|
|
|
|
var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
|
|
|
if (typeof depth === 'undefined') depth = 0;
|
|
|
if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
|
|
|
return '[Object]';
|
|
|
}
|
|
|
|
|
|
if (typeof seen === 'undefined') seen = [];
|
|
|
else if (indexOf(seen, obj) >= 0) {
|
|
|
return '[Circular]';
|
|
|
}
|
|
|
|
|
|
function inspect (value, from) {
|
|
|
if (from) {
|
|
|
seen = seen.slice();
|
|
|
seen.push(from);
|
|
|
}
|
|
|
return inspect_(value, opts, depth + 1, seen);
|
|
|
}
|
|
|
|
|
|
if (typeof obj === 'function') {
|
|
|
var name = nameOf(obj);
|
|
|
return '[Function' + (name ? ': ' + name : '') + ']';
|
|
|
}
|
|
|
if (isSymbol(obj)) {
|
|
|
var symString = Symbol.prototype.toString.call(obj);
|
|
|
return typeof obj === 'object' ? markBoxed(symString) : symString;
|
|
|
}
|
|
|
if (isElement(obj)) {
|
|
|
var s = '<' + String(obj.nodeName).toLowerCase();
|
|
|
var attrs = obj.attributes || [];
|
|
|
for (var i = 0; i < attrs.length; i++) {
|
|
|
s += ' ' + attrs[i].name + '="' + quote(attrs[i].value) + '"';
|
|
|
}
|
|
|
s += '>';
|
|
|
if (obj.childNodes && obj.childNodes.length) s += '...';
|
|
|
s += '</' + String(obj.nodeName).toLowerCase() + '>';
|
|
|
return s;
|
|
|
}
|
|
|
if (isArray(obj)) {
|
|
|
if (obj.length === 0) return '[]';
|
|
|
return '[ ' + arrObjKeys(obj, inspect).join(', ') + ' ]';
|
|
|
}
|
|
|
if (isError(obj)) {
|
|
|
var parts = arrObjKeys(obj, inspect);
|
|
|
if (parts.length === 0) return '[' + String(obj) + ']';
|
|
|
return '{ [' + String(obj) + '] ' + parts.join(', ') + ' }';
|
|
|
}
|
|
|
if (typeof obj === 'object') {
|
|
|
if (inspectSymbol && typeof obj[inspectSymbol] === 'function') {
|
|
|
return obj[inspectSymbol]();
|
|
|
} else if (typeof obj.inspect === 'function') {
|
|
|
return obj.inspect();
|
|
|
}
|
|
|
}
|
|
|
if (isMap(obj)) {
|
|
|
var parts = [];
|
|
|
mapForEach.call(obj, function (value, key) {
|
|
|
parts.push(inspect(key, obj) + ' => ' + inspect(value, obj));
|
|
|
});
|
|
|
return collectionOf('Map', mapSize.call(obj), parts);
|
|
|
}
|
|
|
if (isSet(obj)) {
|
|
|
var parts = [];
|
|
|
setForEach.call(obj, function (value ) {
|
|
|
parts.push(inspect(value, obj));
|
|
|
});
|
|
|
return collectionOf('Set', setSize.call(obj), parts);
|
|
|
}
|
|
|
if (isNumber(obj)) {
|
|
|
return markBoxed(Number(obj));
|
|
|
}
|
|
|
if (isBoolean(obj)) {
|
|
|
return markBoxed(booleanValueOf.call(obj));
|
|
|
}
|
|
|
if (isString(obj)) {
|
|
|
return markBoxed(inspect(String(obj)));
|
|
|
}
|
|
|
if (!isDate(obj) && !isRegExp(obj)) {
|
|
|
var xs = arrObjKeys(obj, inspect);
|
|
|
if (xs.length === 0) return '{}';
|
|
|
return '{ ' + xs.join(', ') + ' }';
|
|
|
}
|
|
|
return String(obj);
|
|
|
};
|
|
|
|
|
|
function quote (s) {
|
|
|
return String(s).replace(/"/g, '"');
|
|
|
}
|
|
|
|
|
|
function isArray (obj) { return toStr(obj) === '[object Array]' }
|
|
|
function isDate (obj) { return toStr(obj) === '[object Date]' }
|
|
|
function isRegExp (obj) { return toStr(obj) === '[object RegExp]' }
|
|
|
function isError (obj) { return toStr(obj) === '[object Error]' }
|
|
|
function isSymbol (obj) { return toStr(obj) === '[object Symbol]' }
|
|
|
function isString (obj) { return toStr(obj) === '[object String]' }
|
|
|
function isNumber (obj) { return toStr(obj) === '[object Number]' }
|
|
|
function isBoolean (obj) { return toStr(obj) === '[object Boolean]' }
|
|
|
|
|
|
var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
|
|
|
function has (obj, key) {
|
|
|
return hasOwn.call(obj, key);
|
|
|
}
|
|
|
|
|
|
function toStr (obj) {
|
|
|
return objectToString.call(obj);
|
|
|
}
|
|
|
|
|
|
function nameOf (f) {
|
|
|
if (f.name) return f.name;
|
|
|
var m = String(f).match(/^function\s*([\w$]+)/);
|
|
|
if (m) return m[1];
|
|
|
}
|
|
|
|
|
|
function indexOf (xs, x) {
|
|
|
if (xs.indexOf) return xs.indexOf(x);
|
|
|
for (var i = 0, l = xs.length; i < l; i++) {
|
|
|
if (xs[i] === x) return i;
|
|
|
}
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
function isMap (x) {
|
|
|
if (!mapSize) {
|
|
|
return false;
|
|
|
}
|
|
|
try {
|
|
|
mapSize.call(x);
|
|
|
try {
|
|
|
setSize.call(x);
|
|
|
} catch (s) {
|
|
|
return true;
|
|
|
}
|
|
|
return x instanceof Map; // core-js workaround, pre-v2.5.0
|
|
|
} catch (e) {}
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
function isSet (x) {
|
|
|
if (!setSize) {
|
|
|
return false;
|
|
|
}
|
|
|
try {
|
|
|
setSize.call(x);
|
|
|
try {
|
|
|
mapSize.call(x);
|
|
|
} catch (m) {
|
|
|
return true;
|
|
|
}
|
|
|
return x instanceof Set; // core-js workaround, pre-v2.5.0
|
|
|
} catch (e) {}
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
function isElement (x) {
|
|
|
if (!x || typeof x !== 'object') return false;
|
|
|
if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
|
|
|
return true;
|
|
|
}
|
|
|
return typeof x.nodeName === 'string'
|
|
|
&& typeof x.getAttribute === 'function'
|
|
|
;
|
|
|
}
|
|
|
|
|
|
function inspectString (str) {
|
|
|
var s = str.replace(/(['\\])/g, '\\$1').replace(/[\x00-\x1f]/g, lowbyte);
|
|
|
return "'" + s + "'";
|
|
|
}
|
|
|
|
|
|
function lowbyte (c) {
|
|
|
var n = c.charCodeAt(0);
|
|
|
var x = { 8: 'b', 9: 't', 10: 'n', 12: 'f', 13: 'r' }[n];
|
|
|
if (x) return '\\' + x;
|
|
|
return '\\x' + (n < 0x10 ? '0' : '') + n.toString(16);
|
|
|
}
|
|
|
|
|
|
function markBoxed (str) {
|
|
|
return 'Object(' + str + ')';
|
|
|
}
|
|
|
|
|
|
function collectionOf (type, size, entries) {
|
|
|
return type + ' (' + size + ') {' + entries.join(', ') + '}';
|
|
|
}
|
|
|
|
|
|
function arrObjKeys (obj, inspect) {
|
|
|
var isArr = isArray(obj);
|
|
|
var xs = [];
|
|
|
if (isArr) {
|
|
|
xs.length = obj.length;
|
|
|
for (var i = 0; i < obj.length; i++) {
|
|
|
xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';
|
|
|
}
|
|
|
}
|
|
|
for (var key in obj) {
|
|
|
if (!has(obj, key)) continue;
|
|
|
if (isArr && String(Number(key)) === key && key < obj.length) continue;
|
|
|
if (/[^\w$]/.test(key)) {
|
|
|
xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
|
|
|
} else {
|
|
|
xs.push(key + ': ' + inspect(obj[key], obj));
|
|
|
}
|
|
|
}
|
|
|
return xs;
|
|
|
}
|
|
|
|
|
|
},{"util":4}]},{},[5]);
|
|
|
|