(evaluate: () => A, orElse: A)
| 168 | // --------------------------------------------------------------------------- |
| 169 | |
| 170 | const tryOrElse = <A>(evaluate: () => A, orElse: A): A => { |
| 171 | // 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 |
| 172 | try { |
| 173 | return evaluate(); |
| 174 | } catch { |
| 175 | return orElse; |
| 176 | } |
| 177 | }; |
| 178 | |
| 179 | const listDirs = (dir: string): readonly string[] => |
| 180 | tryOrElse( |
no test coverage detected