MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / listDirSafe

Function listDirSafe

packages/migration-legacy/src/detect.ts:104–114  ·  view source on GitHub ↗
(
  dir: string,
  filter: (name: string) => boolean,
)

Source from the content-addressed store, hash-verified

102}
103
104async function listDirSafe(
105 dir: string,
106 filter: (name: string) => boolean,
107): Promise<string[]> {
108 try {
109 const names = await readdir(dir);
110 return names.filter(filter);
111 } catch {
112 return [];
113 }
114}
115
116async function readWireMtime(sessionDir: string): Promise<number> {
117 try {

Callers 1

detectMigrationFunction · 0.85

Calls 1

readdirFunction · 0.50

Tested by

no test coverage detected