Socket
Socket
Sign inDemoInstall

inspect-x

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inspect-x - npm Package Compare versions

Comparing version 3.0.11 to 3.0.12

src/.eslintrc.js

374

dist/inspect-x.esm.js

@@ -1,7 +0,11 @@

var _this = this;
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _newArrowCheck(innerThis, boundThis) { if (innerThis !== boundThis) { throw new TypeError("Cannot instantiate an arrow function"); } }
import bind from 'bind-x';

@@ -58,20 +62,8 @@ import isFunction from 'is-function-x';

import union from 'array-union-x';
/** @type {RegExpConstructor} */
import toBoolean from 'to-boolean-x';
import toObject from 'to-object-x';
var EMPTY_ARRAY = [];
var RegExpCtr = /none/.constructor;
/** @type {BooleanConstructor} */
var NumberCtr = 0 .constructor;
/** @type {ArrayConstructor} */
var ArrayCtr = [].constructor;
/** @type {StringConstructor} */
var StringCtr = ''.constructor;
/** @type {ObjectConstructor} */
var castObject = {}.constructor;
/** @type {BooleanConstructor} */
var castBoolean = true.constructor;
var EMPTY_STRING = '';
var EMPTY_OBJECT = {};
var call = isFunction.call;

@@ -84,10 +76,6 @@ /* eslint-disable-next-line compat/compat */

var testSet = hasSet && new Set(['SetSentinel']);
var setForEach = hasSet && bind(call, testSet.forEach);
var setValues = hasSet && bind(call, testSet.values);
/* eslint-disable-next-line compat/compat */
var setForEach = hasSet && bind(call, Set.prototype.forEach);
/* eslint-disable-next-line compat/compat */
var setValues = hasSet && bind(call, Set.prototype.values);
/* eslint-disable-next-line compat/compat */
var hasMap = typeof Map === 'function' && isMap(new Map());

@@ -97,10 +85,6 @@ /* eslint-disable-next-line compat/compat */

var testMap = hasMap && new Map([[1, 'MapSentinel']]);
var mapForEach = hasMap && bind(call, testMap.forEach);
var mapValues = hasMap && bind(call, testMap.values);
/* eslint-disable-next-line compat/compat */
var mapForEach = hasMap && bind(call, Map.prototype.forEach);
/* eslint-disable-next-line compat/compat */
var mapValues = hasMap && bind(call, Map.prototype.values);
/* eslint-disable-next-line compat/compat */
var symbolToString = hasSymbolSupport && bind(call, Symbol.prototype.toString);

@@ -110,3 +94,4 @@ /* eslint-disable-next-line compat/compat */

var symbolValueOf = hasSymbolSupport && bind(call, Symbol.prototype.valueOf);
var objectSeal = isFunction(castObject.seal) ? castObject.seal : function seal(value) {
var oSeal = EMPTY_OBJECT.constructor.seal;
var objectSeal = isFunction(oSeal) ? oSeal : function seal(value) {
return value;

@@ -117,11 +102,11 @@ };

var errorToString = bind(call, Error.prototype.toString);
var numberToString = bind(call, NumberCtr.prototype.toString);
var booleanToString = bind(call, castBoolean.prototype.toString);
var concat = bind(call, ArrayCtr.prototype.concat, []);
var join = bind(call, ArrayCtr.prototype.join);
var push = bind(call, ArrayCtr.prototype.push);
var numberToString = bind(call, 0 .toString);
var booleanToString = bind(call, true.toString);
var concat = bind(call, EMPTY_ARRAY.concat, EMPTY_ARRAY);
var join = bind(call, EMPTY_ARRAY.join);
var push = bind(call, EMPTY_ARRAY.push);
var getTime = bind(call, Date.prototype.getTime);
var replace = bind(call, StringCtr.prototype.replace);
var strSlice = bind(call, StringCtr.prototype.slice);
var propertyIsEnumerable = bind(call, castObject.prototype.propertyIsEnumerable);
var replace = bind(call, EMPTY_STRING.replace);
var strSlice = bind(call, EMPTY_STRING.slice);
var propertyIsEnumerable = bind(call, EMPTY_OBJECT.propertyIsEnumerable);
/* eslint-disable-next-line compat/compat */

@@ -142,7 +127,7 @@

var inspect;
var fmtValue;
var $inspect;
var $fmtValue;
var isFalsey = function _isFalsey(value) {
return castBoolean(value) === false;
var isFalsey = function isFalsey(value) {
return toBoolean(value) === false;
};

@@ -159,3 +144,3 @@

var isClass = function _isClass(value) {
var isClass = function isClass(value) {
return supportsClasses ? isFunction(value, true) && isFunction(value) === false : false;

@@ -183,15 +168,15 @@ };

var pluralEnding = function _pluralEnding(number) {
return number > 1 ? 's' : '';
var pluralEnding = function pluralEnding(number) {
return number > 1 ? 's' : EMPTY_STRING;
};
var isDigits = function _isDigits(key) {
var isDigits = function isDigits(key) {
return regexpTest(/^\d+$/, key);
};
var appendMissing = function _appendMissing(array, values) {
var appendMissing = function appendMissing(array, values) {
return concat(array, difference(values, array));
};
var promote = function _promote(array, values) {
var promote = function promote(array, values) {
return concat(values, difference(array, values));

@@ -221,3 +206,3 @@ };

if (isDate(Date.prototype)) {
isDate = function _isDate(value) {
isDate = function $isDate(value) {
try {

@@ -237,7 +222,5 @@ getTime(value);

var datePropsCheck = ['now', 'UTC', 'parse'];
shimmedDate = every(datePropsCheck, function (prop) {
_newArrowCheck(this, _this);
shimmedDate = every(datePropsCheck, function predicate(prop) {
return arrayincludes(dateProps, prop);
}.bind(this)) && arrayincludes(objectKeys(new Date()), 'constructor');
}) && arrayincludes(objectKeys(new Date()), 'constructor');
}

@@ -252,7 +235,5 @@ /* eslint-disable-next-line lodash/prefer-noop */

var wantedFnProps = ['length', 'name', 'prototype'];
var fnPropsCheck = fnSupportsName ? slice(wantedFnProps) : filter(wantedFnProps, function (prop) {
_newArrowCheck(this, _this);
var fnPropsCheck = fnSupportsName ? slice(wantedFnProps) : filter(wantedFnProps, function predicate(prop) {
return prop !== 'name';
}.bind(this));
});
var funcKeys = reflectOwnKeys(testFunc1);

@@ -263,7 +244,5 @@ var unwantedFnProps = intersection(['arguments', 'caller'], funcKeys);

if (mustFilterFnProps === false) {
mustFilterFnProps = some(intersection(funcKeys, wantedFnProps), function (key, index) {
_newArrowCheck(this, _this);
mustFilterFnProps = some(intersection(funcKeys, wantedFnProps), function predicate(key, index) {
return wantedFnProps[index] !== key;
}.bind(this));
});
}

@@ -281,19 +260,19 @@

var isBooleanType = function _isBooleanType(arg) {
var isBooleanType = function isBooleanType(arg) {
return typeof arg === 'boolean';
};
var isNumberType = function _isNumberType(arg) {
var isNumberType = function isNumberType(arg) {
return typeof arg === 'number';
};
var isStringType = function _isStringType(arg) {
var isStringType = function isStringType(arg) {
return typeof arg === 'string';
};
var isSymbolType = function _isSymbolType(arg) {
var isSymbolType = function isSymbolType(arg) {
return _typeof(arg) === 'symbol';
};
var isMapIterator = function _isMapIterator(value) {
var isMapIterator = function isMapIterator(value) {
if (hasMap === false || isObjectLike(value) === false) {

@@ -311,3 +290,3 @@ return false;

var isSetIterator = function _isSetIterator(value) {
var isSetIterator = function isSetIterator(value) {
if (hasSet === false || isObjectLike(value) === false) {

@@ -325,17 +304,13 @@ return false;

var filterIndexes = function _filterIndexes(keys, length) {
var _this2 = this;
return filter(keys, function (key) {
_newArrowCheck(this, _this2);
var filterIndexes = function filterIndexes(keys, length) {
return filter(keys, function predicate(key) {
return isSymbolType(key) || key < 0 || key > length || key % 1 !== 0;
}.bind(this));
});
};
var stylizeWithColor = function _stylizeWithColor(str, styleType) {
var style = inspect.styles[styleType];
var stylizeWithColor = function stylizeWithColor(str, styleType) {
var style = $inspect.styles[styleType];
if (style) {
var colors = inspect.colors[style];
var colors = $inspect.colors[style];
return "\x1B[".concat(colors[0], "m").concat(str, "\x1B[").concat(colors[1], "m");

@@ -347,7 +322,7 @@ }

var stylizeNoColor = function _stylizeNoColor(str) {
var stylizeNoColor = function stylizeNoColor(str) {
return str;
};
var getNameSep = function _getNameSep(obj) {
var getNameSep = function getNameSep(obj) {
var name = getFunctionName(obj);

@@ -357,3 +332,3 @@ return name ? ": ".concat(name) : name;

var getConstructorOf = function _getConstructorOf(obj) {
var getConstructorOf = function getConstructorOf(obj) {
var o = obj;

@@ -363,3 +338,3 @@ var maxLoop = 100;

while (isNil(o) === false && maxLoop >= 0) {
o = castObject(o);
o = toObject(o);
var descriptor = getOwnPropertyDescriptor(o, 'constructor');

@@ -378,3 +353,3 @@

var isSub = function _isSub(value) {
var isSub = function isSub(value) {
if (supportsClasses !== true || isPrimitive(value)) {

@@ -388,3 +363,3 @@ return false;

var getSubName = function _getSubName(value, name) {
var getSubName = function getSubName(value, name) {
if (isSub(value)) {

@@ -401,3 +376,3 @@ var subName = getFunctionName(getConstructorOf(value));

var fmtNumber = function _fmtNumber(ctx, value) {
var fmtNumber = function fmtNumber(ctx, value) {
// Format -0 as '-0'.

@@ -407,3 +382,3 @@ return ctx.stylize(objectIs(value, -0) ? '-0' : numberToString(value), 'number');

var fmtPrimitiveReplacers = [[/^"|"$/g, ''], [/'/g, "\\'"], [/\\"/g, '"']];
var fmtPrimitiveReplacers = [[/^"|"$/g, EMPTY_STRING], [/'/g, "\\'"], [/\\"/g, '"']];

@@ -414,3 +389,3 @@ var fmtPrimitiveReplace = function _fmtPrimitiveReplace(acc, pair) {

var fmtPrimitive = function _fmtPrimitive(ctx, value) {
var fmtPrimitive = function fmtPrimitive(ctx, value) {
if (isNil(value)) {

@@ -443,3 +418,3 @@ var str = toStr(value);

var fmtPrimNoColor = function _fmtPrimNoColor(ctx, value) {
var fmtPrimNoColor = function fmtPrimNoColor(ctx, value) {
var stylize = ctx.stylize;

@@ -452,3 +427,3 @@ ctx.stylize = stylizeNoColor;

var recurse = function _recurse(depth) {
var recurse = function recurse(depth) {
return depth === null ? null : depth - 1;

@@ -467,3 +442,11 @@ };

var fmtProp = function _fmtProp(ctx, value, depth, visibleKeys, key, arr) {
var fmtProp = function fmtProp(args) {
var _args = _slicedToArray(args, 6),
ctx = _args[0],
value = _args[1],
depth = _args[2],
visibleKeys = _args[3],
key = _args[4],
arr = _args[5];
var desc = getOwnPropertyDescriptor(value, key) || {

@@ -502,3 +485,3 @@ value: value[key]

} else {
var formattedStr = fmtValue(ctx, desc.value, recurse(depth), key === 'prototype');
var formattedStr = $fmtValue([ctx, desc.value, recurse(depth), key === 'prototype']);

@@ -530,28 +513,36 @@ if (strIncludes(formattedStr, '\n')) {

var fmtObject = function _fmtObject(ctx, value, depth, visibleKeys, keys) {
return map(keys, function _mapFmObject(key) {
return fmtProp(ctx, value, depth, visibleKeys, key, false);
var fmtObject = function fmtObject(args) {
var _args2 = _slicedToArray(args, 5),
ctx = _args2[0],
value = _args2[1],
depth = _args2[2],
visibleKeys = _args2[3],
keys = _args2[4];
return map(keys, function mapFmObject(key) {
return fmtProp([ctx, value, depth, visibleKeys, key, false]);
});
};
var getMoreItemText = function _getMoreItemText(remaining) {
var getMoreItemText = function getMoreItemText(remaining) {
return "... ".concat(remaining, " more item").concat(pluralEnding(remaining));
};
var getEmptyItemText = function _getEmptyItemText(emptyItems) {
var getEmptyItemText = function getEmptyItemText(emptyItems) {
return "<".concat(emptyItems, " empty item").concat(pluralEnding(emptyItems), ">");
};
var filterOutIndexes = function _filterOutIndexes(keys) {
var _this3 = this;
return filter(keys, function (key) {
_newArrowCheck(this, _this3);
var filterOutIndexes = function filterOutIndexes(keys) {
return filter(keys, function predicate(key) {
return isSymbolType(key) || isDigits(key) === false;
}.bind(this));
});
};
var fmtArray = function _fmtArray(ctx, value, depth, visibleKeys, keys) {
var _this4 = this;
var fmtArray = function fmtArray(args) {
var _args3 = _slicedToArray(args, 5),
ctx = _args3[0],
value = _args3[1],
depth = _args3[2],
visibleKeys = _args3[3],
keys = _args3[4];

@@ -563,5 +554,3 @@ var length = value.length;

var output = [];
var moreItems = some(value, function (item, index) {
_newArrowCheck(this, _this4);
var moreItems = some(value, function predicate(item, index) {
if (index !== nextIndex) {

@@ -571,7 +560,7 @@ push(output, ctx.stylize(getEmptyItemText(index - lastIndex - 1), 'undefined'));

push(output, fmtProp(ctx, value, depth, visibleKeys, numberToString(index), true));
push(output, fmtProp([ctx, value, depth, visibleKeys, numberToString(index), true]));
lastIndex = index;
nextIndex = index + 1;
return nextIndex >= maxLength;
}.bind(this));
});
var remaining = length - nextIndex;

@@ -587,12 +576,15 @@

var fmtdProps = map(filterOutIndexes(keys), function (key) {
_newArrowCheck(this, _this4);
return fmtProp(ctx, value, depth, visibleKeys, key, true);
}.bind(this));
var fmtdProps = map(filterOutIndexes(keys), function iteratee(key) {
return fmtProp([ctx, value, depth, visibleKeys, key, true]);
});
return concat(output, fmtdProps);
};
var fmtTypedArray = function _fmtTypedArray(ctx, value, depth, visibleKeys, keys) {
var _this5 = this;
var fmtTypedArray = function fmtTypedArray(args) {
var _args4 = _slicedToArray(args, 5),
ctx = _args4[0],
value = _args4[1],
depth = _args4[2],
visibleKeys = _args4[3],
keys = _args4[4];

@@ -603,5 +595,3 @@ var length = value.length;

output.length = maxLength;
var moreItems = some(value, function (item, index) {
_newArrowCheck(this, _this5);
var moreItems = some(value, function predicate(item, index) {
if (index >= maxLength) {

@@ -613,3 +603,3 @@ return true;

return false;
}.bind(this));
});

@@ -620,42 +610,42 @@ if (moreItems) {

var fmtdProps = map(filterOutIndexes(keys), function (key) {
_newArrowCheck(this, _this5);
return fmtProp(ctx, value, depth, visibleKeys, key, true);
}.bind(this));
var fmtdProps = map(filterOutIndexes(keys), function iteratee(key) {
return fmtProp([ctx, value, depth, visibleKeys, key, true]);
});
return concat(output, fmtdProps);
};
var fmtSet = function _fmtSet(ctx, value, depth, visibleKeys, keys) {
var _this6 = this;
var fmtSet = function fmtSet(args) {
var _args5 = _slicedToArray(args, 5),
ctx = _args5[0],
value = _args5[1],
depth = _args5[2],
visibleKeys = _args5[3],
keys = _args5[4];
var output = [];
setForEach(value, function (v) {
_newArrowCheck(this, _this6);
push(output, fmtValue(ctx, v, recurse(depth)));
}.bind(this));
var fmtdProps = map(keys, function (key) {
_newArrowCheck(this, _this6);
return fmtProp(ctx, value, depth, visibleKeys, key, false);
}.bind(this));
setForEach(value, function iteratee(v) {
push(output, $fmtValue([ctx, v, recurse(depth)]));
});
var fmtdProps = map(keys, function iteratee(key) {
return fmtProp([ctx, value, depth, visibleKeys, key, false]);
});
return concat(output, fmtdProps);
};
var fmtMap = function _fmtMap(ctx, value, depth, visibleKeys, keys) {
var _this7 = this;
var fmtMap = function fmtMap(args) {
var _args6 = _slicedToArray(args, 5),
ctx = _args6[0],
value = _args6[1],
depth = _args6[2],
visibleKeys = _args6[3],
keys = _args6[4];
var r = recurse(depth);
var output = [];
mapForEach(value, function (v, k) {
_newArrowCheck(this, _this7);
push(output, "".concat(fmtValue(ctx, k, r), " => ").concat(fmtValue(ctx, v, r)));
}.bind(this));
var fmtdProps = map(keys, function (key) {
_newArrowCheck(this, _this7);
return fmtProp(ctx, value, depth, visibleKeys, key, false);
}.bind(this));
mapForEach(value, function iteratee(v, k) {
push(output, "".concat($fmtValue([ctx, k, r]), " => ").concat($fmtValue([ctx, v, r])));
});
var fmtdProps = map(keys, function iteratee(key) {
return fmtProp([ctx, value, depth, visibleKeys, key, false]);
});
return concat(output, fmtdProps);

@@ -669,7 +659,13 @@ };

var lengthReduce = function _lengthReduce(prev, cur) {
return prev + replace(cur, lengthReduceRx, '').length + 1;
var lengthReduce = function lengthReduce(prev, cur) {
return prev + replace(cur, lengthReduceRx, EMPTY_STRING).length + 1;
};
var reduceToSingleString = function _reduceToSingleString(out, base, braces, breakLength) {
var reduceToSingleString = function reduceToSingleString(args) {
var _args7 = _slicedToArray(args, 4),
out = _args7[0],
base = _args7[1],
braces = _args7[2],
breakLength = _args7[3];
var result;

@@ -681,3 +677,3 @@

// items will not line up correctly.
var layoutBase = base === '' && braces[0].length === 1 ? '' : "".concat(base, "\n ");
var layoutBase = base === EMPTY_STRING && braces[0].length === 1 ? EMPTY_STRING : "".concat(base, "\n ");
result = "".concat(braces[0] + layoutBase, " ").concat(join(out, ',\n '), " ").concat(braces[1]);

@@ -691,7 +687,7 @@ } else {

var fmtDate = function _fmtDate(value) {
var fmtDate = function fmtDate(value) {
return isNumberNaN(getTime(value)) ? 'Invalid Date' : toISOString(value);
};
var fmtError = function _fmtError(value) {
var fmtError = function fmtError(value) {
var stack = value.stack;

@@ -705,3 +701,3 @@

var msg = value.message;
return replace(stack, errorToString(value), subName + (msg ? ": ".concat(msg) : ''));
return replace(stack, errorToString(value), subName + (msg ? ": ".concat(msg) : EMPTY_STRING));
}

@@ -723,7 +719,11 @@ } else if (missingError) {

fmtValue = function _fmtValue(ctx, value, depth, isProto) {
var _this8 = this;
$fmtValue = function fmtValue(args) {
var _args8 = _slicedToArray(args, 4),
ctx = _args8[0],
value = _args8[1],
depth = _args8[2],
isProto = _args8[3]; // Provide a hook for user-specified inspect functions.
// Check that value is an object with an inspect function on it
// Provide a hook for user-specified inspect functions.
// Check that value is an object with an inspect function on it
if (ctx.customInspect && value) {

@@ -734,3 +734,3 @@ var maybeCustomInspect = value[customInspectSymbol] || value.inspect;

// Filter out the util module, its inspect function is special
if (maybeCustomInspect !== inspect) {
if (maybeCustomInspect !== $inspect) {
var _constructor2 = getConstructorOf(value); // Also filter out any prototype objects using the circular check.

@@ -746,3 +746,3 @@

if (ret !== value) {
return isStringType(ret) ? ret : fmtValue(ctx, ret, depth);
return isStringType(ret) ? ret : $fmtValue([ctx, ret, depth]);
}

@@ -766,13 +766,9 @@ }

if (shimmedDate && isDate(value)) {
visibleKeys = filter(visibleKeys, function (key) {
_newArrowCheck(this, _this8);
visibleKeys = filter(visibleKeys, function predicate(key) {
return key !== 'constructor';
}.bind(this));
});
} else if (errProps.length > 0 && isError(value)) {
visibleKeys = filter(visibleKeys, function (key) {
_newArrowCheck(this, _this8);
visibleKeys = filter(visibleKeys, function predicate(key) {
return arrayincludes(errProps, key) === false;
}.bind(this));
});
}

@@ -806,7 +802,5 @@ }

} else {
var enumSymbols = filter(getOwnPropertySymbols(value), function (key) {
_newArrowCheck(this, _this8);
var enumSymbols = filter(getOwnPropertySymbols(value), function predicate(key) {
return propertyIsEnumerable(value, key);
}.bind(this));
});
keys = concat(visibleKeys, enumSymbols);

@@ -900,3 +894,3 @@ }

var base = '';
var base = EMPTY_STRING;
var empty = false;

@@ -946,3 +940,3 @@ var braces = ['{', '}'];

name = name === 'Array' ? '' : name;
name = name === 'Array' ? EMPTY_STRING : name;
braces = ['[', ']'];

@@ -1005,3 +999,3 @@

name = name === 'Object' ? '' : name;
name = name === 'Object' ? EMPTY_STRING : name;
empty = true; // No other data than keys.

@@ -1040,8 +1034,8 @@ }

ctx.seen.add(value);
var out = fmtter(ctx, value, depth, visibleKeys, keys);
var out = fmtter([ctx, value, depth, visibleKeys, keys]);
ctx.seen.delete(value);
return reduceToSingleString(out, base, braces, ctx.breakLength);
return reduceToSingleString([out, base, braces, ctx.breakLength]);
};
inspect = function _inspect(obj, opts) {
$inspect = function inspect(obj, opts) {
// default options

@@ -1074,5 +1068,5 @@ var ctx = {

if (supportsGetSet) {
ctx = assign({}, inspect.defaultOptions, ctx, opts);
ctx = assign({}, $inspect.defaultOptions, ctx, opts);
} else {
ctx = assign({}, inspectDefaultOptions, inspect.defaultOptions, ctx, opts);
ctx = assign({}, inspectDefaultOptions, $inspect.defaultOptions, ctx, opts);
}

@@ -1088,7 +1082,7 @@

return fmtValue(ctx, obj, ctx.depth);
return $fmtValue([ctx, obj, ctx.depth]);
};
if (supportsGetSet) {
defineProperty(inspect, 'defaultOptions', {
defineProperty($inspect, 'defaultOptions', {
get: function _get() {

@@ -1106,3 +1100,3 @@ return inspectDefaultOptions;

} else {
defineProperties(inspect, {
defineProperties($inspect, {
defaultOptions: {

@@ -1115,3 +1109,3 @@ value: assign({}, inspectDefaultOptions),

defineProperties(inspect, {
defineProperties($inspect, {
// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics

@@ -1154,5 +1148,5 @@ colors: {

});
var ins = inspect;
var ins = $inspect;
export default ins;
//# sourceMappingURL=inspect-x.esm.js.map
{
"name": "inspect-x",
"version": "3.0.11",
"version": "3.0.12",
"description": "An implementation of node's ES6 inspect module.",

@@ -52,36 +52,36 @@ "homepage": "https://github.com/Xotic750/inspect-x",

"dependencies": {
"array-difference-x": "^3.0.13",
"array-every-x": "^3.0.19",
"array-filter-x": "^3.0.19",
"array-includes-x": "^3.0.16",
"array-intersection-x": "^3.0.13",
"array-map-x": "^3.0.20",
"array-reduce-x": "^3.0.15",
"array-slice-x": "^4.0.25",
"array-some-x": "^3.0.12",
"array-union-x": "^3.0.15",
"bind-x": "^4.0.13",
"collections-x": "^3.0.12",
"get-function-name-x": "^3.0.13",
"get-own-property-symbols-x": "^2.0.16",
"get-prototype-of-x": "^2.0.17",
"has-symbol-support-x": "^2.0.21",
"is-array-buffer-x": "^2.0.12",
"is-array-x": "^2.0.22",
"is-async-function-x": "^2.0.11",
"array-difference-x": "^3.0.14",
"array-every-x": "^3.0.20",
"array-filter-x": "^3.0.20",
"array-includes-x": "^3.0.17",
"array-intersection-x": "^3.0.14",
"array-map-x": "^3.0.21",
"array-reduce-x": "^3.0.16",
"array-slice-x": "^4.0.26",
"array-some-x": "^3.0.13",
"array-union-x": "^3.0.16",
"bind-x": "^4.0.14",
"collections-x": "^3.0.13",
"get-function-name-x": "^3.0.14",
"get-own-property-symbols-x": "^2.0.17",
"get-prototype-of-x": "^2.0.18",
"has-symbol-support-x": "^2.0.22",
"is-array-buffer-x": "^2.0.13",
"is-array-x": "^2.0.23",
"is-async-function-x": "^2.0.12",
"is-boolean-object": "^1.0.0",
"is-data-view-x": "^2.0.11",
"is-data-view-x": "^2.0.12",
"is-date-object": "^1.0.1",
"is-error-x": "^2.0.16",
"is-function-x": "^4.0.27",
"is-error-x": "^2.0.17",
"is-function-x": "^4.0.28",
"is-generator-function": "^1.0.7",
"is-map-x": "^2.0.12",
"is-map-x": "^2.0.13",
"is-nan": "^1.2.1",
"is-nil-x": "^2.0.25",
"is-nil-x": "^2.0.26",
"is-number-object": "^1.0.3",
"is-object-like-x": "^2.0.25",
"is-object-like-x": "^2.0.26",
"is-primitive": "^3.0.1",
"is-promise": "^2.1.0",
"is-regex": "^1.0.4",
"is-set-x": "^2.0.12",
"is-set-x": "^2.0.13",
"is-string": "^1.0.4",

@@ -91,17 +91,19 @@ "is-symbol": "^1.0.2",

"json3": "^3.3.3",
"math-clamp-x": "^3.0.22",
"object-assign-x": "^2.0.11",
"object-define-properties-x": "^5.0.13",
"object-define-property-x": "^5.0.16",
"object-get-own-property-descriptor-x": "^4.0.17",
"math-clamp-x": "^3.0.23",
"object-assign-x": "^2.0.12",
"object-define-properties-x": "^5.0.14",
"object-define-property-x": "^5.0.17",
"object-get-own-property-descriptor-x": "^4.0.18",
"object-is": "^1.0.1",
"object-keys-x": "^3.0.17",
"reflect-own-keys-x": "^3.0.10",
"require-object-coercible-x": "^2.0.26",
"string-includes-x": "^2.0.10",
"string-starts-with-x": "^2.0.11",
"to-integer-x": "^4.0.28",
"to-iso-string-x": "^2.0.10",
"to-string-x": "^2.0.34",
"white-space-x": "^4.0.23"
"object-keys-x": "^3.0.18",
"reflect-own-keys-x": "^3.0.11",
"require-object-coercible-x": "^2.0.27",
"string-includes-x": "^2.0.11",
"string-starts-with-x": "^2.0.12",
"to-boolean-x": "^2.0.25",
"to-integer-x": "^4.0.29",
"to-iso-string-x": "^2.0.11",
"to-object-x": "^2.0.21",
"to-string-x": "^2.0.35",
"white-space-x": "^4.0.24"
},

@@ -112,6 +114,2 @@ "devDependencies": {

"@babel/node": "^7.5.5",
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/plugin-syntax-export-default-from": "^7.2.0",
"@babel/plugin-syntax-export-namespace-from": "^7.2.0",
"@babel/plugin-transform-property-mutators": "^7.2.0",

@@ -121,5 +119,5 @@ "@babel/plugin-transform-runtime": "^7.5.5",

"@babel/runtime": "^7.5.5",
"@prorenata/eslint-config-vue": "^1.13.14",
"@types/jest": "^24.0.15",
"@types/jest": "^24.0.16",
"@types/node": "^12.6.8",
"@xotic750/eslint-config-recommended": "^1.0.5",
"babel-core": "^7.0.0-0",

@@ -129,9 +127,5 @@ "babel-eslint": "^10.0.2",

"babel-plugin-lodash": "^3.3.4",
"caniuse-lite": "^1.0.30000986",
"chalk": "^2.4.2",
"concurrently": "^4.1.1",
"caniuse-lite": "^1.0.30000988",
"cross-env": "^5.2.0",
"eslint": "=5.16.0",
"eslint-config-airbnb-base": "^13.2.0",
"eslint-config-prettier": "^6.0.0",
"eslint-friendly-formatter": "^4.0.1",

@@ -146,4 +140,4 @@ "eslint-import-resolver-webpack": "^0.11.1",

"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jest": "^22.14.0",
"eslint-plugin-jsdoc": "^15.7.2",
"eslint-plugin-jest": "^22.14.1",
"eslint-plugin-jsdoc": "^15.8.0",
"eslint-plugin-json": "^1.4.0",

@@ -157,23 +151,17 @@ "eslint-plugin-lodash": "^5.1.0",

"eslint-plugin-switch-case": "^1.1.2",
"eslint-plugin-vue": "^5.2.3",
"friendly-errors-webpack-plugin": "^1.7.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^24.8.0",
"jest-cli": "^24.8.0",
"jest-file": "^1.0.0",
"jsdoc-to-markdown": "^5.0.0",
"lodash": "^4.17.15",
"lodash-webpack-plugin": "^0.11.5",
"mkdirp": "^0.5.1",
"node-notifier": "^5.4.0",
"nodemon": "^1.19.1",
"prettier": "=1.14.3",
"prettier": "^1.18.2",
"rimraf": "^2.6.3",
"semver": "^6.3.0",
"source-map-loader": "^0.2.4",
"strip-ansi": "^5.2.0",
"terser-webpack-plugin": "^1.3.0",
"terser-webpack-plugin": "^1.4.1",
"typescript": "^3.5.3",
"webpack": "^4.38.0",
"webpack-bundle-analyzer": "^3.3.2",
"webpack-bundle-analyzer": "^3.4.1",
"webpack-cli": "^3.3.6",

@@ -180,0 +168,0 @@ "webpack-merge": "^4.2.1"

@@ -52,15 +52,9 @@ import bind from 'bind-x';

import union from 'array-union-x';
import toBoolean from 'to-boolean-x';
import toObject from 'to-object-x';
/** @type {RegExpConstructor} */
const EMPTY_ARRAY = [];
const RegExpCtr = /none/.constructor;
/** @type {BooleanConstructor} */
const NumberCtr = (0).constructor;
/** @type {ArrayConstructor} */
const ArrayCtr = [].constructor;
/** @type {StringConstructor} */
const StringCtr = ''.constructor;
/** @type {ObjectConstructor} */
const castObject = {}.constructor;
/** @type {BooleanConstructor} */
const castBoolean = true.constructor;
const EMPTY_STRING = '';
const EMPTY_OBJECT = {};
const {call} = isFunction;

@@ -72,20 +66,17 @@

const testSet = hasSet && new Set(['SetSentinel']);
const setForEach = hasSet && bind(call, testSet.forEach);
const setValues = hasSet && bind(call, testSet.values);
/* eslint-disable-next-line compat/compat */
const setForEach = hasSet && bind(call, Set.prototype.forEach);
/* eslint-disable-next-line compat/compat */
const setValues = hasSet && bind(call, Set.prototype.values);
/* eslint-disable-next-line compat/compat */
const hasMap = typeof Map === 'function' && isMap(new Map());
/* eslint-disable-next-line compat/compat */
const testMap = hasMap && new Map([[1, 'MapSentinel']]);
const mapForEach = hasMap && bind(call, testMap.forEach);
const mapValues = hasMap && bind(call, testMap.values);
/* eslint-disable-next-line compat/compat */
const mapForEach = hasMap && bind(call, Map.prototype.forEach);
/* eslint-disable-next-line compat/compat */
const mapValues = hasMap && bind(call, Map.prototype.values);
/* eslint-disable-next-line compat/compat */
const symbolToString = hasSymbolSupport && bind(call, Symbol.prototype.toString);
/* eslint-disable-next-line compat/compat */
const symbolValueOf = hasSymbolSupport && bind(call, Symbol.prototype.valueOf);
const objectSeal = isFunction(castObject.seal)
? castObject.seal
const oSeal = EMPTY_OBJECT.constructor.seal;
const objectSeal = isFunction(oSeal)
? oSeal
: function seal(value) {

@@ -98,11 +89,11 @@ return value;

const errorToString = bind(call, Error.prototype.toString);
const numberToString = bind(call, NumberCtr.prototype.toString);
const booleanToString = bind(call, castBoolean.prototype.toString);
const concat = bind(call, ArrayCtr.prototype.concat, []);
const join = bind(call, ArrayCtr.prototype.join);
const push = bind(call, ArrayCtr.prototype.push);
const numberToString = bind(call, (0).toString);
const booleanToString = bind(call, true.toString);
const concat = bind(call, EMPTY_ARRAY.concat, EMPTY_ARRAY);
const join = bind(call, EMPTY_ARRAY.join);
const push = bind(call, EMPTY_ARRAY.push);
const getTime = bind(call, Date.prototype.getTime);
const replace = bind(call, StringCtr.prototype.replace);
const strSlice = bind(call, StringCtr.prototype.slice);
const propertyIsEnumerable = bind(call, castObject.prototype.propertyIsEnumerable);
const replace = bind(call, EMPTY_STRING.replace);
const strSlice = bind(call, EMPTY_STRING.slice);
const propertyIsEnumerable = bind(call, EMPTY_OBJECT.propertyIsEnumerable);
/* eslint-disable-next-line compat/compat */

@@ -122,7 +113,7 @@ const customInspectSymbol = hasSymbolSupport ? Symbol('inspect.custom') : '_inspect.custom_';

*/
let inspect;
let fmtValue;
let $inspect;
let $fmtValue;
const isFalsey = function _isFalsey(value) {
return castBoolean(value) === false;
const isFalsey = function isFalsey(value) {
return toBoolean(value) === false;
};

@@ -139,3 +130,3 @@

const isClass = function _isClass(value) {
const isClass = function isClass(value) {
return supportsClasses ? isFunction(value, true) && isFunction(value) === false : false;

@@ -165,15 +156,15 @@ };

const pluralEnding = function _pluralEnding(number) {
return number > 1 ? 's' : '';
const pluralEnding = function pluralEnding(number) {
return number > 1 ? 's' : EMPTY_STRING;
};
const isDigits = function _isDigits(key) {
const isDigits = function isDigits(key) {
return regexpTest(/^\d+$/, key);
};
const appendMissing = function _appendMissing(array, values) {
const appendMissing = function appendMissing(array, values) {
return concat(array, difference(values, array));
};
const promote = function _promote(array, values) {
const promote = function promote(array, values) {
return concat(values, difference(array, values));

@@ -202,3 +193,3 @@ };

if (isDate(Date.prototype)) {
isDate = function _isDate(value) {
isDate = function $isDate(value) {
try {

@@ -221,3 +212,3 @@ getTime(value);

shimmedDate =
every(datePropsCheck, (prop) => {
every(datePropsCheck, function predicate(prop) {
return arrayincludes(dateProps, prop);

@@ -236,3 +227,3 @@ }) && arrayincludes(objectKeys(new Date()), 'constructor');

? slice(wantedFnProps)
: filter(wantedFnProps, (prop) => {
: filter(wantedFnProps, function predicate(prop) {
return prop !== 'name';

@@ -246,3 +237,3 @@ });

if (mustFilterFnProps === false) {
mustFilterFnProps = some(intersection(funcKeys, wantedFnProps), (key, index) => {
mustFilterFnProps = some(intersection(funcKeys, wantedFnProps), function predicate(key, index) {
return wantedFnProps[index] !== key;

@@ -262,19 +253,19 @@ });

const isBooleanType = function _isBooleanType(arg) {
const isBooleanType = function isBooleanType(arg) {
return typeof arg === 'boolean';
};
const isNumberType = function _isNumberType(arg) {
const isNumberType = function isNumberType(arg) {
return typeof arg === 'number';
};
const isStringType = function _isStringType(arg) {
const isStringType = function isStringType(arg) {
return typeof arg === 'string';
};
const isSymbolType = function _isSymbolType(arg) {
const isSymbolType = function isSymbolType(arg) {
return typeof arg === 'symbol';
};
const isMapIterator = function _isMapIterator(value) {
const isMapIterator = function isMapIterator(value) {
if (hasMap === false || isObjectLike(value) === false) {

@@ -293,3 +284,3 @@ return false;

const isSetIterator = function _isSetIterator(value) {
const isSetIterator = function isSetIterator(value) {
if (hasSet === false || isObjectLike(value) === false) {

@@ -308,4 +299,4 @@ return false;

const filterIndexes = function _filterIndexes(keys, length) {
return filter(keys, (key) => {
const filterIndexes = function filterIndexes(keys, length) {
return filter(keys, function predicate(key) {
return isSymbolType(key) || key < 0 || key > length || key % 1 !== 0;

@@ -315,7 +306,7 @@ });

const stylizeWithColor = function _stylizeWithColor(str, styleType) {
const style = inspect.styles[styleType];
const stylizeWithColor = function stylizeWithColor(str, styleType) {
const style = $inspect.styles[styleType];
if (style) {
const colors = inspect.colors[style];
const colors = $inspect.colors[style];

@@ -328,7 +319,7 @@ return `\u001b[${colors[0]}m${str}\u001b[${colors[1]}m`;

const stylizeNoColor = function _stylizeNoColor(str) {
const stylizeNoColor = function stylizeNoColor(str) {
return str;
};
const getNameSep = function _getNameSep(obj) {
const getNameSep = function getNameSep(obj) {
const name = getFunctionName(obj);

@@ -339,7 +330,7 @@

const getConstructorOf = function _getConstructorOf(obj) {
const getConstructorOf = function getConstructorOf(obj) {
let o = obj;
let maxLoop = 100;
while (isNil(o) === false && maxLoop >= 0) {
o = castObject(o);
o = toObject(o);
const descriptor = getOwnPropertyDescriptor(o, 'constructor');

@@ -358,3 +349,3 @@

const isSub = function _isSub(value) {
const isSub = function isSub(value) {
if (supportsClasses !== true || isPrimitive(value)) {

@@ -369,3 +360,3 @@ return false;

const getSubName = function _getSubName(value, name) {
const getSubName = function getSubName(value, name) {
if (isSub(value)) {

@@ -382,3 +373,3 @@ const subName = getFunctionName(getConstructorOf(value));

const fmtNumber = function _fmtNumber(ctx, value) {
const fmtNumber = function fmtNumber(ctx, value) {
// Format -0 as '-0'.

@@ -388,3 +379,3 @@ return ctx.stylize(objectIs(value, -0) ? '-0' : numberToString(value), 'number');

const fmtPrimitiveReplacers = [[/^"|"$/g, ''], [/'/g, "\\'"], [/\\"/g, '"']];
const fmtPrimitiveReplacers = [[/^"|"$/g, EMPTY_STRING], [/'/g, "\\'"], [/\\"/g, '"']];

@@ -395,3 +386,3 @@ const fmtPrimitiveReplace = function _fmtPrimitiveReplace(acc, pair) {

const fmtPrimitive = function _fmtPrimitive(ctx, value) {
const fmtPrimitive = function fmtPrimitive(ctx, value) {
if (isNil(value)) {

@@ -424,3 +415,3 @@ const str = toStr(value);

const fmtPrimNoColor = function _fmtPrimNoColor(ctx, value) {
const fmtPrimNoColor = function fmtPrimNoColor(ctx, value) {
const {stylize} = ctx;

@@ -434,3 +425,3 @@ ctx.stylize = stylizeNoColor;

const recurse = function _recurse(depth) {
const recurse = function recurse(depth) {
return depth === null ? null : depth - 1;

@@ -449,3 +440,4 @@ };

const fmtProp = function _fmtProp(ctx, value, depth, visibleKeys, key, arr) {
const fmtProp = function fmtProp(args) {
const [ctx, value, depth, visibleKeys, key, arr] = args;
const desc = getOwnPropertyDescriptor(value, key) || {value: value[key]};

@@ -483,3 +475,3 @@

} else {
const formattedStr = fmtValue(ctx, desc.value, recurse(depth), key === 'prototype');
const formattedStr = $fmtValue([ctx, desc.value, recurse(depth), key === 'prototype']);

@@ -511,18 +503,20 @@ if (strIncludes(formattedStr, '\n')) {

const fmtObject = function _fmtObject(ctx, value, depth, visibleKeys, keys) {
return map(keys, function _mapFmObject(key) {
return fmtProp(ctx, value, depth, visibleKeys, key, false);
const fmtObject = function fmtObject(args) {
const [ctx, value, depth, visibleKeys, keys] = args;
return map(keys, function mapFmObject(key) {
return fmtProp([ctx, value, depth, visibleKeys, key, false]);
});
};
const getMoreItemText = function _getMoreItemText(remaining) {
const getMoreItemText = function getMoreItemText(remaining) {
return `... ${remaining} more item${pluralEnding(remaining)}`;
};
const getEmptyItemText = function _getEmptyItemText(emptyItems) {
const getEmptyItemText = function getEmptyItemText(emptyItems) {
return `<${emptyItems} empty item${pluralEnding(emptyItems)}>`;
};
const filterOutIndexes = function _filterOutIndexes(keys) {
return filter(keys, (key) => {
const filterOutIndexes = function filterOutIndexes(keys) {
return filter(keys, function predicate(key) {
return isSymbolType(key) || isDigits(key) === false;

@@ -532,3 +526,4 @@ });

const fmtArray = function _fmtArray(ctx, value, depth, visibleKeys, keys) {
const fmtArray = function fmtArray(args) {
const [ctx, value, depth, visibleKeys, keys] = args;
const {length} = value;

@@ -540,3 +535,3 @@ const maxLength = clamp(length, 0, ctx.maxArrayLength);

const moreItems = some(value, (item, index) => {
const moreItems = some(value, function predicate(item, index) {
if (index !== nextIndex) {

@@ -546,3 +541,3 @@ push(output, ctx.stylize(getEmptyItemText(index - lastIndex - 1), 'undefined'));

push(output, fmtProp(ctx, value, depth, visibleKeys, numberToString(index), true));
push(output, fmtProp([ctx, value, depth, visibleKeys, numberToString(index), true]));
lastIndex = index;

@@ -564,4 +559,4 @@ nextIndex = index + 1;

const fmtdProps = map(filterOutIndexes(keys), (key) => {
return fmtProp(ctx, value, depth, visibleKeys, key, true);
const fmtdProps = map(filterOutIndexes(keys), function iteratee(key) {
return fmtProp([ctx, value, depth, visibleKeys, key, true]);
});

@@ -572,3 +567,4 @@

const fmtTypedArray = function _fmtTypedArray(ctx, value, depth, visibleKeys, keys) {
const fmtTypedArray = function fmtTypedArray(args) {
const [ctx, value, depth, visibleKeys, keys] = args;
const {length} = value;

@@ -578,3 +574,3 @@ const maxLength = clamp(length, 0, ctx.maxArrayLength);

output.length = maxLength;
const moreItems = some(value, (item, index) => {
const moreItems = some(value, function predicate(item, index) {
if (index >= maxLength) {

@@ -593,4 +589,4 @@ return true;

const fmtdProps = map(filterOutIndexes(keys), (key) => {
return fmtProp(ctx, value, depth, visibleKeys, key, true);
const fmtdProps = map(filterOutIndexes(keys), function iteratee(key) {
return fmtProp([ctx, value, depth, visibleKeys, key, true]);
});

@@ -601,10 +597,11 @@

const fmtSet = function _fmtSet(ctx, value, depth, visibleKeys, keys) {
const fmtSet = function fmtSet(args) {
const [ctx, value, depth, visibleKeys, keys] = args;
const output = [];
setForEach(value, (v) => {
push(output, fmtValue(ctx, v, recurse(depth)));
setForEach(value, function iteratee(v) {
push(output, $fmtValue([ctx, v, recurse(depth)]));
});
const fmtdProps = map(keys, (key) => {
return fmtProp(ctx, value, depth, visibleKeys, key, false);
const fmtdProps = map(keys, function iteratee(key) {
return fmtProp([ctx, value, depth, visibleKeys, key, false]);
});

@@ -615,11 +612,12 @@

const fmtMap = function _fmtMap(ctx, value, depth, visibleKeys, keys) {
const fmtMap = function fmtMap(args) {
const [ctx, value, depth, visibleKeys, keys] = args;
const r = recurse(depth);
const output = [];
mapForEach(value, (v, k) => {
push(output, `${fmtValue(ctx, k, r)} => ${fmtValue(ctx, v, r)}`);
mapForEach(value, function iteratee(v, k) {
push(output, `${$fmtValue([ctx, k, r])} => ${$fmtValue([ctx, v, r])}`);
});
const fmtdProps = map(keys, (key) => {
return fmtProp(ctx, value, depth, visibleKeys, key, false);
const fmtdProps = map(keys, function iteratee(key) {
return fmtProp([ctx, value, depth, visibleKeys, key, false]);
});

@@ -634,7 +632,8 @@

const lengthReduce = function _lengthReduce(prev, cur) {
return prev + replace(cur, lengthReduceRx, '').length + 1;
const lengthReduce = function lengthReduce(prev, cur) {
return prev + replace(cur, lengthReduceRx, EMPTY_STRING).length + 1;
};
const reduceToSingleString = function _reduceToSingleString(out, base, braces, breakLength) {
const reduceToSingleString = function reduceToSingleString(args) {
const [out, base, braces, breakLength] = args;
let result;

@@ -646,3 +645,3 @@

// items will not line up correctly.
const layoutBase = base === '' && braces[0].length === 1 ? '' : `${base}\n `;
const layoutBase = base === EMPTY_STRING && braces[0].length === 1 ? EMPTY_STRING : `${base}\n `;
result = `${braces[0] + layoutBase} ${join(out, ',\n ')} ${braces[1]}`;

@@ -656,7 +655,7 @@ } else {

const fmtDate = function _fmtDate(value) {
const fmtDate = function fmtDate(value) {
return isNumberNaN(getTime(value)) ? 'Invalid Date' : toISOString(value);
};
const fmtError = function _fmtError(value) {
const fmtError = function fmtError(value) {
const {stack} = value;

@@ -671,3 +670,3 @@

return replace(stack, errorToString(value), subName + (msg ? `: ${msg}` : ''));
return replace(stack, errorToString(value), subName + (msg ? `: ${msg}` : EMPTY_STRING));
}

@@ -691,3 +690,5 @@ } else if (missingError) {

fmtValue = function _fmtValue(ctx, value, depth, isProto) {
$fmtValue = function fmtValue(args) {
const [ctx, value, depth, isProto] = args;
// Provide a hook for user-specified inspect functions.

@@ -700,3 +701,3 @@ // Check that value is an object with an inspect function on it

// Filter out the util module, its inspect function is special
if (maybeCustomInspect !== inspect) {
if (maybeCustomInspect !== $inspect) {
const constructor = getConstructorOf(value);

@@ -712,3 +713,3 @@ // Also filter out any prototype objects using the circular check.

if (ret !== value) {
return isStringType(ret) ? ret : fmtValue(ctx, ret, depth);
return isStringType(ret) ? ret : $fmtValue([ctx, ret, depth]);
}

@@ -732,7 +733,7 @@ }

if (shimmedDate && isDate(value)) {
visibleKeys = filter(visibleKeys, (key) => {
visibleKeys = filter(visibleKeys, function predicate(key) {
return key !== 'constructor';
});
} else if (errProps.length > 0 && isError(value)) {
visibleKeys = filter(visibleKeys, (key) => {
visibleKeys = filter(visibleKeys, function predicate(key) {
return arrayincludes(errProps, key) === false;

@@ -768,3 +769,3 @@ });

} else {
const enumSymbols = filter(getOwnPropertySymbols(value), (key) => {
const enumSymbols = filter(getOwnPropertySymbols(value), function predicate(key) {
return propertyIsEnumerable(value, key);

@@ -862,3 +863,3 @@ });

let base = '';
let base = EMPTY_STRING;
let empty = false;

@@ -909,3 +910,3 @@ let braces = ['{', '}'];

// Unset the constructor to prevent "Array [...]" for ordinary arrays.
name = name === 'Array' ? '' : name;
name = name === 'Array' ? EMPTY_STRING : name;
braces = ['[', ']'];

@@ -970,3 +971,3 @@

// Unset the constructor to prevent "Object {...}" for ordinary objects.
name = name === 'Object' ? '' : name;
name = name === 'Object' ? EMPTY_STRING : name;
empty = true; // No other data than keys.

@@ -1005,9 +1006,9 @@ }

ctx.seen.add(value);
const out = fmtter(ctx, value, depth, visibleKeys, keys);
const out = fmtter([ctx, value, depth, visibleKeys, keys]);
ctx.seen.delete(value);
return reduceToSingleString(out, base, braces, ctx.breakLength);
return reduceToSingleString([out, base, braces, ctx.breakLength]);
};
inspect = function _inspect(obj, opts) {
$inspect = function inspect(obj, opts) {
// default options

@@ -1039,5 +1040,5 @@ let ctx = {

if (supportsGetSet) {
ctx = assign({}, inspect.defaultOptions, ctx, opts);
ctx = assign({}, $inspect.defaultOptions, ctx, opts);
} else {
ctx = assign({}, inspectDefaultOptions, inspect.defaultOptions, ctx, opts);
ctx = assign({}, inspectDefaultOptions, $inspect.defaultOptions, ctx, opts);
}

@@ -1053,7 +1054,7 @@

return fmtValue(ctx, obj, ctx.depth);
return $fmtValue([ctx, obj, ctx.depth]);
};
if (supportsGetSet) {
defineProperty(inspect, 'defaultOptions', {
defineProperty($inspect, 'defaultOptions', {
get: function _get() {

@@ -1071,3 +1072,3 @@ return inspectDefaultOptions;

} else {
defineProperties(inspect, {
defineProperties($inspect, {
defaultOptions: {

@@ -1080,3 +1081,3 @@ value: assign({}, inspectDefaultOptions),

defineProperties(inspect, {
defineProperties($inspect, {
// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics

@@ -1120,4 +1121,4 @@ colors: {

const ins = inspect;
const ins = $inspect;
export default ins;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc