1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo?v=29";
import { blob } from "https://esm.town/v/std/blob?v=12";
import { createExcalidraw } from "https://jsr.io/@smallweb/excalidraw/0.3.0/mod.ts";
import { join } from "jsr:@std/path@0.225.2";
const { name } = extractValInfo(import.meta.url);
export default createExcalidraw({
store: {
get: async (key) => {
try {
const res = await blob.get(join(name, key));
return new Uint8Array(await res.arrayBuffer());
} catch (e) {
return null;
}
},
set: (key, value) => {
return blob.set(join(name, key), value);
},
}
});