or run

npx @tessl/cli init
Log in

Version

Files

docs

index-management.mdindex.mdlisting.mdreading.mdremoval.mdutilities.mdverification.mdwriting.md
tile.json

task.mdevals/scenario-10/

Cache Purge with Full Removal Overrides

A utility for removing cached entries by key while letting callers choose between default tombstone deletions and full index bucket removal for problematic keys.

Capabilities

Default removal uses tombstones

  • Removing a present key drops it from the cache index without disturbing other keys that share the cache, and the key is reported under tombstoned in the result. @test
  • Removing a key that is already absent records it under skipped instead of throwing. @test

Full bucket purge override

  • When a key appears in opts.purgeBuckets, its index bucket is deleted instead of being tombstoned, and the key is reported under fullyRemoved. @test
  • A mixed request handles full-bucket purges and standard removals together, producing the correct tombstoned, fullyRemoved, and skipped listings. @test

Implementation

@generates

API

/**
 * Removes cache entries by key, tombstoning by default and allowing full bucket removal for flagged keys.
 * @param {string} cachePath
 * @param {string[]} keys
 * @param {{ purgeBuckets?: string[] }} [opts]
 * @returns {Promise<{ tombstoned: string[], fullyRemoved: string[], skipped: string[] }>}
 */
export function purgeEntries(cachePath, keys, opts);

Dependencies { .dependencies }

cacache { .dependency }

Provides cache index deletion with optional full bucket removal controls.