Socket
Socket
Sign inDemoInstall

sort-package-json

Package Overview
Dependencies
Maintainers
1
Versions
97
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 1.53.1 to 1.54.0

24

index.js

@@ -9,5 +9,7 @@ const sortObjectKeys = require('sort-object-keys')

Object.prototype.hasOwnProperty.call(object, property)
const pipe = (fns) => (x, ...args) =>
fns.reduce((result, fn) => fn(result, ...args), x)
const onArray = (fn) => (x) => (Array.isArray(x) ? fn(x) : x)
const pipe =
(fns) =>
(x, ...args) =>
fns.reduce((result, fn) => fn(result, ...args), x)
const onArray = (fn) => (x) => Array.isArray(x) ? fn(x) : x
const onStringArray = (fn) => (x) =>

@@ -18,3 +20,6 @@ Array.isArray(x) && x.every((item) => typeof item === 'string') ? fn(x) : x

const uniqAndSortArray = pipe([uniq, sortArray])
const onObject = (fn) => (x, ...args) => (isPlainObject(x) ? fn(x, ...args) : x)
const onObject =
(fn) =>
(x, ...args) =>
isPlainObject(x) ? fn(x, ...args) : x
const sortObjectBy = (comparator, deep) => {

@@ -44,6 +49,8 @@ const over = onObject((object) => {

])
const overProperty = (property, over) => (object, ...args) =>
hasOwnProperty(object, property)
? Object.assign(object, { [property]: over(object[property], ...args) })
: object
const overProperty =
(property, over) =>
(object, ...args) =>
hasOwnProperty(object, property)
? Object.assign(object, { [property]: over(object[property], ...args) })
: object
const sortGitHooks = sortObjectBy(gitHooks)

@@ -219,2 +226,3 @@

{ key: 'browser' },
{ key: 'react-native' },
{ key: 'types' },

@@ -221,0 +229,0 @@ { key: 'typesVersions' },

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

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

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