(obj, opts)
| 29610 | */ |
| 29611 | /* legacy: obj, showHidden, depth, colors*/ |
| 29612 | function inspect(obj, opts) { |
| 29613 | // default options |
| 29614 | var ctx = { |
| 29615 | seen: [], |
| 29616 | stylize: stylizeNoColor |
| 29617 | }; |
| 29618 | // legacy... |
| 29619 | if (arguments.length >= 3) ctx.depth = arguments[2]; |
| 29620 | if (arguments.length >= 4) ctx.colors = arguments[3]; |
| 29621 | if (isBoolean(opts)) { |
| 29622 | // legacy... |
| 29623 | ctx.showHidden = opts; |
| 29624 | } else if (opts) { |
| 29625 | // got an "options" object |
| 29626 | exports._extend(ctx, opts); |
| 29627 | } |
| 29628 | // set default options |
| 29629 | if (isUndefined(ctx.showHidden)) ctx.showHidden = false; |
| 29630 | if (isUndefined(ctx.depth)) ctx.depth = 2; |
| 29631 | if (isUndefined(ctx.colors)) ctx.colors = false; |
| 29632 | if (isUndefined(ctx.customInspect)) ctx.customInspect = true; |
| 29633 | if (ctx.colors) ctx.stylize = stylizeWithColor; |
| 29634 | return formatValue(ctx, obj, ctx.depth); |
| 29635 | } |
| 29636 | exports.inspect = inspect; |
| 29637 | |
| 29638 |
no test coverage detected