@putout/printer 18.2.5 → 18.2.6
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
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {isNextObject
|
|
1
|
+
import {isNextObject} from '#is';
|
|
2
|
+
import {createTypeChecker} from '#type-checker';
|
|
2
3
|
|
|
3
4
|
const SIMPLE_TYPES = [
|
|
4
5
|
'ArrayExpression',
|
|
@@ -9,11 +10,9 @@ const SIMPLE_TYPES = [
|
|
|
9
10
|
'NewExpression',
|
|
10
11
|
];
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return SIMPLE_TYPES.includes(type);
|
|
19
|
-
};
|
|
13
|
+
const isSimpleType = ({type}) => SIMPLE_TYPES.includes(type);
|
|
14
|
+
|
|
15
|
+
export const isObjectAfterSimple = createTypeChecker([
|
|
16
|
+
['-: -> !', isNextObject],
|
|
17
|
+
['+', isSimpleType],
|
|
18
|
+
]);
|
|
@@ -13,8 +13,6 @@ import {
|
|
|
13
13
|
isInsideArray,
|
|
14
14
|
} from '#is';
|
|
15
15
|
|
|
16
|
-
const isZero = (length) => !length;
|
|
17
|
-
|
|
18
16
|
const isParentProperty = (path) => path.find(isObjectProperty);
|
|
19
17
|
|
|
20
18
|
const isNumbersArray = createTypeChecker([
|
|
@@ -203,7 +201,7 @@ const isBodyWithOneElement = createTypeChecker([
|
|
|
203
201
|
]);
|
|
204
202
|
|
|
205
203
|
export const isMultiLine = createTypeChecker([
|
|
206
|
-
['-: node.elements.length',
|
|
204
|
+
['-: node.elements.length -> !', Boolean],
|
|
207
205
|
['+', isBodyWithOneElement],
|
|
208
206
|
['+', isMoreThenMaxElementLengthInOneLine],
|
|
209
207
|
['+', isElementsMoreThenMaxWithFirstString],
|
package/lib/tokenize/is.js
CHANGED
|
@@ -65,10 +65,6 @@ export const isNextObject = (a) => a
|
|
|
65
65
|
.getNextSibling()
|
|
66
66
|
.isObjectExpression();
|
|
67
67
|
|
|
68
|
-
export const isPrevObject = (a) => a
|
|
69
|
-
.getPrevSibling()
|
|
70
|
-
.isObjectExpression();
|
|
71
|
-
|
|
72
68
|
export const isFirst = (path) => path.node === path.parentPath.node.body?.[0];
|
|
73
69
|
export const isPrevBody = (path) => path
|
|
74
70
|
.getPrevSibling()
|
package/package.json
CHANGED