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

Function handleDelete

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

* Delete a YJS document from disk.

(id: string)

Source from the content-addressed store, hash-verified

269 * Delete a YJS document from disk.
270 */
271async function handleDelete(id: string): Promise<void> {
272 const filePath = getDocPath(id)
273
274 try {
275 await fs.unlink(filePath)
276 logger.debug(`[YjsStorage] Deleted document: ${id}`)
277 } catch (error) {
278 if ((error as NodeJS.ErrnoException).code === "ENOENT") {
279 // Already deleted, ignore
280 return
281 }
282 throw error
283 }
284}
285
286export async function deleteYjsDocument(id: string): Promise<void> {
287 await handleDelete(id)

Callers 1

deleteYjsDocumentFunction · 0.70

Calls 1

getDocPathFunction · 0.85

Tested by

no test coverage detected