1.0.1 • Published 7 years ago

deep-qsort v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

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