MCPcopy Create free account
hub / github.com/ProtonDriveApps/sdk / scrubStackFrame

Function scrubStackFrame

cli/src/telemetry/sentry.ts:72–96  ·  view source on GitHub ↗
(frame: StackFrame)

Source from the content-addressed store, hash-verified

70 }
71 }
72 }
73
74 return event;
75}
76
77function scrubStackFrame(frame: StackFrame): void {
78 if (frame.filename) {
79 frame.filename = scrubPathsInString(frame.filename);
80 }
81 if (frame.abs_path) {
82 frame.abs_path = scrubPathsInString(frame.abs_path);
83 }
84 if (frame.context_line) {
85 frame.context_line = scrubPathsInString(frame.context_line);
86 }
87 if (frame.pre_context?.length) {
88 frame.pre_context = frame.pre_context.map(scrubPathsInString);
89 }
90 if (frame.post_context?.length) {
91 frame.post_context = frame.post_context.map(scrubPathsInString);
92 }
93 if (frame.vars && typeof frame.vars === 'object') {
94 for (const key of Object.keys(frame.vars)) {
95 const v = frame.vars[key];
96 if (typeof v === 'string') {
97 frame.vars[key] = scrubPathsInString(v);
98 }
99 }

Callers 1

Calls 2

scrubPathsInStringFunction · 0.85
keysMethod · 0.80

Tested by

no test coverage detected