UNPKG

ts-prime

Version:

A utility library for JavaScript and Typescript.

15 lines (14 loc) 476 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var purry_1 = require("./purry"); function mapToObj() { return purry_1.purry(_mapToObj(), arguments); } exports.mapToObj = mapToObj; var _mapToObj = function () { return function (array, fn) { return array.reduce(function (result, element, index) { var _a = fn(element, index, array), key = _a[0], value = _a[1]; result[key] = value; return result; }, {}); }; };