MCPcopy Create free account
hub / github.com/GoogleChrome/samples / deleteStorage

Function deleteStorage

sqlite-wasm-cos/sqlite3-node.mjs:16485–16501  ·  view source on GitHub ↗
(store)

Source from the content-addressed store, hash-verified

16483 cache.storagePool entry) and its db/journal counterpart.
16484 */
16485 const deleteStorage = function(store){
16486 const other = cache.rxJournalSuffix.test(store.jzClass)
16487 ? store.jzClass.replace(cache.rxJournalSuffix,'')
16488 : store.jzClass+'-journal';
16489 kvvfs?.log?.xClose
16490 && debug("cleaning up storage handles [", store.jzClass, other,"]",store);
16491 delete cache.storagePool[store.jzClass];
16492 delete cache.storagePool[other];
16493 if( !sqlite3.__isUnderTest ){
16494 /* In test runs, leave these for inspection. If we delete them here,
16495 any prior dumps of them emitted via the console get cleared out
16496 because the console shows live objects instead of call-time
16497 static dumps. */
16498 delete store.storage;
16499 delete store.refc;
16500 }
16501 };
16502
16503 /**
16504 Add both store.jzClass and store.jzClass+"-journal"

Callers 2

sqlite3InitModuleFunction · 0.70
sqlite3_js_kvvfs_unlinkFunction · 0.70

Calls 1

debugFunction · 0.70

Tested by

no test coverage detected