(_, prop: keyof StorageAdapter)
| 36 | */ |
| 37 | export const storage: StorageAdapter = new Proxy({} as StorageAdapter, { |
| 38 | get(_, prop: keyof StorageAdapter) { |
| 39 | const instance = getStorage(); |
| 40 | const value = instance[prop]; |
| 41 | if (typeof value === "function") { |
| 42 | return value.bind(instance); |
| 43 | } |
| 44 | return value; |
| 45 | }, |
| 46 | }); |
| 47 | |
| 48 | // ============================================================================ |
no test coverage detected