MCPcopy Create free account
hub / github.com/dailydotdev/apps / excludeProperties

Function excludeProperties

packages/shared/src/lib/utils.ts:76–95  ·  view source on GitHub ↗
(
  obj: T,
  properties: K[],
)

Source from the content-addressed store, hash-verified

74};
75
76export const excludeProperties = <
77 T,
78 K extends string | keyof T,
79 R = Omit<T, K & keyof T>,
80>(
81 obj: T,
82 properties: K[],
83): R => {
84 if (!obj) {
85 return obj as unknown as R;
86 }
87
88 const clone = structuredClone(obj);
89
90 properties.forEach((prop) => {
91 delete (clone as Record<string, unknown>)[prop as string];
92 });
93
94 return clone as unknown as R;
95};

Callers 2

upsertUserWorkExperienceFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected