We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sorry for the title which is quite obscure.. Let me explain what I am looking for, it will be more clear.
For a given data object:
const data = { foo: 42, bar: false }
How can I type a getter function that given a path return the value at path?
const myFunction = (path: A):B => pipe(data,get(path)) myFunction('foo') // OK, =42 myFunction('bar') // OK, =false myFunction('baz') // type error
Looking for what to put in type A and type B above. Is there some utility types I could use to achieve this?
A
B
Thanks 🙏
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Sorry for the title which is quite obscure.. Let me explain what I am looking for, it will be more clear.
For a given data object:
How can I type a getter function that given a path return the value at path?
Looking for what to put in type
A
and typeB
above. Is there some utility types I could use to achieve this?Thanks 🙏
The text was updated successfully, but these errors were encountered: