MCPcopy
hub / github.com/openai/chatkit-js / getByPath

Function getByPath

packages/chatkit-react/src/useStableOptions.ts:68–69  ·  view source on GitHub ↗
(root: any, p: (string | number)[])

Source from the content-addressed store, hash-verified

66 const path: (string | number)[] = [];
67
68 const getByPath = (root: any, p: (string | number)[]) =>
69 p.reduce((acc, k) => (acc == null ? acc : acc[k]), root);
70
71 const wrap = (parentPath: (string | number)[], key: string | number) => {
72 return (...args: any[]) => {

Callers 1

wrapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected