(ctx, value)
| 10915 | } |
| 10916 | |
| 10917 | function formatPrimitive(ctx, value) { |
| 10918 | if (isUndefined(value)) return ctx.stylize('undefined', 'undefined'); |
| 10919 | if (isString(value)) { |
| 10920 | var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '').replace(/'/g, "\\'").replace(/\\"/g, '"') + '\''; |
| 10921 | return ctx.stylize(simple, 'string'); |
| 10922 | } |
| 10923 | if (isNumber(value)) return ctx.stylize('' + value, 'number'); |
| 10924 | if (isBoolean(value)) return ctx.stylize('' + value, 'boolean'); |
| 10925 | // For some reason typeof null is "object", so special case here. |
| 10926 | if (isNull(value)) return ctx.stylize('null', 'null'); |
| 10927 | } |
| 10928 | |
| 10929 | function formatError(value) { |
| 10930 | return '[' + Error.prototype.toString.call(value) + ']'; |
no test coverage detected