Update checked-in dependencies
This commit is contained in:
parent
6b0d45a5c6
commit
cc1adb825a
4247 changed files with 144820 additions and 149530 deletions
129
node_modules/object-inspect/index.js
generated
vendored
129
node_modules/object-inspect/index.js
generated
vendored
|
|
@ -10,14 +10,29 @@ var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
|
|||
var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
|
||||
var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
|
||||
var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
|
||||
var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
|
||||
var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
|
||||
var booleanValueOf = Boolean.prototype.valueOf;
|
||||
var objectToString = Object.prototype.toString;
|
||||
var functionToString = Function.prototype.toString;
|
||||
var match = String.prototype.match;
|
||||
var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
|
||||
var gOPS = Object.getOwnPropertySymbols;
|
||||
var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
|
||||
var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
|
||||
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
||||
|
||||
var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
|
||||
[].__proto__ === Array.prototype // eslint-disable-line no-proto
|
||||
? function (O) {
|
||||
return O.__proto__; // eslint-disable-line no-proto
|
||||
}
|
||||
: null
|
||||
);
|
||||
|
||||
var inspectCustom = require('./util.inspect').custom;
|
||||
var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null;
|
||||
var toStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag !== 'undefined' ? Symbol.toStringTag : null;
|
||||
|
||||
module.exports = function inspect_(obj, options, depth, seen) {
|
||||
var opts = options || {};
|
||||
|
|
@ -34,8 +49,8 @@ module.exports = function inspect_(obj, options, depth, seen) {
|
|||
throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
|
||||
}
|
||||
var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;
|
||||
if (typeof customInspect !== 'boolean') {
|
||||
throw new TypeError('option "customInspect", if provided, must be `true` or `false`');
|
||||
if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
|
||||
throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
|
||||
}
|
||||
|
||||
if (
|
||||
|
|
@ -66,7 +81,7 @@ module.exports = function inspect_(obj, options, depth, seen) {
|
|||
}
|
||||
return String(obj);
|
||||
}
|
||||
if (typeof obj === 'bigint') { // eslint-disable-line valid-typeof
|
||||
if (typeof obj === 'bigint') {
|
||||
return String(obj) + 'n';
|
||||
}
|
||||
|
||||
|
|
@ -103,11 +118,12 @@ module.exports = function inspect_(obj, options, depth, seen) {
|
|||
|
||||
if (typeof obj === 'function') {
|
||||
var name = nameOf(obj);
|
||||
return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']';
|
||||
var keys = arrObjKeys(obj, inspect);
|
||||
return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + keys.join(', ') + ' }' : '');
|
||||
}
|
||||
if (isSymbol(obj)) {
|
||||
var symString = Symbol.prototype.toString.call(obj);
|
||||
return typeof obj === 'object' ? markBoxed(symString) : symString;
|
||||
var symString = hasShammedSymbols ? String(obj).replace(/^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
|
||||
return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
|
||||
}
|
||||
if (isElement(obj)) {
|
||||
var s = '<' + String(obj.nodeName).toLowerCase();
|
||||
|
|
@ -136,7 +152,7 @@ module.exports = function inspect_(obj, options, depth, seen) {
|
|||
if (typeof obj === 'object' && customInspect) {
|
||||
if (inspectSymbol && typeof obj[inspectSymbol] === 'function') {
|
||||
return obj[inspectSymbol]();
|
||||
} else if (typeof obj.inspect === 'function') {
|
||||
} else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
|
||||
return obj.inspect();
|
||||
}
|
||||
}
|
||||
|
|
@ -160,6 +176,9 @@ module.exports = function inspect_(obj, options, depth, seen) {
|
|||
if (isWeakSet(obj)) {
|
||||
return weakCollectionOf('WeakSet');
|
||||
}
|
||||
if (isWeakRef(obj)) {
|
||||
return weakCollectionOf('WeakRef');
|
||||
}
|
||||
if (isNumber(obj)) {
|
||||
return markBoxed(inspect(Number(obj)));
|
||||
}
|
||||
|
|
@ -174,11 +193,16 @@ module.exports = function inspect_(obj, options, depth, seen) {
|
|||
}
|
||||
if (!isDate(obj) && !isRegExp(obj)) {
|
||||
var ys = arrObjKeys(obj, inspect);
|
||||
if (ys.length === 0) { return '{}'; }
|
||||
var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
|
||||
var protoTag = obj instanceof Object ? '' : 'null prototype';
|
||||
var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? toStr(obj).slice(8, -1) : protoTag ? 'Object' : '';
|
||||
var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
|
||||
var tag = constructorTag + (stringTag || protoTag ? '[' + [].concat(stringTag || [], protoTag || []).join(': ') + '] ' : '');
|
||||
if (ys.length === 0) { return tag + '{}'; }
|
||||
if (indent) {
|
||||
return '{' + indentedJoin(ys, indent) + '}';
|
||||
return tag + '{' + indentedJoin(ys, indent) + '}';
|
||||
}
|
||||
return '{ ' + ys.join(', ') + ' }';
|
||||
return tag + '{ ' + ys.join(', ') + ' }';
|
||||
}
|
||||
return String(obj);
|
||||
};
|
||||
|
|
@ -192,15 +216,42 @@ 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 isBigInt(obj) { return toStr(obj) === '[object BigInt]'; }
|
||||
function isBoolean(obj) { return toStr(obj) === '[object Boolean]'; }
|
||||
function isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
||||
function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
||||
function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
||||
function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
||||
function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
||||
function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
||||
function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
||||
|
||||
// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
|
||||
function isSymbol(obj) {
|
||||
if (hasShammedSymbols) {
|
||||
return obj && typeof obj === 'object' && obj instanceof Symbol;
|
||||
}
|
||||
if (typeof obj === 'symbol') {
|
||||
return true;
|
||||
}
|
||||
if (!obj || typeof obj !== 'object' || !symToString) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
symToString.call(obj);
|
||||
return true;
|
||||
} catch (e) {}
|
||||
return false;
|
||||
}
|
||||
|
||||
function isBigInt(obj) {
|
||||
if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
bigIntValueOf.call(obj);
|
||||
return true;
|
||||
} catch (e) {}
|
||||
return false;
|
||||
}
|
||||
|
||||
var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
|
||||
function has(obj, key) {
|
||||
|
|
@ -258,6 +309,17 @@ function isWeakMap(x) {
|
|||
return false;
|
||||
}
|
||||
|
||||
function isWeakRef(x) {
|
||||
if (!weakRefDeref || !x || typeof x !== 'object') {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
weakRefDeref.call(x);
|
||||
return true;
|
||||
} catch (e) {}
|
||||
return false;
|
||||
}
|
||||
|
||||
function isSet(x) {
|
||||
if (!setSize || !x || typeof x !== 'object') {
|
||||
return false;
|
||||
|
|
@ -312,10 +374,14 @@ function inspectString(str, opts) {
|
|||
function lowbyte(c) {
|
||||
var n = c.charCodeAt(0);
|
||||
var x = {
|
||||
8: 'b', 9: 't', 10: 'n', 12: 'f', 13: 'r'
|
||||
8: 'b',
|
||||
9: 't',
|
||||
10: 'n',
|
||||
12: 'f',
|
||||
13: 'r'
|
||||
}[n];
|
||||
if (x) { return '\\' + x; }
|
||||
return '\\x' + (n < 0x10 ? '0' : '') + n.toString(16);
|
||||
return '\\x' + (n < 0x10 ? '0' : '') + n.toString(16).toUpperCase();
|
||||
}
|
||||
|
||||
function markBoxed(str) {
|
||||
|
|
@ -370,14 +436,33 @@ function arrObjKeys(obj, inspect) {
|
|||
xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';
|
||||
}
|
||||
}
|
||||
var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
|
||||
var symMap;
|
||||
if (hasShammedSymbols) {
|
||||
symMap = {};
|
||||
for (var k = 0; k < syms.length; k++) {
|
||||
symMap['$' + syms[k]] = syms[k];
|
||||
}
|
||||
}
|
||||
|
||||
for (var key in obj) { // eslint-disable-line no-restricted-syntax
|
||||
if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
|
||||
if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
|
||||
if ((/[^\w$]/).test(key)) {
|
||||
if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
|
||||
// this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
|
||||
continue; // eslint-disable-line no-restricted-syntax, no-continue
|
||||
} else if ((/[^\w$]/).test(key)) {
|
||||
xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
|
||||
} else {
|
||||
xs.push(key + ': ' + inspect(obj[key], obj));
|
||||
}
|
||||
}
|
||||
if (typeof gOPS === 'function') {
|
||||
for (var j = 0; j < syms.length; j++) {
|
||||
if (isEnumerable.call(obj, syms[j])) {
|
||||
xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
return xs;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue