(info: unknown, options: Options)
| 49 | } |
| 50 | |
| 51 | function strInfo(info: unknown, options: Options): string | undefined { |
| 52 | if (info === undefined) { |
| 53 | return undefined |
| 54 | } |
| 55 | |
| 56 | let str = '\n' |
| 57 | |
| 58 | if (typeof info === 'string') { |
| 59 | str += info |
| 60 | } else if (Array.isArray(info)) { |
| 61 | if (info.length === 0) { |
| 62 | str += options.serialization?.emptyArray ?? '[]' |
| 63 | } else { |
| 64 | str += info.map(strUnknown).join('\n') |
| 65 | } |
| 66 | } else { |
| 67 | str += strUnknown(info) |
| 68 | } |
| 69 | |
| 70 | str = pad(str) |
| 71 | |
| 72 | return str |
| 73 | } |
| 74 | |
| 75 | function pad(str: string): string { |
| 76 | const PADDING = ' ' |
no test coverage detected
searching dependent graphs…