(abs: string)
| 170 | }; |
| 171 | /** A file's text, once, for the directive and declaration reads; null past the size cap or unreadable. */ |
| 172 | const readText = (abs: string): string | null => { |
| 173 | let text = texts.get(abs); |
| 174 | if (text === undefined) { |
| 175 | try { |
| 176 | text = fs.statSync(abs).size <= MAX_DIRECTIVE_FILE ? fs.readFileSync(abs, 'utf8') : null; |
| 177 | } catch { |
| 178 | text = null; |
| 179 | } |
| 180 | texts.set(abs, text); |
| 181 | } |
| 182 | return text; |
| 183 | }; |
| 184 | // Named rather than a method, because `createWhenReader` hands `when` out |
| 185 | // detached: it must not depend on `this`. |
| 186 | const guards = async ( |
no test coverage detected