( uses: Array<SpecifierUse>, specifier: string, names: Set<string> | undefined, )
| 112 | } |
| 113 | |
| 114 | function mergeUse( |
| 115 | uses: Array<SpecifierUse>, |
| 116 | specifier: string, |
| 117 | names: Set<string> | undefined, |
| 118 | ) { |
| 119 | const existing = uses.find((use) => use.specifier === specifier) |
| 120 | if (!existing) { |
| 121 | uses.push({ specifier, ...(names ? { names } : {}) }) |
| 122 | return |
| 123 | } |
| 124 | if (!names || !existing.names) { |
| 125 | delete existing.names |
| 126 | return |
| 127 | } |
| 128 | for (const name of names) existing.names.add(name) |
| 129 | } |
| 130 | |
| 131 | function importUses(source: string): Array<SpecifierUse> { |
| 132 | const parseSource = stripComments(source) |
no test coverage detected