(
caller: { filePath: string; language: Language },
site: { line?: number; column?: number }
)
| 164 | // Named rather than a method, because `createWhenReader` hands `when` out |
| 165 | // detached: it must not depend on `this`. |
| 166 | const guards = async ( |
| 167 | caller: { filePath: string; language: Language }, |
| 168 | site: { line?: number; column?: number } |
| 169 | ): Promise<BranchGuard[]> => { |
| 170 | if (!site.line || sites >= maxSites || !supportsBranchGuards(caller.language)) return []; |
| 171 | const file = resolve(caller); |
| 172 | if (!file) return []; |
| 173 | sites++; |
| 174 | const key = { line: site.line, column: typeof site.column === 'number' ? site.column : null }; |
| 175 | return (await guardsForFile(file.abs, file.language, [key])).get(siteKey(key)) ?? []; |
| 176 | }; |
| 177 | return { |
| 178 | guards, |
| 179 | async when(caller, site) { |
no test coverage detected