@arrows/array
Version:
Functional tools for JS arrays
19 lines (18 loc) • 531 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.map = void 0;
const curry_1 = require("@arrows/composition/curry");
const _map = (fn, arr) => arr.map(fn);
/**
* Functional wrapper for Array.prototype.map
*
* Calls a defined mapping function on each element of an array,
* and returns an array that contains the results.
*
* @param mappingFn Mapping function
* @param arr Initial array
* @return New array
*/
const map = curry_1.default(_map);
exports.map = map;
exports.default = map;
;