Skip to content

SiZapPaaiGwat/smart-sort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

sort Array in a natural way

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published