UNPKG

@arrows/array

Version:
21 lines (20 loc) 791 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.filterNot_ = void 0; const curry_1 = require("@arrows/composition/curry"); const _filterNot_ = (fn, arr) => arr.filter((element, index, inputArr) => !fn(element, index, inputArr)); /** * Creates a new array from the initial one, without the values * that meet the condition specified in a filtering function. * * It is useful when you have a ready-to-use filtering function, * that you want to pass as an argument, otherwise you would have * to manually wrap it in a function to negate its results. * * @param fn Filtering function * @param arr initial array * @returns New array */ const filterNot_ = curry_1.default(_filterNot_); exports.filterNot_ = filterNot_; exports.default = filterNot_;