2.2.0 • Published 2 years ago

natural-sort-by-key v2.2.0

Weekly downloads
17
License
ISC
Repository
github
Last release
2 years ago

natural-sort-by-key

Sort array of objects by natural, human, alphanumeric order. Natural sort order is an ordering of strings in alphabetical order, except that multi-digit numbers are ordered as a single character.

$> npm i natural-sort-by-key

const byKey = require('natural-sort-by-key');
list.sort( byKey('flarp') )

Where list is an array of objects

let list = [
  {flarp: '10 Baz'},
  {flarp: '100 Baz'},
  {flarp: '20 Baz'},
]

More at Wikipedia

2.2.0

2 years ago

2.1.0

3 years ago

1.1.1

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

1.1.0

5 years ago

1.0.1

6 years ago