Skip to content

Commit ba1eead

Browse files
committed
New type PropertyPath
1 parent f84e2eb commit ba1eead

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

dashi/src/lib/utils/getValue.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
export function getValue(obj: object, path: (string | number)[]): unknown {
1+
export type PropertyPath = (string | number)[];
2+
3+
export function getValue(obj: object, path: PropertyPath): unknown {
24
let value: unknown = obj;
35
for (const key of path) {
46
if (typeof value === "object") {

0 commit comments

Comments
 (0)