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
To comment on that, from what I can see this library appears to parse paths from strings such as 'nested.prop'. TypeScript currently lacks ways to operate on string literals, and afaik thus far this is so far deemed out of scope (microsoft/TypeScript#15645 (comment)).
I wouldn't mind seeing that reconsidered, as I feel this is a valid use-case for not only this library but also the likes of Lodash. Until that happens though, I fear the best thing TS might be able to handle is paths where the constituents are not mashed into one string.
Little idea for this: Now with ts in babel it would be possible to create a babel macro that just converts a object path to a string, basically:
turnTostringMacro(myObj.andSoOn) // transpiles througj babel-macro to "myObj.andSoOn". Just as an idea :)
Then for ts you would only need a function declaration which takes "any" and returns "string" ;)
Prerequisites
Description
Add TS definition file to have type checking
Expected behavior
Using immutadot properly with typescript
The text was updated successfully, but these errors were encountered: