MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / dirExists

Function dirExists

lib/utils.ts:544–551  ·  view source on GitHub ↗
(dir: string)

Source from the content-addressed store, hash-verified

542}
543
544export async function dirExists(dir: string): Promise<boolean> {
545 try {
546 const stat = await fs.stat(dir);
547 return stat.isDirectory();
548 } catch {
549 return false;
550 }
551}
552
553export function countOccurrences<T>(collection: Iterable<T>, item: T): number {
554 // _.reduce(collection, (total, value) => value === item ? total + 1 : total, 0) would work, but is probably slower

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected