@putout/printer 18.2.4 → 18.2.5
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
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
isInsideArray,
|
|
14
14
|
} from '#is';
|
|
15
15
|
|
|
16
|
-
const isZero = (
|
|
16
|
+
const isZero = (length) => !length;
|
|
17
17
|
|
|
18
18
|
const isParentProperty = (path) => path.find(isObjectProperty);
|
|
19
19
|
|
|
@@ -203,7 +203,7 @@ const isBodyWithOneElement = createTypeChecker([
|
|
|
203
203
|
]);
|
|
204
204
|
|
|
205
205
|
export const isMultiLine = createTypeChecker([
|
|
206
|
-
['
|
|
206
|
+
['-: node.elements.length', isZero],
|
|
207
207
|
['+', isBodyWithOneElement],
|
|
208
208
|
['+', isMoreThenMaxElementLengthInOneLine],
|
|
209
209
|
['+', isElementsMoreThenMaxWithFirstString],
|
|
@@ -3,6 +3,8 @@ import {instrument as _instrument} from '#type-checker/instrument';
|
|
|
3
3
|
import {parseOperation, parseTypeNames} from './parsers.js';
|
|
4
4
|
import {equal, maybeCall} from './comparators.js';
|
|
5
5
|
|
|
6
|
+
const isUndefined = (a) => typeof a === 'undefined';
|
|
7
|
+
|
|
6
8
|
const SKIP = [
|
|
7
9
|
Infinity,
|
|
8
10
|
false,
|
|
@@ -22,12 +24,10 @@ export const createTypeChecker = (typeNames, overrides = {}) => {
|
|
|
22
24
|
if (selector)
|
|
23
25
|
currentPath = jessy(selector, path);
|
|
24
26
|
|
|
25
|
-
if (
|
|
27
|
+
if (isUndefined(currentPath))
|
|
26
28
|
return SKIP;
|
|
27
29
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (equal(not, type, typeName))
|
|
30
|
+
if (currentPath && equal(not, currentPath.type, typeName))
|
|
31
31
|
return [index, result];
|
|
32
32
|
|
|
33
33
|
if (maybeCall(typeName, not, currentPath, options))
|
package/package.json
CHANGED