UNPKG

354 BTypeScriptView Raw
1export type Path = {
2 prev: Path | undefined;
3 key: string | number;
4};
5
6/**
7 * Given a Path and a key, return a new Path containing the new key.
8 */
9export function addPath(prev: Path | undefined, key: string | number): Path;
10
11/**
12 * Given a Path, return an Array of the path keys.
13 */
14export function pathToArray(path: Path): Array<string | number>;