(obj, opts)
| 7810 | |
| 7811 | |
| 7812 | function 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 | |
| 7839 | exports.inspect = inspect; // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics |
| 7840 |
no test coverage detected