New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sort-package-json

Package Overview
Dependencies
Maintainers
1
Versions
102
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 2.12.0 to 2.13.0

21

index.js

@@ -251,6 +251,21 @@ import sortObjectKeys from 'sort-object-keys'

const order = keys.flatMap((key) =>
prefixable.has(key) ? [`pre${key}`, key, `post${key}`] : [key],
)
const scriptsKeyMap = new Map()
keys
.flatMap((key) =>
prefixable.has(key) ? [`pre${key}`, key, `post${key}`] : [key],
)
.forEach((key) => {
const [prefix] = key.split(':')
const keySet = scriptsKeyMap.has(prefix)
? scriptsKeyMap.get(prefix)
: new Set()
scriptsKeyMap.set(prefix, keySet.add(key))
})
const order = [...scriptsKeyMap.values()].flat().reduce((keys, keySet) => {
keys.push(...keySet)
return keys
}, [])
return sortObjectKeys(scripts, order)

@@ -257,0 +272,0 @@ })

2

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

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

Sorry, the diff of this file is too big to display

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