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

Function pick

packages/@contentlayer/client/src/utils.ts:10–15  ·  view source on GitHub ↗
(obj: Obj, keys: Keys[])

Source from the content-addressed store, hash-verified

8type ConvertPick<T> = ConvertUndefined<T> & PickRequired<T>
9
10export const pick = <Obj, Keys extends keyof Obj>(obj: Obj, keys: Keys[]): ConvertPick<{ [K in Keys]: Obj[K] }> => {
11 return keys.reduce((acc, key) => {
12 acc[key] = obj[key]
13 return acc
14 }, {} as any)
15}

Callers 3

stackbitFieldToFieldFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…