(s: string)
| 648 | } |
| 649 | |
| 650 | function splitTopLevelCommasMulti(s: string): string[] { |
| 651 | const parts: string[] = []; |
| 652 | let depth = 0; |
| 653 | let start = 0; |
| 654 | for (let i = 0; i < s.length; i++) { |
| 655 | const c = s[i]; |
| 656 | if (c === "(" || c === "[" || c === "{") depth++; |
| 657 | else if (c === ")" || c === "]" || c === "}") depth--; |
| 658 | else if (c === "," && depth === 0) { |
| 659 | parts.push(s.slice(start, i)); |
| 660 | start = i + 1; |
| 661 | } |
| 662 | } |
| 663 | parts.push(s.slice(start)); |
| 664 | return parts.filter((p) => p.trim().length > 0); |
| 665 | } |
| 666 | |
| 667 | function ensureClassVarImport(code: string): string { |
| 668 | // Already imported? |
no test coverage detected
searching dependent graphs…