putout 36.0.1 → 36.0.3
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 +15 -0
- package/lib/cli/index.js +1 -1
- package/lib/merge.js +16 -4
- package/package.json +2 -2
package/ChangeLog
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
2024.07.19, v36.0.3
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- d6ac432fc putout: @putout/cli-validate-args v2.0.0
|
|
5
|
+
- 00dc4ae46 @putout/cli-validate-args: convert to ESM
|
|
6
|
+
- 14e951e58 @putout/cli-validate-args: drop support of 🐊 < 36
|
|
7
|
+
- dcfb1bb27 @putout/cli-validate-args: just-kebab-case v4.2.0
|
|
8
|
+
- 109c8dd57 @putout/engine-parser: hermes-parser v0.23.0
|
|
9
|
+
- 8f5dba57f @putout/codemod-convert-pascal-to-camel: just-camel-case v6.2.0
|
|
10
|
+
|
|
11
|
+
2024.07.19, v36.0.2
|
|
12
|
+
|
|
13
|
+
feature:
|
|
14
|
+
- 04f19efba putout: merge: printer (#213)
|
|
15
|
+
|
|
1
16
|
2024.07.18, v36.0.1
|
|
2
17
|
|
|
3
18
|
feature:
|
package/lib/cli/index.js
CHANGED
|
@@ -15,7 +15,6 @@ const {
|
|
|
15
15
|
defaultProcessors,
|
|
16
16
|
} = require('@putout/engine-processor');
|
|
17
17
|
|
|
18
|
-
const validateArgs = require('@putout/cli-validate-args');
|
|
19
18
|
const {createCache} = require('@putout/cli-cache');
|
|
20
19
|
const keyPress = require('@putout/cli-keypress');
|
|
21
20
|
|
|
@@ -113,6 +112,7 @@ module.exports = async ({argv, halt, log, write, logError, readFile, writeFile,
|
|
|
113
112
|
...argvConfig.number,
|
|
114
113
|
];
|
|
115
114
|
|
|
115
|
+
const {validateArgs} = await import('@putout/cli-validate-args');
|
|
116
116
|
const validationError = await validateArgs(args, optionsList);
|
|
117
117
|
|
|
118
118
|
if (validationError)
|
package/lib/merge.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const deepmerge = require('deepmerge');
|
|
4
|
+
|
|
4
5
|
const {isArray} = Array;
|
|
6
|
+
const isObject = (a) => typeof a === 'object';
|
|
5
7
|
const isNested = (a) => isArray(a[0]) && a[0].length > 1;
|
|
8
|
+
const isStringObjectTuple = (a) => isArray(a) && isString(a[0]) && isObject(a[1]);
|
|
6
9
|
|
|
7
10
|
const isString = (a) => typeof a === 'string';
|
|
8
11
|
const arrayUnion = (a, b) => {
|
|
@@ -12,10 +15,19 @@ const arrayUnion = (a, b) => {
|
|
|
12
15
|
if (isNested(a))
|
|
13
16
|
return a;
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
let flatten = [];
|
|
19
|
+
|
|
20
|
+
if (isStringObjectTuple(a) && isStringObjectTuple(b))
|
|
21
|
+
flatten = [
|
|
22
|
+
a[0],
|
|
23
|
+
b[0],
|
|
24
|
+
deepmerge(a[1], b[1]),
|
|
25
|
+
];
|
|
26
|
+
else
|
|
27
|
+
flatten = [
|
|
28
|
+
...a,
|
|
29
|
+
...b,
|
|
30
|
+
].flat();
|
|
19
31
|
|
|
20
32
|
return mergeIgnore(Array.from(new Set(flatten)));
|
|
21
33
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "putout",
|
|
3
|
-
"version": "36.0.
|
|
3
|
+
"version": "36.0.3",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "🐊 Pluggable and configurable code transformer with built-in ESLint, Babel and support of js, jsx, typescript, flow, markdown, yaml and json",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@putout/cli-match": "^2.0.0",
|
|
59
59
|
"@putout/cli-ruler": "^3.0.0",
|
|
60
60
|
"@putout/cli-staged": "^1.0.0",
|
|
61
|
-
"@putout/cli-validate-args": "^
|
|
61
|
+
"@putout/cli-validate-args": "^2.0.0",
|
|
62
62
|
"@putout/compare": "^14.0.0",
|
|
63
63
|
"@putout/engine-loader": "^13.0.0",
|
|
64
64
|
"@putout/engine-parser": "^10.0.0",
|