MCPcopy Create free account
hub / github.com/middleapi/orpc / get

Function get

packages/shared/src/object.ts:83–95  ·  view source on GitHub ↗
(object: unknown, path: readonly PropertyKey[])

Source from the content-addressed store, hash-verified

81}
82
83export function get(object: unknown, path: readonly PropertyKey[]): unknown {
84 let current: unknown = object
85
86 for (const key of path) {
87 if (!isTypescriptObject(current)) {
88 return undefined
89 }
90
91 current = current[key]
92 }
93
94 return current
95}
96
97export function isPropertyKey(value: unknown): value is PropertyKey {
98 const type = typeof value

Callers 1

object.test.tsFile · 0.90

Calls 1

isTypescriptObjectFunction · 0.85

Tested by

no test coverage detected