npm.io
5.13.0 • Published 5 years ago

@unction/fromfunctortopairs

Licence
SEE LICENSE IN LICENSE
Version
5.13.0
Deps
2
Size
21 kB
Vulns
0
Weekly
0

@unction/fromFunctorToPairs

NOTE: This library has been deprecated in favor of unction/pairsFrom

Tests Stability Dependencies

FunctorType => Array<[KeyType?, ValueType?]>

Takes a functor and tries to transform it into a list of key-value pairs.

fromFunctorToPairs({aaa: "a", bbb: "b", ccc: "c"})) // [["aaa", "a"], ["bbb", "b"], ["ccc", "c"]]
fromFunctorToPairs(["a", "b", "c"]) // [[0, "a"], [1, "b"], [2, "c"]]
fromFunctorToPairs(new Map([["aaa", "a"], ["bbb", "b"], ["ccc", "c"]])) // [["aaa", "a"], ["bbb", "b"], ["ccc", "c"]]
fromFunctorToPairs(new Set(["a", "b", "c"])) // [[undefined, "a"], [undefined, "b"], [undefined, "c"]]

Keywords