🚀 DAY 4 OF LAUNCH WEEK:Introducing Socket Scanning for OpenVSX Extensions.Learn more →
Socket
Book a DemoInstallSign in
Socket

@cablanchard/koelle-sort

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cablanchard/koelle-sort

koelle-sort - also known as alphanum sort

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

CircleCI Coverage Status Greenkeeper badge

Koelle Sort

Also known as alphanum sort

alphanum sort is designed to produce more sensible results than ascii sort for certain use cases

ASCII SortKoelle's Alphanum Sort
z1.docz1.doc
z10.docz2.doc
z100.docz3.doc
z101.docz4.doc
z102.docz5.doc
z11.docz6.doc
z12.docz7.doc
z13.docz8.doc
z14.docz9.doc
z15.docz10.doc
z16.docz11.doc
z17.docz12.doc
z18.docz13.doc
z19.docz14.doc
z2.docz15.doc
z20.docz16.doc
z3.docz17.doc
z4.docz18.doc
z5.docz19.doc
z6.docz20.doc
z7.docz100.doc
z8.docz101.doc
z9.docz102.doc

Behaviour

Notable Unsupported Behaviour

  • Does not skip whitespace
  • Does not support numbers separated by multiple decimal points (e.g. IP Address, Semver formatting)

Usage

npm install @cablanchard/koelle-sort
const { alphanum } = require("@cablanchard/koelle-sort");

const sorted = [
	"file10.txt",
	"file1.txt",
	"file2.txt",
].sort(alphanum);

/**
 * [
 * "file1.txt",
 * "file2.txt",
 * "file10.txt",
 * ]
 */

License

Based on the alphanum algorithm developed by Dave Koelle

This implementation is MIT licensed

FAQs

Package last updated on 01 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts