MCPcopy Index your code
hub / github.com/simstudioai/sim / omit

Function omit

packages/utils/src/object.ts:7–13  ·  view source on GitHub ↗
(obj: T, keys: K[])

Source from the content-addressed store, hash-verified

5 * omit({ a: 1, b: 2, c: 3 }, ['b', 'c']) // { a: 1 }
6 */
7export function omit<T extends object, K extends keyof T>(obj: T, keys: K[]): Omit<T, K> {
8 const result = { ...obj }
9 for (const key of keys) {
10 delete result[key]
11 }
12 return result
13}
14
15/**
16 * Returns a shallow copy of `obj` with all `undefined`-valued keys removed.

Callers 2

convertToUserFileFunction · 0.90
hasSchemaChangedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected