(evaluate: () => A, orElse: A)
| 167 | // --------------------------------------------------------------------------- |
| 168 | |
| 169 | const tryOrElse = <A>(evaluate: () => A, orElse: A): A => { |
| 170 | // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: every fs read here is best-effort; a missing or unreadable entry is "not discoverable", not an error |
| 171 | try { |
| 172 | return evaluate(); |
| 173 | } catch { |
| 174 | return orElse; |
| 175 | } |
| 176 | }; |
| 177 | |
| 178 | const listDirs = (dir: string): readonly string[] => |
| 179 | tryOrElse( |
no test coverage detected