UNPKG

typedash

Version:

modern, type-safe collection of utility functions

16 lines (14 loc) 477 B
import { t as filter } from "./filterIterable-CyAWwYFe.js"; //#region src/functions/count/count.ts /** * Implementation for all overloads. * @param source The iterable to count. * @param predicate The predicate function used to determine if an element is a match. * @returns The number of matching elements. */ function count(source, predicate) { return filter(source, predicate)?.length ?? 0; } //#endregion export { count as t }; //# sourceMappingURL=count-rTVH99Xh.js.map