We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 12a5cdd commit 5ff0ca3Copy full SHA for 5ff0ca3
packages/browser-utils/src/metrics/resourceTiming.ts
@@ -68,11 +68,5 @@ export function resourceTimingToSpanAttributes(resourceTiming: PerformanceResour
68
* key-value objects and does not recursively go into object properties or arrays.
69
*/
70
function dropUndefinedKeysFromObject<T extends object>(attrs: T): T {
71
- const cleaned = {} as T;
72
- Object.keys(attrs).forEach(key => {
73
- if (attrs[key as keyof T] != null) {
74
- cleaned[key as keyof T] = attrs[key as keyof T];
75
- }
76
- });
77
- return cleaned;
+ return Object.fromEntries(Object.entries(attrs).filter(([, value]) => value != null)) as Partial<T>;
78
}
0 commit comments