Comparing version 2.0.0 to 2.0.1
@@ -20,8 +20,6 @@ export interface ISortByFunction<T> { | ||
* sort([3, 1, 4]).asc(); | ||
* sort(users).asc('firstName'); | ||
* sort(users).asc(u => u.address.zip); | ||
* sort(users).asc(u => u.firstName); | ||
* sort(users).asc([ | ||
* 'firstName', | ||
* 'lastName', | ||
* u => u.address.zip, | ||
* U => u.firstName | ||
* u => u.lastName, | ||
* ]); | ||
@@ -34,8 +32,6 @@ */ | ||
* sort([3, 1, 4]).desc(); | ||
* sort(users).desc('firstName'); | ||
* sort(users).desc(u => u.address.zip); | ||
* sort(users).desc([z | ||
* 'firstName', | ||
* 'lastName', | ||
* u => u.address.zip, | ||
* sort(users).desc(u => u.firstName); | ||
* sort(users).desc([ | ||
* U => u.firstName | ||
* u => u.lastName, | ||
* ]); | ||
@@ -49,6 +45,5 @@ */ | ||
* sort(users).by([ | ||
* { asc: 'firstName' }. | ||
* { desc: u => u.address.zip } | ||
* { asc: u => u.score } | ||
* { desc: u => u.age } | ||
* ]); | ||
* sort(users).by({ desc: 'lastName' }); | ||
*/ | ||
@@ -62,8 +57,6 @@ by(sortBy: ISortByAscSorter<T> | ISortByDescSorter<T> | ISortByObjectSorter<T>[]): T[]; | ||
* sort([3, 1, 4]).asc(); | ||
* sort(users).asc('firstName'); | ||
* sort(users).asc(u => u.address.zip); | ||
* sort(users).asc(u => u.firstName); | ||
* sort(users).asc([ | ||
* 'firstName', | ||
* 'lastName', | ||
* u => u.address.zip, | ||
* U => u.firstName | ||
* u => u.lastName, | ||
* ]); | ||
@@ -76,8 +69,6 @@ */ | ||
* sort([3, 1, 4]).desc(); | ||
* sort(users).desc('firstName'); | ||
* sort(users).desc(u => u.address.zip); | ||
* sort(users).desc([z | ||
* 'firstName', | ||
* 'lastName', | ||
* u => u.address.zip, | ||
* sort(users).desc(u => u.firstName); | ||
* sort(users).desc([ | ||
* U => u.firstName | ||
* u => u.lastName, | ||
* ]); | ||
@@ -91,6 +82,5 @@ */ | ||
* sort(users).by([ | ||
* { asc: 'firstName' }. | ||
* { desc: u => u.address.zip } | ||
* { asc: u => u.score } | ||
* { desc: u => u.age } | ||
* ]); | ||
* sort(users).by({ desc: 'lastName' }); | ||
*/ | ||
@@ -97,0 +87,0 @@ by(sortBy: ISortByAscSorter<T> | ISortByDescSorter<T> | ISortByObjectSorter<T>[]): T[]; |
@@ -81,8 +81,6 @@ // >>> HELPERS <<< | ||
* sort([3, 1, 4]).asc(); | ||
* sort(users).asc('firstName'); | ||
* sort(users).asc(u => u.address.zip); | ||
* sort(users).asc(u => u.firstName); | ||
* sort(users).asc([ | ||
* 'firstName', | ||
* 'lastName', | ||
* u => u.address.zip, | ||
* U => u.firstName | ||
* u => u.lastName, | ||
* ]); | ||
@@ -97,8 +95,6 @@ */ | ||
* sort([3, 1, 4]).desc(); | ||
* sort(users).desc('firstName'); | ||
* sort(users).desc(u => u.address.zip); | ||
* sort(users).desc([z | ||
* 'firstName', | ||
* 'lastName', | ||
* u => u.address.zip, | ||
* sort(users).desc(u => u.firstName); | ||
* sort(users).desc([ | ||
* U => u.firstName | ||
* u => u.lastName, | ||
* ]); | ||
@@ -114,6 +110,5 @@ */ | ||
* sort(users).by([ | ||
* { asc: 'firstName' }. | ||
* { desc: u => u.address.zip } | ||
* { asc: u => u.score } | ||
* { desc: u => u.age } | ||
* ]); | ||
* sort(users).by({ desc: 'lastName' }); | ||
*/ | ||
@@ -120,0 +115,0 @@ by: function (sortBy) { |
@@ -87,8 +87,6 @@ (function (global, factory) { | ||
* sort([3, 1, 4]).asc(); | ||
* sort(users).asc('firstName'); | ||
* sort(users).asc(u => u.address.zip); | ||
* sort(users).asc(u => u.firstName); | ||
* sort(users).asc([ | ||
* 'firstName', | ||
* 'lastName', | ||
* u => u.address.zip, | ||
* U => u.firstName | ||
* u => u.lastName, | ||
* ]); | ||
@@ -103,8 +101,6 @@ */ | ||
* sort([3, 1, 4]).desc(); | ||
* sort(users).desc('firstName'); | ||
* sort(users).desc(u => u.address.zip); | ||
* sort(users).desc([z | ||
* 'firstName', | ||
* 'lastName', | ||
* u => u.address.zip, | ||
* sort(users).desc(u => u.firstName); | ||
* sort(users).desc([ | ||
* U => u.firstName | ||
* u => u.lastName, | ||
* ]); | ||
@@ -120,6 +116,5 @@ */ | ||
* sort(users).by([ | ||
* { asc: 'firstName' }. | ||
* { desc: u => u.address.zip } | ||
* { asc: u => u.score } | ||
* { desc: u => u.age } | ||
* ]); | ||
* sort(users).by({ desc: 'lastName' }); | ||
*/ | ||
@@ -126,0 +121,0 @@ by: function (sortBy) { |
{ | ||
"name": "fast-sort", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Fast and powerful array sorting. Sort by any property in any direction with easy to read syntax.", | ||
@@ -12,3 +12,3 @@ "main": "dist/sort.js", | ||
"license": "MIT", | ||
"homepage": "https://github.com/snovakovic/fast-sort#readme", | ||
"homepage": "https://github.com/snovakovic/fast-sort", | ||
"scripts": { | ||
@@ -15,0 +15,0 @@ "test": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' mocha -r ts-node/register test/*.spec.ts", |
@@ -45,3 +45,3 @@ # fast-sort | ||
* Sort in multiple directions | ||
* [Natural sort](#natural-sorting-/-language-sensitive-sorting) support | ||
* [Natural sort](#natural-sorting--language-sensitive-sorting) support | ||
* Support for [custom sort](#custom-sorting) instances | ||
@@ -142,3 +142,3 @@ * Easy to read syntax | ||
// We can use `by` sort to override default comparer with the one that are doing language sensitive comparison | ||
// We can use `by` sort to override default comparer with the one that is doing language sensitive comparison | ||
sort(testArr).by({ | ||
@@ -150,3 +150,4 @@ desc: true, | ||
// If we want to reuse natural sort in multiple places we can create new sort instance | ||
// Or we can create new sort instance with language sensitive comparer. | ||
// Recommended if used in multiple places | ||
const naturalSort = sort.createNewInstance({ | ||
@@ -229,9 +230,5 @@ comparer: new Intl.Collator(undefined, { numeric: true, sensitivity: 'base' }).compare, | ||
There is no breaking changes in API between `v2` and `v1` version of library. | ||
You should be able to upgrade and take advantage of better editor support | ||
and more flexibility without any problem. | ||
Only consideration to take in mind is that some `dist` import file names have been changed. Based on how you used library there is small chance you might need to update those imports as: | ||
Some import files have been removed so if you haven't import it using default import | ||
you might need to update imports. For more info check [v2 release notes](https://github.com/snovakovic/fast-sort/releases/tag/v2.0.0) | ||
* `require('fast-sort/sort.es5')` should be updated to: `require('fast-sort')` (es5 is now default export) | ||
* `require('fast-sort/sort.es5.min')` should be updated to: `require('fast-sort/sort.min')` | ||
#### Features by version | ||
@@ -238,0 +235,0 @@ |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
29164
366
279