json-sort-cli 3.0.6 → 3.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/cli.js +4 -4
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.0.7](https://github.com/codsen/codsen/compare/json-sort-cli@3.0.6...json-sort-cli@3.0.7) (2023-01-06)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- replace the missing dependency ([310f982](https://github.com/codsen/codsen/commit/310f9821e7817e6b0c6267694e1167233cda76a6))
|
|
11
|
+
|
|
6
12
|
## 3.0.0 (2022-12-01)
|
|
7
13
|
|
|
8
14
|
### BREAKING CHANGES
|
package/cli.js
CHANGED
|
@@ -12,7 +12,7 @@ import pReduce from "p-reduce";
|
|
|
12
12
|
import pFilter from "p-filter";
|
|
13
13
|
import { globby } from "globby";
|
|
14
14
|
import { createRequire } from "module";
|
|
15
|
-
import
|
|
15
|
+
import { isPlainObject } from "codsen-utils";
|
|
16
16
|
import updateNotifier from "update-notifier";
|
|
17
17
|
import { traverse } from "ast-monkey-traverse";
|
|
18
18
|
import sortPackageJson, { sortOrder } from "sort-package-json";
|
|
@@ -178,7 +178,7 @@ function readSortAndWriteOverFile(oneOfPaths) {
|
|
|
178
178
|
}
|
|
179
179
|
let result;
|
|
180
180
|
|
|
181
|
-
if (
|
|
181
|
+
if (isPlainObject(parsedJson)) {
|
|
182
182
|
result = sortObj(parsedJson);
|
|
183
183
|
} else if (
|
|
184
184
|
cli.flags.arrays &&
|
|
@@ -214,7 +214,7 @@ function readSortAndWriteOverFile(oneOfPaths) {
|
|
|
214
214
|
let stringified = JSON.stringify(
|
|
215
215
|
traverse(obj, (key, val) => {
|
|
216
216
|
let current = val !== undefined ? val : key;
|
|
217
|
-
if (
|
|
217
|
+
if (isPlainObject(current)) {
|
|
218
218
|
return sortObj(current);
|
|
219
219
|
}
|
|
220
220
|
if (
|
|
@@ -240,7 +240,7 @@ function readSortAndWriteOverFile(oneOfPaths) {
|
|
|
240
240
|
oneOfPaths,
|
|
241
241
|
traverse(obj, (key, val) => {
|
|
242
242
|
let current = val !== undefined ? val : key;
|
|
243
|
-
if (
|
|
243
|
+
if (isPlainObject(current)) {
|
|
244
244
|
return sortObj(current);
|
|
245
245
|
}
|
|
246
246
|
if (
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "json-sort-cli",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.8",
|
|
4
4
|
"description": "Command line app to deep sort JSON files, retains package.json special key order",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"meow": "^11.0.0",
|
|
77
77
|
"p-filter": "^3.0.0",
|
|
78
78
|
"p-reduce": "^3.0.0",
|
|
79
|
-
"sort-package-json": "^2.
|
|
79
|
+
"sort-package-json": "^2.4.0",
|
|
80
80
|
"update-notifier": "^6.0.2"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|