Comparing version 3.0.0 to 4.0.0
@@ -19,2 +19,3 @@ 'use strict'; | ||
array: Symbol('array'), | ||
map: Symbol('map'), | ||
object: Symbol('object') | ||
@@ -29,2 +30,3 @@ }; | ||
[types.set]: (a, b) => compareArray([...a], [...b]), | ||
[types.map]: (a, b) => compareObject(Object.fromEntries(a), Object.fromEntries(b)), | ||
[types.number]: standardCompare, | ||
@@ -68,2 +70,5 @@ [types.object]: compareObject, | ||
} | ||
if (value instanceof Map) { | ||
return types.map; | ||
} | ||
if (Array.isArray(value)) { | ||
@@ -70,0 +75,0 @@ return types.array; |
{ | ||
"name": "sort-any", | ||
"version": "3.0.0", | ||
"version": "4.0.0", | ||
"description": "Sorts any JavaScript array in a predictable way (deep equal arrays are always sorted in the same order)", | ||
@@ -12,2 +12,5 @@ "main": "build/index.js", | ||
}, | ||
"engines": { | ||
"node": ">=12" | ||
}, | ||
"repository": { | ||
@@ -14,0 +17,0 @@ "type": "git", |
@@ -114,2 +114,3 @@ # sort-any | ||
- array | ||
- map | ||
- object (all the objects except of arrays, dates and null) | ||
@@ -141,1 +142,3 @@ - `false` is less than `true` | ||
- the set is converted to an array and the array sorting rules apply | ||
- rules of maps sorting: | ||
- the map is converted to an object (with the correspondent keys and values) and the object sorting rules apply |
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
10359
152
143