Comparing version 1.3.0 to 1.4.0
@@ -1,1 +0,1 @@ | ||
{"name":"fast-sort","version":"1.3.0","description":"Blazing fast array sorting.","main":"sort.js","author":"Stefan Novakovic <stefan.novakovich@gmail.com>","license":"MIT","homepage":"https://github.com/snovakovic/fast-sort#readme","scripts":{"test":"node integration_test/index.js","publish":"node publish"},"repository":{"type":"git","url":"git+https://github.com/snovakovic/js-flock.git"},"bugs":{"url":"https://github.com/snovakovic/js-flock/issues"},"keywords":["sort","sortBy","order","orderBy"]} | ||
{"name":"fast-sort","version":"1.4.0","description":"Blazing fast array sorting.","main":"sort.js","author":"Stefan Novakovic <stefan.novakovich@gmail.com>","license":"MIT","homepage":"https://github.com/snovakovic/fast-sort#readme","scripts":{"test":"node integration_test/index.js","publish":"node publish"},"repository":{"type":"git","url":"git+https://github.com/snovakovic/js-flock.git"},"bugs":{"url":"https://github.com/snovakovic/js-flock/issues"},"keywords":["sort","sortBy","order","orderBy"]} |
@@ -57,7 +57,12 @@ # fast-sort | ||
// Sort in multiple directions | ||
// NOTE: Available from version [1.4.0] | ||
sort(persons).by([ | ||
{ asc: 'name' } | ||
{ desc: 'age' } | ||
{ asc: p => p.address.city } | ||
]); | ||
// Sort by any custom logic e.g sort vip users first | ||
sort(users).asc([ | ||
u => u.tags === 'vip' ? 1 : -1, // Sort users that have vip tag to the top | ||
u => u.firstName // users with vip tag will be sorted by firstName | ||
]) | ||
sort(users).asc(u => u.tags === 'vip' ? 1 : -1); | ||
@@ -64,0 +69,0 @@ // Sorting values that are not sortable will return same value back |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9051
105