(ctx, value)
| 8002 | } |
| 8003 | |
| 8004 | function formatPrimitive(ctx, value) { |
| 8005 | if (isUndefined(value)) return ctx.stylize('undefined', 'undefined'); |
| 8006 | |
| 8007 | if (isString(value)) { |
| 8008 | var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '').replace(/'/g, "\\'").replace(/\\"/g, '"') + '\''; |
| 8009 | return ctx.stylize(simple, 'string'); |
| 8010 | } |
| 8011 | |
| 8012 | if (isNumber(value)) return ctx.stylize('' + value, 'number'); |
| 8013 | if (isBoolean(value)) return ctx.stylize('' + value, 'boolean'); // For some reason typeof null is "object", so special case here. |
| 8014 | |
| 8015 | if (isNull(value)) return ctx.stylize('null', 'null'); |
| 8016 | } |
| 8017 | |
| 8018 | function formatError(value) { |
| 8019 | return '[' + Error.prototype.toString.call(value) + ']'; |
no test coverage detected