(value)
| 22 | }; |
| 23 | |
| 24 | const 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 |
| 34 | export const storage = async (name) => { |