-
Notifications
You must be signed in to change notification settings - Fork 29.9k
New issue
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
dot-object pick should return any in stead of void (sent PR) #14319
Comments
- See issue DefinitelyTyped#14319 Function 'pick' returns is documented to always return a value. Before it's return type was :void, I'm sending this proposal as :any would fix this issue. Reference to dot-object documentation: https://github.com/rhalff/dot-object#pickremove-a-value-using-dot-notation
Created PR for this, if this could help #14320 |
- Changed @types/dot-object manually in node_modules - see DefinitelyTyped/DefinitelyTyped#14319 - so beware when compiling and .pick() function's return type typings haven't changed from :void to :any yet.
- See issue DefinitelyTyped#14319 Function 'pick' returns is documented to always return a value. Before it's return type was :void, I'm sending this proposal as :any would fix this issue. Reference to dot-object documentation: https://github.com/rhalff/dot-object#pickremove-a-value-using-dot-notation
Hi thread, we're moving DefinitelyTyped to use GitHub Discussions for conversations the To help with the transition, we're closing all issues which haven't had activity in the last 6 months, which includes this issue. If you think closing this issue is a mistake, please pop into the TypeScript Community Discord and mention the issue in the |
@types/dot-object
package and had problems.Definitions by:
inindex.d.ts
) so they can respond.Description: Function 'pick' shows in dot-object documentation to return a value - yet in the typings it has the return value
:void
.I have used dot-object's
pick
a long time to get values from a given 'path/key' - like done in the documentation:var val = dot.pick('some.nested.value', obj);
- but now when using this in TypeScript with the current typing it won't let me - as the return type isvoid
.I would like to suggest changing this to returnign type
any
- as when removing the value it is documented to return it as well before removing it. Hence I don't think (correct me if I'm wrong) there's need for an overload here.Reference to dot-object documentation: https://github.com/rhalff/dot-object#pickremove-a-value-using-dot-notation
The text was updated successfully, but these errors were encountered: