(value: Primitive)
| 225 | } |
| 226 | |
| 227 | function primitiveToString(value: Primitive): string { |
| 228 | if (Array.isArray(value)) { |
| 229 | return value.map(primitiveToString).join("") |
| 230 | } |
| 231 | |
| 232 | switch (typeof value) { |
| 233 | case "string": { |
| 234 | return value |
| 235 | } |
| 236 | case "number": |
| 237 | case "bigint": { |
| 238 | return value.toString() |
| 239 | } |
| 240 | case "boolean": { |
| 241 | return value ? "true" : "false" |
| 242 | } |
| 243 | default: { |
| 244 | return "" |
| 245 | } |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | function consolidate( |
| 250 | strings: ReadonlyArray<string>, |