MCPcopy Create free account
hub / github.com/fontsource/fontsource / getDirectories

Function getDirectories

packages/cli/src/custom/utils.ts:5–16  ·  view source on GitHub ↗
(dir: string, cwd?: string)

Source from the content-addressed store, hash-verified

3import path from 'pathe';
4
5export const getDirectories = (dir: string, cwd?: string) => {
6 try {
7 return fs
8 .readdirSync(path.join(cwd ?? process.cwd(), dir), {
9 withFileTypes: true,
10 })
11 .filter((dirent) => dirent.isDirectory())
12 .map((dirent) => dirent.name);
13 } catch {
14 return [];
15 }
16};

Callers 2

verifyAllFunction · 0.90
rebuildFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected