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
The AutoPath function is quite cool, but it's not clear (to me) if it's possible to use/implement the AutoPath function such that it applies to the keys of an object.
For example, Mongo allows you to perform an update with the "$set" operator, such as:
I'd like to add typing to a function that mimics that behaviour (and also to a function that will execute a Mongo update using the "$set" operator, but we'll stick with the mimic functionality example for now):
In the above example, is it possible to use AutoPath (or something else) to type the keys (and values) of the dottedKeyVals object (and maybe the updated obj return type as well? Though I guess that should just be T)?
Maybe this asking a bit much, though. Maybe it's a "more trouble than it's worth" situation. 😅
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The AutoPath function is quite cool, but it's not clear (to me) if it's possible to use/implement the AutoPath function such that it applies to the keys of an object.
For example, Mongo allows you to perform an update with the "$set" operator, such as:
I'd like to add typing to a function that mimics that behaviour (and also to a function that will execute a Mongo update using the "$set" operator, but we'll stick with the mimic functionality example for now):
In the above example, is it possible to use AutoPath (or something else) to type the keys (and values) of the
dottedKeyVals
object (and maybe the updated obj return type as well? Though I guess that should just be T)?Maybe this asking a bit much, though. Maybe it's a "more trouble than it's worth" situation. 😅
Beta Was this translation helpful? Give feedback.
All reactions