152 packages
@bemoje/api-util
@bemoje/args-to-array
Takes an arguments-object and returns its values in an array.
@bemoje/argv
Returns array of node-js commandline arguments
@bemoje/arr-any
Check whether a condition is true for any element of an array. The condition check is in the form of a callback.
@bemoje/array
@bemoje/arr-bubble-sort
Sort array by bubbling up bigger values to the right side. Runtime: O(n^2)
@bemoje/arr-clone
Shallow clone of provided array, 'arr'.
@bemoje/arr-clone-deep
Node library template package with full ESM support. All features available as npm scripts: Jest testing. Rollup build. Rename package - affecting all relevant files. Readme generator. Markdown and HTML API-documentation. Npm publish and version bumping.
@bemoje/arr-del
Remove an element in place from an array, if present.
@bemoje/arr-del-immutable
Immnutably remove an element from an array if it is present.
@bemoje/arr-every
Returns true if the predicate is satisfied for every element of the passed array; otherwise false.
@bemoje/arr-first-where
Return the first element of an array where the callback returns true.
@bemoje/arr-flatten
Flattens the passed array recursively.
@bemoje/arr-for-each-reverse
Iterate an array in reverse.
@bemoje/arr-get-all
Retrieve all elements in provided indexes array.
@bemoje/arr-has
Returns true if the element exists in the array
@bemoje/arr-indexes-of
Returns all indexes at which an element is found.
@bemoje/arr-index-of-first-where
Return the index of the first element of an array where the callback returns true. Returns -1 if none do.
@bemoje/arr-insertion-sort-numeric
Sorting by insertion - Look for bigger numbers on the left side. Runtime: O(n^2). It starts from the 2nd element, and it tries to find any element (to the left) that could be bigger than the current index. It will move all the elements that are bigger and
@bemoje/arr-is-empty
Determine whether an array is empty
@bemoje/arr-last-where
Return the last element of an array where the callback returns true.
@bemoje/arr-partition-index
Linear-time Partitioning. Runtime: O(n). Chooses a pivot and re-arrages the array so that everything on the left is <= pivot and everything on the right is > pivot
@bemoje/arr-quick-sort-numeric
Efficient in-place recursive sorting algorithm of numeric values. Avg. Runtime: O(n log n) | Worst: O(n^2)
@bemoje/arr-selection-sort-numeric
Selection sort array
@bemoje/arr-shuffle
Shuffle items in an array in-place. Runtime: O(n)