(object: unknown, path: readonly PropertyKey[])
| 81 | } |
| 82 | |
| 83 | export 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 | |
| 97 | export function isPropertyKey(value: unknown): value is PropertyKey { |
| 98 | const type = typeof value |
no test coverage detected