deep-qsort

1.0.1 • Public • Published

deep-qsort

Build Status Coverage Status npm version
NPM NPM

A node module who does recursive quick sort over a deep array.

Usage

Installation

npm i deep-qsort --save

Example

const deepSort = require('deep-qsort');
 
const ret = deepSort([4, 3, [25, 3, [9], [-1, 0], 24], 2, 13, 11, -9]);
// output: 
// [ -9, 2, 3, 4, 11, 13, [ 3, 24, 25, [ -1, 0 ], [ 9 ] ] ]
console.log(ret); 

API

deepSort(
  // Array wait to be sorted
  arr,
  // A tiny question in this problem is where we 
  // put deep arrays —— at the beginning or the end. 
  // With this param, you have choice. It means 
  // that when an array is compared with other non-array 
  // items, whether the array is always bigger. 
  // Default to `true`
  arrayIsBigger = true 
)

LICENSE

MIT

Package Sidebar

Install

npm i deep-qsort

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • maples7