ramda-extension
Version:
Helpful functions built on top of the mighty Ramda
19 lines (18 loc) • 441 B
JavaScript
import { o, map, apply, objOf, toPairs } from 'ramda';
/**
* Creates array of entries from object.
*
* @func
* @category Object
*
* @param {any} object
* @return {Array} Description
*
* @example
*
* R_.toEntries({ a: "b", c: "d" }) // [{ a: "b" }, { c: "d" }]
*
* @sig {String: a, ...} -> [{String: a}]
*/
var toEntries = /*#__PURE__*/o( /*#__PURE__*/map( /*#__PURE__*/apply(objOf)), toPairs);
export default toEntries;