ramda-extension
Version:
Helpful functions built on top of the mighty Ramda
17 lines (16 loc) • 459 B
JavaScript
import { useWith, compose, map, fromPairs, toPairs, identity } from 'ramda';
/**
* Always returns null.
*
* @func
* @category Object
*
* @example
*
* R_.mapKeysAndValues(([a, b]) => [b, a], { foo: "bar", baz: "boo" })
* // { bar: "foo", boo: "baz" }
*
* @sig ([a] -> [b]) -> Object -> Object
*/
var mapKeysAndValues = /*#__PURE__*/useWith( /*#__PURE__*/compose(fromPairs, map), [identity, toPairs]);
export default mapKeysAndValues;