MCPcopy Create free account
hub / github.com/contentlayerdev/contentlayer / omit

Function omit

packages/@contentlayer/utils/src/object/omit.ts:7–14  ·  view source on GitHub ↗
(obj: Obj, keys: Keys[])

Source from the content-addressed store, hash-verified

5
6/** Returns a shallowly cloned object with the provided keys omitted */
7export const omit = <Obj extends object, Keys extends keyof Obj>(obj: Obj, keys: Keys[]): Omit<Obj, Keys> => {
8 return Object.keys(obj).reduce((acc, key: any) => {
9 if (!keys.includes(key)) {
10 acc[key] = (obj as any)[key]
11 }
12 return acc
13 }, {} as any)
14}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…