(...keyValues: [Name | string, SafeExpr | string][])
| 549 | |
| 550 | // returns code for object literal for the passed argument list of key-value pairs |
| 551 | object(...keyValues: [Name | string, SafeExpr | string][]): _Code { |
| 552 | const code: CodeItem[] = ["{"] |
| 553 | for (const [key, value] of keyValues) { |
| 554 | if (code.length > 1) code.push(",") |
| 555 | code.push(key) |
| 556 | if (key !== value || this.opts.es5) { |
| 557 | code.push(":") |
| 558 | addCodeArg(code, value) |
| 559 | } |
| 560 | } |
| 561 | code.push("}") |
| 562 | return new _Code(code) |
| 563 | } |
| 564 | |
| 565 | // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed) |
| 566 | if(condition: Code | boolean, thenBody?: Block, elseBody?: Block): CodeGen { |
no test coverage detected