//#region src/Array/countBy.d.ts /** * # countBy * * ```ts * function Array.countBy( * target: readonly T[], * predicate: ( * value: NoInfer, * index: number, * target: readonly NoInfer[], * ) => boolean, * ): number * ``` * * Counts the number of elements in the `target` array satisfy the provided `predicate` function. * * ## Example * * ```ts [data-first] * import { Array } from "@monstermann/array"; * * const isEven = (n) => n % 2 === 0; * Array.countBy([1, 2, 3, 4, 5], isEven); // 2 * ``` * * ```ts [data-last] * import { Array } from "@monstermann/array"; * * const isEven = (n) => n % 2 === 0; * pipe([1, 2, 3, 4, 5], Array.countBy(isEven)); // 2 * ``` * */ declare const countBy: { (predicate: (value: NoInfer, index: number, target: readonly NoInfer[]) => boolean): (target: readonly T[]) => number; (target: readonly T[], predicate: (value: NoInfer, index: number, target: readonly NoInfer[]) => boolean): number; }; //#endregion export { countBy };