(ctx, value)
| 29809 | |
| 29810 | |
| 29811 | function formatPrimitive(ctx, value) { |
| 29812 | if (isUndefined(value)) |
| 29813 | return ctx.stylize('undefined', 'undefined'); |
| 29814 | if (isString(value)) { |
| 29815 | var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') |
| 29816 | .replace(/'/g, "\\'") |
| 29817 | .replace(/\\"/g, '"') + '\''; |
| 29818 | return ctx.stylize(simple, 'string'); |
| 29819 | } |
| 29820 | if (isNumber(value)) |
| 29821 | return ctx.stylize('' + value, 'number'); |
| 29822 | if (isBoolean(value)) |
| 29823 | return ctx.stylize('' + value, 'boolean'); |
| 29824 | // For some reason typeof null is "object", so special case here. |
| 29825 | if (isNull(value)) |
| 29826 | return ctx.stylize('null', 'null'); |
| 29827 | } |
| 29828 | |
| 29829 | |
| 29830 | function formatError(value) { |
no test coverage detected