UNPKG

rambda

Version:

Lightweight and faster alternative to Ramda with included TS definitions

12 lines (9 loc) 208 B
import { isArray } from './_internals/isArray.js' export function count(predicate) { return list => { if (!isArray(list)) { return 0 } return list.filter(x => predicate(x)).length } }