(value: unknown)
| 168 | } |
| 169 | |
| 170 | function formatValue(value: unknown): string { |
| 171 | if (value === undefined) { |
| 172 | return ""; |
| 173 | } |
| 174 | |
| 175 | if (value === null) { |
| 176 | return "null"; |
| 177 | } |
| 178 | |
| 179 | if (typeof value === "string") { |
| 180 | return value; |
| 181 | } |
| 182 | |
| 183 | if (typeof value === "number" || typeof value === "bigint") { |
| 184 | return value.toString(); |
| 185 | } |
| 186 | |
| 187 | if (typeof value === "boolean") { |
| 188 | return value ? "true" : "false"; |
| 189 | } |
| 190 | |
| 191 | if (Array.isArray(value)) { |
| 192 | if (value.length === 0) { |
| 193 | return "[]"; |
| 194 | } |
| 195 | return value.map((item) => formatValue(item)).join(", "); |
| 196 | } |
| 197 | |
| 198 | return JSON.stringify(value); |
| 199 | } |
| 200 | |
| 201 | function getCommandPath( |
| 202 | rootName: string, |
no test coverage detected
searching dependent graphs…