smart-sort

0.0.3 • Public • Published

smart-sort

sort Array in a natural way

Native sort

['a2', 'a11', 'a1'].sort()
// ["a1", "a11", "a2"]

Generally, we want ['a1', 'a2', 'a11'].And this is what our library will do it for you.

API

SmartSort.naturalSort(list, [caseInsensitive = true], [order = 'desc'])

sort Array, the original list will be affected

SmartSort.naturalSortBy(list, field, [caseInsensitive = true], [order = 'desc'])

sort Array, the original list will not be affected.use the return list

Module support

AMD / CommonJS / UMD

IE Support

IE9+ / NodeJS

IE < 9 brwoser needs es5-shim

Package Sidebar

Install

npm i smart-sort

Weekly Downloads

1

Version

0.0.3

License

MIT

Last publish

Collaborators

  • damngoto