(store: Store)
| 85 | |
| 86 | /** Pop the oldest value from the store */ |
| 87 | export function shift(store: Store): Promise<Uint8Array | string | undefined> { |
| 88 | return store(store => { |
| 89 | return keys(store).then(keys => { |
| 90 | const firstKey = keys[0]; |
| 91 | if (firstKey == null) { |
| 92 | return undefined; |
| 93 | } |
| 94 | |
| 95 | return promisifyRequest(store.get(firstKey)).then(value => { |
| 96 | store.delete(firstKey); |
| 97 | return promisifyRequest(store.transaction).then(() => value); |
| 98 | }); |
| 99 | }); |
| 100 | }); |
| 101 | } |
| 102 | |
| 103 | export interface BrowserOfflineTransportOptions extends Omit<OfflineTransportOptions, 'createStore'> { |
| 104 | /** |
no test coverage detected