MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / handleList

Function handleList

projects/electron/src/modules/code/yjsStorage.ts:293–307  ·  view source on GitHub ↗

* List all document IDs in storage.

()

Source from the content-addressed store, hash-verified

291 * List all document IDs in storage.
292 */
293async function handleList(): Promise<string[]> {
294 try {
295 const files = await fs.readdir(getYjsStorageDir())
296
297 // Filter out temp files and convert back to document IDs
298 return files
299 .filter((f) => !f.includes(".tmp."))
300 .map((f) => unsanitizeId(f))
301 } catch (error) {
302 if ((error as NodeJS.ErrnoException).code === "ENOENT") {
303 return []
304 }
305 throw error
306 }
307}
308
309export async function listYjsDocuments(): Promise<string[]> {
310 return handleList()

Callers 1

listYjsDocumentsFunction · 0.70

Calls 2

getYjsStorageDirFunction · 0.85
unsanitizeIdFunction · 0.70

Tested by

no test coverage detected