(dir: string)
| 542 | } |
| 543 | |
| 544 | export 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 | |
| 553 | export 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 |
nothing calls this directly
no outgoing calls
no test coverage detected