Comparing version 3.0.1 to 3.0.2
{ | ||
"name": "fast-sort", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "Fast and powerful array sorting. Sort by any property in any direction with easy to read syntax.", | ||
@@ -5,0 +5,0 @@ "main": "dist/sort.min.js", |
@@ -25,6 +25,6 @@ # fast-sort | ||
// Sort users (array of objects) by firstName in descending order | ||
sort(users).desc(u => u.firstName); | ||
const sorted = sort(users).desc(u => u.firstName); | ||
// Sort users in ascending order by firstName and lastName | ||
sort(users).asc([ | ||
const sorted = sort(users).asc([ | ||
u => u.firstName, | ||
@@ -35,3 +35,3 @@ u => u.lastName | ||
// Sort users ascending by firstName and descending by city | ||
sort(users).by([ | ||
const sorted = sort(users).by([ | ||
{ asc: u => u.firstName }, | ||
@@ -42,10 +42,10 @@ { desc: u => u.address.city } | ||
// Sort based on computed property | ||
sort(repositories).desc(r => r.openIssues + r.closedIssues); | ||
const sorted = sort(repositories).desc(r => r.openIssues + r.closedIssues); | ||
// Sort using string for object key | ||
// Only available for root object properties | ||
sort(users).asc('firstName'); | ||
const sorted = sort(users).asc('firstName'); | ||
``` | ||
Fore even more examples check [unit tests](https://github.com/snovakovic/fast-sort/blob/master/test/sort.spec.ts). | ||
Fore more examples check [unit tests](https://github.com/snovakovic/fast-sort/blob/master/test/sort.spec.ts). | ||
@@ -52,0 +52,0 @@ ## Highlights |
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
33923