You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

sort-package-json

Package Overview
Dependencies
Maintainers
1
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sort-package-json - npm Package Compare versions

Comparing version
3.6.0
to
3.6.1
+9
-13
index.cjs

@@ -505,16 +505,12 @@ var __create = Object.create;

var sortConditions = (conditions) => {
const {
typesConditions = [],
defaultConditions = [],
restConditions = []
} = objectGroupBy(conditions, (condition) => {
if (condition === "types" || condition.startsWith("types@")) {
return "typesConditions";
const { defaultConditions = [], restConditions = [] } = objectGroupBy(
conditions,
(condition) => {
if (condition === "default") {
return "defaultConditions";
}
return "restConditions";
}
if (condition === "default") {
return "defaultConditions";
}
return "restConditions";
});
return [...typesConditions, ...restConditions, ...defaultConditions];
);
return [...restConditions, ...defaultConditions];
};

@@ -521,0 +517,0 @@ var sortExports = onObject((exports2) => {

+10
-16

@@ -393,23 +393,17 @@ import fs from 'node:fs'

/*
- Move `types` and versioned type condition to top
- Move `default` condition to bottom
*/
const sortConditions = (conditions) => {
const {
typesConditions = [],
defaultConditions = [],
restConditions = [],
} = objectGroupBy(conditions, (condition) => {
if (condition === 'types' || condition.startsWith('types@')) {
return 'typesConditions'
}
const { defaultConditions = [], restConditions = [] } = objectGroupBy(
conditions,
(condition) => {
if (condition === 'default') {
return 'defaultConditions'
}
if (condition === 'default') {
return 'defaultConditions'
}
return 'restConditions'
},
)
return 'restConditions'
})
return [...typesConditions, ...restConditions, ...defaultConditions]
return [...restConditions, ...defaultConditions]
}

@@ -416,0 +410,0 @@

{
"name": "sort-package-json",
"version": "3.6.0",
"version": "3.6.1",
"description": "Sort an Object or package.json based on the well-known package.json keys",

@@ -5,0 +5,0 @@ "keywords": [