MCPcopy
hub / github.com/microsoft/SandDance / inspect

Function inspect

docs/tests/v2/es6/js/sanddance.js:7812–7837  ·  view source on GitHub ↗
(obj, opts)

Source from the content-addressed store, hash-verified

7810
7811
7812function inspect(obj, opts) {
7813 // default options
7814 var ctx = {
7815 seen: [],
7816 stylize: stylizeNoColor
7817 }; // legacy...
7818
7819 if (arguments.length >= 3) ctx.depth = arguments[2];
7820 if (arguments.length >= 4) ctx.colors = arguments[3];
7821
7822 if (isBoolean(opts)) {
7823 // legacy...
7824 ctx.showHidden = opts;
7825 } else if (opts) {
7826 // got an "options" object
7827 exports._extend(ctx, opts);
7828 } // set default options
7829
7830
7831 if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
7832 if (isUndefined(ctx.depth)) ctx.depth = 2;
7833 if (isUndefined(ctx.colors)) ctx.colors = false;
7834 if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
7835 if (ctx.colors) ctx.stylize = stylizeWithColor;
7836 return formatValue(ctx, obj, ctx.depth);
7837}
7838
7839exports.inspect = inspect; // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
7840

Callers 2

sanddance.jsFile · 0.85
getMessageFunction · 0.85

Calls 4

isUndefinedFunction · 0.85
getNameFunction · 0.85
isBooleanFunction · 0.70
formatValueFunction · 0.70

Tested by

no test coverage detected