First Release of Claw3D (#11)

Co-authored-by: iamlukethedev <iamlukethedev@users.noreply.github.com>
This commit is contained in:
Luke The Dev
2026-03-19 23:14:04 -05:00
committed by GitHub
parent 5ea96b2650
commit 4fa4f13558
431 changed files with 105438 additions and 14 deletions
+44
View File
@@ -0,0 +1,44 @@
import "@testing-library/jest-dom/vitest";
const ensureLocalStorage = () => {
if (typeof window === "undefined") return;
const existing = window.localStorage as unknown as Record<string, unknown> | undefined;
if (
existing &&
typeof existing.getItem === "function" &&
typeof existing.setItem === "function" &&
typeof existing.removeItem === "function" &&
typeof existing.clear === "function"
) {
return;
}
const store = new Map<string, string>();
const storage = {
get length() {
return store.size;
},
clear() {
store.clear();
},
getItem(key: string) {
return store.has(String(key)) ? store.get(String(key)) ?? null : null;
},
key(index: number) {
return Array.from(store.keys())[index] ?? null;
},
removeItem(key: string) {
store.delete(String(key));
},
setItem(key: string, value: string) {
store.set(String(key), String(value));
},
};
Object.defineProperty(window, "localStorage", {
value: storage,
configurable: true,
});
};
ensureLocalStorage();