@unction/fromfunctortopairs
v5.13.0
Published
Takes a functor and tries to transform it into a list of key-value pairs
Downloads
400
Readme
@unction/fromFunctorToPairs
NOTE: This library has been deprecated in favor of unction/pairsFrom
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"]]