char/avril

(wip) why'd you have to go and make things so complicaaaaated?

git clone https://git.t4t.associates/char/avril

Charlotte Somport webstorage extension to typescriptcbc8039

main
458 B15 linesraw
1import { ObjectDefineProperty as define } from "ext:core/primordials";
2import { installInterface } from "ext:web/interface.js";
3import { localStorage, sessionStorage, Storage } from "./storage.js";
4
5installInterface("Storage", Storage);
6for (const [name, value] of [
7  ["localStorage", localStorage],
8  ["sessionStorage", sessionStorage],
9] as const) {
10  define(globalThis, name, {
11    get: () => value,
12    enumerable: true,
13    configurable: true,
14  });
15}