MCPcopy Index your code
hub / github.com/pyscript/pyscript / from_idb

Function from_idb

core/src/storage.js:24–31  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

22};
23
24const from_idb = (value) => {
25 const [kind, result] = parse(value);
26 if (kind === "null") return null;
27 if (kind === "generic") return result;
28 if (kind === "bytearray") return new Uint8Array(value).buffer;
29 if (kind === "memoryview") return new Uint8Array(value);
30 return value;
31};
32
33// this export simulate pyscript.storage exposed in the Python world
34export const storage = async (name) => {

Callers 1

storageFunction · 0.85

Calls 1

parseFunction · 0.90

Tested by

no test coverage detected