MCPcopy
hub / github.com/prisma/prisma / getTopLevelFoldersInDir

Function getTopLevelFoldersInDir

packages/internals/src/utils/fs-utils.ts:27–32  ·  view source on GitHub ↗
(dir: string)

Source from the content-addressed store, hash-verified

25 * Retrieve any foolder in the given directory, at the top-level of depth.
26 */
27export async function getTopLevelFoldersInDir(dir: string): Promise<string[]> {
28 const rawFolders = await fs.readdir(dir, { withFileTypes: true })
29 return rawFolders
30 .filter((fileOrFolder) => fileOrFolder.isDirectory())
31 .map((folder) => pathToPosix(path.join(dir, folder.name)))
32}
33
34/**
35 * Retrieve any folder nested into the given directory, at any level of depth.

Callers

nothing calls this directly

Calls 1

pathToPosixFunction · 0.90

Tested by

no test coverage detected