(obj: SimpleObject)
| 283 | } |
| 284 | |
| 285 | function codegenSimpleObject(obj: SimpleObject): string { |
| 286 | if (obj.length === 0) return '{}' |
| 287 | return `{ ${obj |
| 288 | .map(({ key, value }) => { |
| 289 | return `${key}: ${typeof value === 'string' ? value : codegenSimpleObject(value as SimpleObject)}` |
| 290 | }) |
| 291 | .join(', ')} }` |
| 292 | } |
| 293 | |
| 294 | const VALID_JS_IDENTIFIER = /^[$_\p{ID_Start}][$\p{ID_Continue}]*$/u |
| 295 |