MCPcopy Create free account
hub / github.com/apache/tvm / removeEntryIfExists

Method removeEntryIfExists

web/src/opfs_store.ts:500–513  ·  view source on GitHub ↗
(
    directory: OPFSDirectoryHandle,
    filename: string,
  )

Source from the content-addressed store, hash-verified

498 }
499
500 private async removeEntryIfExists(
501 directory: OPFSDirectoryHandle,
502 filename: string,
503 ): Promise<void> {
504 try {
505 await directory.removeEntry(filename);
506 } catch (err) {
507 if (OPFSStore.isNotFoundError(err)) {
508 // Delete is intentionally idempotent for missing entries
509 return;
510 }
511 throw err;
512 }
513 }
514
515 private async hashUrl(url: string): Promise<string> {
516 const textEncoder = new TextEncoder();

Callers 2

writeMethod · 0.95
removeMethod · 0.95

Calls 2

removeEntryMethod · 0.80
isNotFoundErrorMethod · 0.80

Tested by

no test coverage detected