UNPKG

@arrows/array

Version:
19 lines (18 loc) 573 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.filter = void 0; const curry_1 = require("@arrows/composition/curry"); const _filter = (fn, arr) => arr.filter(fn); /** * Functional wrapper for Array.prototype.filter * * Creates a new array from the initial one, without the values * that does not meet the condition specified in a filtering function. * * @param fn Filtering function * @param arr Initial array * @returns New array */ const filter = curry_1.default(_filter); exports.filter = filter; exports.default = filter;