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

Function applyFingerprintToEvent

packages/core/src/utils/scopeData.ts:194–211  ·  view source on GitHub ↗

* Applies fingerprint from the scope to the event if there's one, * uses message if there's one instead or get rid of empty fingerprint

(event: Event, fingerprint: ScopeData['fingerprint'] | undefined)

Source from the content-addressed store, hash-verified

192 * uses message if there's one instead or get rid of empty fingerprint
193 */
194function applyFingerprintToEvent(event: Event, fingerprint: ScopeData['fingerprint'] | undefined): void {
195 // Make sure it's an array first and we actually have something in place
196 event.fingerprint = event.fingerprint
197 ? Array.isArray(event.fingerprint)
198 ? event.fingerprint
199 : [event.fingerprint]
200 : [];
201
202 // If we have something on the scope, then merge it with event
203 if (fingerprint) {
204 event.fingerprint = event.fingerprint.concat(fingerprint);
205 }
206
207 // If we have no data at all, remove empty array default
208 if (!event.fingerprint.length) {
209 delete event.fingerprint;
210 }
211}

Callers 1

applyScopeDataToEventFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected