-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
I am using getByPath in a helper function and passing in a Path<T> as a parameter. The path is useful to me in another package, which takes an array rather than a "dotted" path. However, attempting path.split('.') throws up a Property 'split' does not exist on type 'Path<T>' typescript error.
function takesPathAsArray(path: string[]) {
// does something fancy with the path
}
function helperFn<T>(obj: T, path: Path<T>) {
const value = getByPath(obj, path);
// error is here v v v v v v v v
const somethingElse = takesPathAsArray(path.split('.'));
}I can of course cast path as a string there, but I was wondering if there was a way for the library to support it?
Metadata
Metadata
Assignees
Labels
No labels