MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / push

Function push

packages/browser/src/transports/offline.ts:57–69  ·  view source on GitHub ↗
(store: Store, value: Uint8Array | string, maxQueueSize: number)

Source from the content-addressed store, hash-verified

55
56/** Insert into the end of the store */
57export function push(store: Store, value: Uint8Array | string, maxQueueSize: number): Promise<void> {
58 return store(store => {
59 return keys(store).then(keys => {
60 if (keys.length >= maxQueueSize) {
61 return;
62 }
63
64 // We insert with an incremented key so that the entries are popped in order
65 store.put(value, Math.max(...keys, 0) + 1);
66 return promisifyRequest(store.transaction);
67 });
68 });
69}
70
71/** Insert into the front of the store */
72export function unshift(store: Store, value: Uint8Array | string, maxQueueSize: number): Promise<void> {

Callers 2

offline.test.tsFile · 0.90
createIndexedDbStoreFunction · 0.85

Calls 4

promisifyRequestFunction · 0.85
putMethod · 0.80
keysFunction · 0.70
thenMethod · 0.45

Tested by

no test coverage detected