Get the number of items in the collection.
Cast the collection to an array.
Return an object mapping the given key to the record with that key.
See keyBy()
.
Return a new AsyncPipe of this collection.
Return the item at the given index in the collection, if it exists.
Get the average value of the items or one of their keys.
Create a copy of this collection. Does NOT deep copy the underlying items.
Collapse a (potentially nested) collection of items down to a single dimension.
Push the given items to the end of this collection.
Unlike merge()
, this mutates the current collection's items.
Returns true if the given key matches the given condition for any item in the collection.
Get the number of items in the collection.
Return a collection of items that ARE in this collection, but NOT in the items
collection.
Return a collection of items that ARE in this collection, but NOT In the items
collection
using a helper function to determine whether two items are equal.
Execute the function for every item in the collection.
Returns true if the given function returns true for every item in the collection.
Return a new collection filtered by the given function.
Returns the index of the record for which the given function returns true, if such an index exists.
Return the first item in the collection, if it exists.
Return the first item in the collection that matches the given where-condition.
Return the first item in the collection that does NOT match the given where-condition.
Return the items that should exist on the given page, assuming there are perPage
many items on a single page.
Get the item at the given index in the collection. If none exists, return the fallback.
Return an object mapping key values to arrays of records with that key.
Join the items in the collection to a string delimited by the given delimiter.
Returns true if the given item is in this collection.
Return a collection of the items that exist in both this collection and this collection, (optionally) using the given key to compare.
True if the collection has no items.
True if the collection has at least one item.
Join the items in the collection to a string delimited by the given delimiter.
Convert this collection to an object keyed by the given field.
Convert this collection to an object keyed by the given field, whose values are
the output of the value
operator.
Return the last item in the collection.
Return the last item in the collection that matches the given where-condition.
Return the last item in the collection that does NOT match the given where-condition.
Create a new collection by mapping the items in this collection using the given function.
Return the max value of the given key.
Get the median value of the items or one of their keys.
Get a new collection containing both the items in this collection, and the items
collection.
Return the min value of the given key.
Get the mode of the items or one of their keys.
Return every nth item in the collection.
Add on to the end of this collection as many value
items as necessary until the collection is length
long.
Create a new collection by mapping the items in this collection using the given function, excluding any for which the function returns undefined.
Return a new Pipe of this collection.
Map the collection to a collection of the values of the key.
Remove the last item from this collection.
Add the given item to the beginning of this collection.
Like map()
, but the callback can be async.
Add the given item to the end of this collection.
Insert the given item into this collection at the specified index.
Return n
many randomly-selected items from this collection.
Reduce this collection to a single value using the given reducer function.
Return a new collection of items that fail the given truth-test function.
Return a new collection whose items are in the reverse order of the current one.
Try to find the given item in the collection. If it exists, return the index.
Remove and return the first item in the collection, if it exists.
Shuffle the items in this collection to a random order.
Return a sub-set of this collection between the given index ranges.
Returns true if the given function returns truthy for any item in the collection. Stops executing if a single truth case is found.
Sort the collection (optionally) using the given comparison function.
Sort the collection (optionally) using the given key operator.
Identical to sortBy()
, but in reverse order.
Identical to sort()
, but in reverse order.
Remove deleteCount
many items from the collection, starting at the start
index.
Return the sum of the items in the collection, optionally by key.
Return a collection of the first limit
many items in this collection.
If limit
is negative, returns the last limit
many items.
Apply the given function to this collection then return the collection. This is intended to help with chaining.
Cast the collection to an array.
Cast the collection to a JSON string, optionally specifying the replacer and indentation.
Return all distinct items in this collection. If a key is specified, returns all unique values of that key.
When bool
is falsy, execute the callback, passing in the collection.
Can be used for functional-style chained calls.
When bool
is truthy, execute the callback, passing in the collection.
Can be used for functional-style chained calls.
Filter the collection by the given where-condition.
Filter the collection for all records where the given key is in a set of items.
Return the item with the max value of the given key.
Return the item with the min value of the given key.
Filter the collection by the inverse of the given where-condition.
Filter the collection for all records where the given key is NOT in a set of items.
Create a new collection from an array of items.
Fill a new collection of the given size with the given item.
Create a new collection from an item or array of items. Filters out undefined items.
Create a collection of "undefined" elements of a given size.
extollo (v. latin) - to lift up, to elevate
Extollo is a free & libre application framework in TypeScript.
A helper class for working with arrays of items in a more robust fashion. Provides helpers for accessing sub-keys, filtering, piping, and aggregate functions.