( modules: ReadonlyMap<string, SourceModule>, program: Pick<FlatProgram, "entries" | "resolve">, skipped?: ReadonlyMap<SourceModule, readonly Creation[]> )
| 314 | } |
| 315 | |
| 316 | const keptCodeOf = ( |
| 317 | modules: ReadonlyMap<string, SourceModule>, |
| 318 | program: Pick<FlatProgram, "entries" | "resolve">, |
| 319 | skipped?: ReadonlyMap<SourceModule, readonly Creation[]> |
| 320 | ): KeptCode => { |
| 321 | const kept = new KeptCode(modules, program.resolve, skipped) |
| 322 | for (const module of modules.values()) kept.keepRead(module) |
| 323 | for (const id of program.entries) { |
| 324 | const entry = modules.get(id) |
| 325 | if (entry) kept.keepExports(entry) |
| 326 | } |
| 327 | return kept |
| 328 | } |
| 329 | |
| 330 | // a site importing what it creates from the flat module, without the |
| 331 | // annotations on what it kept |
no test coverage detected