@clarketm/superarray

JavaScript Array with superpowers! 💪

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
@clarketm/superarray
Minified + gzip package size for @clarketm/superarray in KB

Readme

Array

NPM release

Array with superpowers! 💪

This data structure inherit all methods and properties from the Array built-in.

Individual Module Installation

Yarn

$ yarn add @clarketm/superarray

Npm

$ npm install @clarketm/superarray --save

API

constructor(iterable: Iterable)

Construct a Array

flatMap(callback: Callback): Array

Maps each element using a mapping function, then flattens the result into a new array

Name Type Attribute Description
callback Callback callback function

flat(depth: number): Array

Creates a new array with all sub-array elements concatenated into it recursively up to the specified depth

Name Type Attribute Description
depth number flatten depth

bubbleSort(comparator: Comparator): Array

Sort using bubble sort

Name Type Attribute Description
comparator Comparator comparator function

insertionSort(comparator: Comparator): Array

Sort using insertion sort

Name Type Attribute Description
comparator Comparator comparator function

mergeSort(comparator: Comparator): Array

Sort using merge sort

Name Type Attribute Description
comparator Comparator comparator function

quickSort(comparator: Comparator): Array

Sort using quick sort

Name Type Attribute Description
comparator Comparator comparator function

selectionSort(comparator: Comparator): Array

Sort using selection sort

Name Type Attribute Description
comparator Comparator comparator function

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.