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

Function getFinalScope

packages/core/src/utils/prepareEvent.ts:297–305  ·  view source on GitHub ↗
(scope: Scope | undefined, captureContext: CaptureContext | undefined)

Source from the content-addressed store, hash-verified

295}
296
297function getFinalScope(scope: Scope | undefined, captureContext: CaptureContext | undefined): Scope | undefined {
298 if (!captureContext) {
299 return scope;
300 }
301
302 const finalScope = scope ? scope.clone() : new Scope();
303 finalScope.update(captureContext);
304 return finalScope;
305}
306
307/**
308 * Parse either an `EventHint` directly, or convert a `CaptureContext` to an `EventHint`.

Callers 1

prepareEventFunction · 0.85

Calls 2

cloneMethod · 0.65
updateMethod · 0.45

Tested by

no test coverage detected