MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / clear

Function clear

apps/ui/src/lib/storage/localStorage.ts:40–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38 window.localStorage.removeItem(namespacedKey(name));
39 },
40 clear(): void {
41 const prefix = namespacedKey("");
42 const toRemove: string[] = [];
43
44 for (let i = 0; i < window.localStorage.length; i++) {
45 const k = window.localStorage.key(i);
46
47 if (k?.startsWith(prefix) === true) {
48 toRemove.push(k);
49 }
50 }
51
52 for (const k of toRemove) {
53 window.localStorage.removeItem(k);
54 }
55 }
56};

Callers

nothing calls this directly

Calls 1

namespacedKeyFunction · 0.90

Tested by

no test coverage detected