npm.io
0.0.3 • Published 7 years ago

@magyarg/utils

Licence
—
Version
0.0.3
Deps
0
Size
2 kB
Vulns
0
Weekly
0

Utils

Array

all

Returns true if the provided function applies for every element of the array.

all([1, 2, 3], (it) => it > 0)
allEqual

Returns true if all the provided array elements are equal.

allEqual([1, 1, 1])
any

Returns true if the provided function applies for at least on of the elements.

any([1, 2, 3], (it) => it === 3)
chunk

Chunks an array into smaller arrays of a specified size

chunk([1, 2, 3, 4, 5, 6], 2)