You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
functiontakesPathAsArray(path: string[]){// does something fancy with the path}functionhelperFn<T>(obj: T,path: Path<T>){constvalue=getByPath(obj,path);// error is here v v v v v v v v constsomethingElse=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?
The text was updated successfully, but these errors were encountered:
I am using
getByPath
in a helper function and passing in aPath<T>
as a parameter. The path is useful to me in another package, which takes an array rather than a "dotted" path. However, attemptingpath.split('.')
throws up aProperty 'split' does not exist on type 'Path<T>'
typescript error.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?The text was updated successfully, but these errors were encountered: