sort-package-json
Advanced tools
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": [ |
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
22131
434