Returns the stalinsorted array.
Please consider following this project's author, Jon Schlinkert, and consider starring the project to show your ❤️ and support.
My inspiration comes from this great post about a new sorting algorithm with O(n) complexity, and I had to share it so everyone can use this for free, as Stalin wished us to share his great invention.
Install with npm:
$ npm install --save stalinsort
Works with strings or numbers.
const sort = require('stalinsort');
console.log(sort([ 10, 5, 11, 14, 12 ])); //=> [ 10, 11, 14 ]
console.log(sort([ 99, 11, 1 ])); //=> [ 99 ]
console.log(sort("Hello")); //=> false
console.log(sort(undefined)); //=> false
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Running Tests
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
$ npm install && npm test