MCPcopy
hub / github.com/prisma/prisma / deepSet

Function deepSet

packages/client/src/runtime/utils/deep-set.ts:24–25  ·  view source on GitHub ↗
(o: any, kp: string | string[], v: any)

Source from the content-addressed store, hash-verified

22// 2. b = Object.assign({}, { b: { c: 1 } }, { b: c })
23// 3. returned = Object.assign({}, { a: { b: { c: 1 } } }, { a: b })
24export const deepSet = (o: any, kp: string | string[], v: any) =>
25 keys(kp).reduceRight((v, k, i, ks) => Object.assign({}, deepGet(o, ks.slice(0, i)), { [k]: v }), v)

Callers 1

getNextUserArgsFunction · 0.90

Calls 3

deepGetFunction · 0.85
keysFunction · 0.70
sliceMethod · 0.45

Tested by

no test coverage detected