MCPcopy Create free account
hub / github.com/getsentry/sentry / stripUndefinedValues

Function stripUndefinedValues

static/app/utils/api/apiOptions.ts:26–42  ·  view source on GitHub ↗
(obj: Record<string, unknown>)

Source from the content-addressed store, hash-verified

24}
25
26function stripUndefinedValues(obj: Record<string, unknown>): Record<string, unknown> {
27 const result: Record<string, unknown> = {};
28 for (const [key, value] of Object.entries(obj)) {
29 if (value === undefined) {
30 continue;
31 }
32 if (isObject(value)) {
33 const stripped = stripUndefinedValues(value);
34 if (Object.keys(stripped).length > 0) {
35 result[key] = stripped;
36 }
37 continue;
38 }
39 result[key] = value;
40 }
41 return result;
42}
43
44export const selectJson = <TData>(data: ApiResponse<TData>) => data.json;
45

Callers 2

_apiOptionsFunction · 0.85
_apiOptionsInfiniteFunction · 0.85

Calls 3

isObjectFunction · 0.85
entriesMethod · 0.80
keysMethod · 0.45

Tested by

no test coverage detected