UNPKG

@extra-array/some

Version:

Checks if any value satisfies a test.

15 lines (14 loc) 277 B
'use strict'; function someBool(x) { for (var i = 0, I = x.length; i < I; i++) if (x[i]) return true; return false; } function some(x, ft = null) { if (ft) return x.some(ft); else return someBool(x); } module.exports = some;