* A simplistic implementation of Node's `util.format()`
(obj, indent)
| 90 | * A simplistic implementation of Node's `util.format()` |
| 91 | */ |
| 92 | function prettyPrint (obj, indent) { |
| 93 | let json = "{\n"; |
| 94 | |
| 95 | // eslint-disable-next-line guard-for-in |
| 96 | for (let key in obj) { |
| 97 | json += `${indent} ${key}: ${prettyPrintValue(obj[key], indent)}\n`; |
| 98 | } |
| 99 | |
| 100 | for (let sym of Object.getOwnPropertySymbols(obj)) { |
| 101 | json += `${indent} [${String(sym)}]: ${prettyPrintValue(obj[sym], indent)}\n`; |
| 102 | } |
| 103 | |
| 104 | json += `${indent}}\n`; |
| 105 | return json; |
| 106 | } |
| 107 | |
| 108 | function prettyPrintValue (value, indent) { |
| 109 | let type = typeof value; |
no test coverage detected
searching dependent graphs…