[@types/lodash] mapValues always returns an object but type may be inferred as an array #69439
Unanswered
skyboyer
asked this question in
Issues with a @types package
Replies: 2 comments 1 reply
-
Thanks for the discussion about "lodash", some useful links for everyone: Pinging the DT module owners: @bczengel, @chrootsu, @aj-r, @e-cloud, @thorn0, @jtmthf, @DomiR, @WilliamChelman. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Interesting. I don't see any indication that The best solution is probably to add a new mapValues<T, TResult>(array: T[], callback: (value: T) => TResult): NumericDictionary<TResult>; |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
AFAIK,
_.mapValues
always return an object:But
@types/lodash
may result in an array-type inferred:Link to TS playground
Is it a gap or do I miss some cases when it will be correct?
Beta Was this translation helpful? Give feedback.
All reactions