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

Function forEachEnvelopeItem

packages/core/src/utils/envelope.ts:48–64  ·  view source on GitHub ↗
(
  envelope: Envelope,
  callback: (envelopeItem: E[1][number], envelopeItemType: E[1][number][0]['type']) => boolean | void,
)

Source from the content-addressed store, hash-verified

46 * If the callback returns true, the rest of the items will be skipped.
47 */
48export function forEachEnvelopeItem<E extends Envelope>(
49 envelope: Envelope,
50 callback: (envelopeItem: E[1][number], envelopeItemType: E[1][number][0]['type']) => boolean | void,
51): boolean {
52 const envelopeItems = envelope[1];
53
54 for (const envelopeItem of envelopeItems) {
55 const envelopeItemType = envelopeItem[0].type;
56 const result = callback(envelopeItem, envelopeItemType);
57
58 if (result) {
59 return true;
60 }
61 }
62
63 return false;
64}
65
66/**
67 * Returns true if the envelope contains any of the given envelope item types

Callers 12

envelope.test.tsFile · 0.90
setupFunction · 0.90
setupFunction · 0.90
sendFunction · 0.90
recordEnvelopeLossFunction · 0.90
eventFromEnvelopeFunction · 0.90
getNormalizedEventFunction · 0.90
collectMetricsFunction · 0.90
mod.test.tsFile · 0.90
envelopeContainsItemTypeFunction · 0.85

Calls 1

callbackFunction · 0.50

Tested by 1

collectMetricsFunction · 0.72