(fns: CodeGenFunction[], sectionTitle?: string)
| 44 | } |
| 45 | |
| 46 | addFunctions(fns: CodeGenFunction[], sectionTitle?: string) { |
| 47 | if (!fns.length) return; |
| 48 | this.functions.push(...fns); |
| 49 | const code: ArrayJoinInput<string>[] = []; |
| 50 | for (const fn of fns) { |
| 51 | code.push('', ...generateFunctionCode(fn)) |
| 52 | } |
| 53 | if (sectionTitle) { |
| 54 | this.addSection(sectionTitle, code); |
| 55 | } else { |
| 56 | this.code.push(...code) |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | clearCode() { |
| 61 | this.code = []; |
no test coverage detected