Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sort-any

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sort-any - npm Package Compare versions

Comparing version 3.0.0 to 4.0.0

5

build/index.js

@@ -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;

5

package.json
{
"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",

3

README.md

@@ -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
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc