0.0.3 • Published 5 years ago

@magyarg/utils v0.0.3

Weekly downloads
-
License
-
Repository
github
Last release
5 years ago

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)