← All Modules

Methods

pure-utilities / collection

collection

append

append(collection, indefinite, amount, of, arguments)

Parameters:

  • collection
  • indefinite
  • amount
  • of
  • arguments

Adds arguments at the end of the collecion.

prepend

prepend(collection, indefinite, amount, of, arguments)

Parameters:

  • collection
  • indefinite
  • amount
  • of
  • arguments

Adds arguments at the beginning of the collection.

reverse

reverse(collection)

Parameters:

  • collection

Reverses the elements of the collection.

size

size(collection)

Parameters:

  • collection

Returns the size of the collection.

flatten

flatten(collection)

Parameters:

  • collection

Flattens n-dimensional array or n-depth object to a single depth array or object.

unflatten

unflatten(collection)

Parameters:

  • collection

Converts properties of the object, which contain in the name dots(.), to multi-depth object.

occurences

occurences(collection, string)

Parameters:

  • collection
  • string

Returns the count of occurences of the string in the collection or string.