UNPKG

@jovian/type-tools

Version:

TypeTools is a Typescript library for providing extensible tooling runtime validations and type helpers.

13 lines (12 loc) 277 B
export function pathNavigate(path: string[], store: any) { if (!path || !store) { return store; } let at = store; for (const pathname of path) { at = at[pathname]; if (at === undefined) { break; } } if (at === undefined) { return null; } return at; }