MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / inspect

Function inspect

lib/web/jshint.js:924–947  ·  view source on GitHub ↗
(obj, opts)

Source from the content-addressed store, hash-verified

922 */
923/* legacy: obj, showHidden, depth, colors*/
924function inspect(obj, opts) {
925 // default options
926 var ctx = {
927 seen: [],
928 stylize: stylizeNoColor
929 };
930 // legacy...
931 if (arguments.length >= 3) ctx.depth = arguments[2];
932 if (arguments.length >= 4) ctx.colors = arguments[3];
933 if (isBoolean(opts)) {
934 // legacy...
935 ctx.showHidden = opts;
936 } else if (opts) {
937 // got an "options" object
938 exports._extend(ctx, opts);
939 }
940 // set default options
941 if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
942 if (isUndefined(ctx.depth)) ctx.depth = 2;
943 if (isUndefined(ctx.colors)) ctx.colors = false;
944 if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
945 if (ctx.colors) ctx.stylize = stylizeWithColor;
946 return formatValue(ctx, obj, ctx.depth);
947}
948exports.inspect = inspect;
949
950

Callers 1

jshint.jsFile · 0.85

Calls 3

isBooleanFunction · 0.85
isUndefinedFunction · 0.85
formatValueFunction · 0.85

Tested by

no test coverage detected