typed-typings / npm-lodash

The type definition for https://github.com/lodash/lodash
MIT License
16 stars 22 forks source link

Fix _.fromPairs #7

Closed demurgos closed 8 years ago

demurgos commented 8 years ago

_.fromPairs documentation

The return value is a dictionary, not an array. Also, the argument can be better typed as Array<[string, T]> to reflect the expected pairs.

The inverse method (_.toPairs) is currently not wrong but could be typed more strictly with the return Array<[string, T]>. I left this out but I can add it to this PR if you want.

blakeembrey commented 8 years ago

LGTM /cc @unional