( key: string, entries: ScanEntry[], host: Omit<ScanHost<ScanResolution>, "load"> )
| 56 | |
| 57 | // as scanProgram, resolving each specifier as it's read, as --check does |
| 58 | export const scanProgramSync = ( |
| 59 | key: string, |
| 60 | entries: ScanEntry[], |
| 61 | host: Omit<ScanHost<ScanResolution>, "load"> |
| 62 | ): ScannedProgram | string => { |
| 63 | const steps = programSteps(key, entries, host) |
| 64 | let step = steps.next() |
| 65 | while (!step.done) { |
| 66 | const [kind, requests] = step.value |
| 67 | step = steps.next( |
| 68 | kind === "load" ? [] : requests.map(request => host.resolve(...request)) |
| 69 | ) |
| 70 | } |
| 71 | return step.value |
| 72 | } |
| 73 | |
| 74 | type ImportRequest = [specifier: string, importer: string, kind: ImportKind] |
| 75 |
no test coverage detected