joinDataPath()function
joinDataPath(path: BranchDataSegments<T> | BranchDataPath<T>): BranchDataPath<T>
joinDataPath(path: LeafDataSegments<T> | LeafDataPath<T>): LeafDataPath<T>
joinDataPath(path: Segments | string): string
| Param | Type | |
|---|---|---|
path | BranchDataSegments<T>BranchDataPath<T> | An array of path segments, or an already-joined dotted path string. required |
path | LeafDataSegments<T>LeafDataPath<T> | required |
path | Segmentsstring | required |
| Return | |
|---|---|
BranchDataPath<T> | The path as a dotted string (e.g. "a.b"). |
LeafDataPath<T> | Helper type to get the leaf paths for a flattened data object with deep paths flattened into a.c.b format. |
string |
Join a set of data path segments into a dotted path string.
- A path that is already a dotted string is returned unchanged.
Examples
joinDataPath<{ a: { b: number } }>(["a", "b"]); // "a.b"