1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { blob } from "https://esm.town/v/std/blob";
import { whoami } from "https://esm.town/v/stevekrouse/whoami?v=11";
import process from "node:process";
export default <T,>() => {
const storageKey = whoami()[0];
return {
storageKey: storageKey,
get() {
return blob.getJSON(this.storageKey) as Promise<T | undefined>;
},
set(value: T | undefined) {
if (value === undefined) {
return blob.delete(this.storageKey);
}
return blob.setJSON(this.storageKey, value);
},
};
};
process.env;