hermes-estree 0.16.0 → 0.17.0
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.
|
@@ -28,6 +28,7 @@ import type {
|
|
|
28
28
|
ArrayPattern,
|
|
29
29
|
ArrayTypeAnnotation,
|
|
30
30
|
ArrowFunctionExpression,
|
|
31
|
+
AsExpression,
|
|
31
32
|
AssignmentExpression,
|
|
32
33
|
AssignmentPattern,
|
|
33
34
|
AwaitExpression,
|
|
@@ -236,6 +237,12 @@ interface ArrowFunctionExpression_With_expression
|
|
|
236
237
|
interface ArrowFunctionExpression_With_async extends ArrowFunctionExpression {
|
|
237
238
|
+async: $NonMaybeType<ArrowFunctionExpression['async']>;
|
|
238
239
|
}
|
|
240
|
+
interface AsExpression_With_expression extends AsExpression {
|
|
241
|
+
+expression: $NonMaybeType<AsExpression['expression']>;
|
|
242
|
+
}
|
|
243
|
+
interface AsExpression_With_typeAnnotation extends AsExpression {
|
|
244
|
+
+typeAnnotation: $NonMaybeType<AsExpression['typeAnnotation']>;
|
|
245
|
+
}
|
|
239
246
|
interface AssignmentExpression_With_operator extends AssignmentExpression {
|
|
240
247
|
+operator: $NonMaybeType<AssignmentExpression['operator']>;
|
|
241
248
|
}
|
|
@@ -1445,6 +1452,7 @@ type ExpressionSpecialSelector =
|
|
|
1445
1452
|
| MetaProperty
|
|
1446
1453
|
| ArrayExpression
|
|
1447
1454
|
| ArrowFunctionExpression
|
|
1455
|
+
| AsExpression
|
|
1448
1456
|
| AssignmentExpression
|
|
1449
1457
|
| AwaitExpression
|
|
1450
1458
|
| BinaryExpression
|
|
@@ -1514,6 +1522,11 @@ export type ESQueryNodeSelectorsWithoutFallback = {
|
|
|
1514
1522
|
+'ArrowFunctionExpression[async]'?: (
|
|
1515
1523
|
node: ArrowFunctionExpression_With_async,
|
|
1516
1524
|
) => void,
|
|
1525
|
+
+AsExpression?: (node: AsExpression) => void,
|
|
1526
|
+
+'AsExpression[expression]'?: (node: AsExpression_With_expression) => void,
|
|
1527
|
+
+'AsExpression[typeAnnotation]'?: (
|
|
1528
|
+
node: AsExpression_With_typeAnnotation,
|
|
1529
|
+
) => void,
|
|
1517
1530
|
+AssignmentExpression?: (node: AssignmentExpression) => void,
|
|
1518
1531
|
+'AssignmentExpression[operator]'?: (
|
|
1519
1532
|
node: AssignmentExpression_With_operator,
|
|
@@ -2496,6 +2509,13 @@ export type ESQueryNodeSelectorsWithoutFallback = {
|
|
|
2496
2509
|
+'ArrowFunctionExpression[async]:exit'?: (
|
|
2497
2510
|
node: ArrowFunctionExpression_With_async,
|
|
2498
2511
|
) => void,
|
|
2512
|
+
+'AsExpression:exit'?: (node: AsExpression) => void,
|
|
2513
|
+
+'AsExpression[expression]:exit'?: (
|
|
2514
|
+
node: AsExpression_With_expression,
|
|
2515
|
+
) => void,
|
|
2516
|
+
+'AsExpression[typeAnnotation]:exit'?: (
|
|
2517
|
+
node: AsExpression_With_typeAnnotation,
|
|
2518
|
+
) => void,
|
|
2499
2519
|
+'AssignmentExpression:exit'?: (node: AssignmentExpression) => void,
|
|
2500
2520
|
+'AssignmentExpression[operator]:exit'?: (
|
|
2501
2521
|
node: AssignmentExpression_With_operator,
|
|
@@ -29,6 +29,7 @@ exports.isArrayExpression = isArrayExpression;
|
|
|
29
29
|
exports.isArrayPattern = isArrayPattern;
|
|
30
30
|
exports.isArrayTypeAnnotation = isArrayTypeAnnotation;
|
|
31
31
|
exports.isArrowFunctionExpression = isArrowFunctionExpression;
|
|
32
|
+
exports.isAsExpression = isAsExpression;
|
|
32
33
|
exports.isAsKeyword = isAsKeyword;
|
|
33
34
|
exports.isAssignmentExpression = isAssignmentExpression;
|
|
34
35
|
exports.isAssignmentPattern = isAssignmentPattern;
|
|
@@ -320,6 +321,10 @@ function isArrowFunctionExpression(node) {
|
|
|
320
321
|
return node.type === 'ArrowFunctionExpression';
|
|
321
322
|
}
|
|
322
323
|
|
|
324
|
+
function isAsExpression(node) {
|
|
325
|
+
return node.type === 'AsExpression';
|
|
326
|
+
}
|
|
327
|
+
|
|
323
328
|
function isAssignmentExpression(node) {
|
|
324
329
|
return node.type === 'AssignmentExpression';
|
|
325
330
|
}
|
|
@@ -45,6 +45,10 @@ export function isArrowFunctionExpression(
|
|
|
45
45
|
return node.type === 'ArrowFunctionExpression';
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
export function isAsExpression(node: ESNode | Token): boolean %checks {
|
|
49
|
+
return node.type === 'AsExpression';
|
|
50
|
+
}
|
|
51
|
+
|
|
48
52
|
export function isAssignmentExpression(node: ESNode | Token): boolean %checks {
|
|
49
53
|
return node.type === 'AssignmentExpression';
|
|
50
54
|
}
|
package/dist/types.js.flow
CHANGED
|
@@ -398,7 +398,7 @@ export interface ComponentDeclaration extends BaseNode {
|
|
|
398
398
|
+body: BlockStatement;
|
|
399
399
|
+id: Identifier;
|
|
400
400
|
+params: $ReadOnlyArray<ComponentParameterAndRestElement>;
|
|
401
|
-
+rendersType: null |
|
|
401
|
+
+rendersType: null | TypeOperator;
|
|
402
402
|
+typeParameters: null | TypeParameterDeclaration;
|
|
403
403
|
}
|
|
404
404
|
|
|
@@ -451,6 +451,7 @@ export type Expression =
|
|
|
451
451
|
| ImportExpression
|
|
452
452
|
| ChainExpression
|
|
453
453
|
| TypeCastExpression
|
|
454
|
+
| AsExpression
|
|
454
455
|
| JSXFragment
|
|
455
456
|
| JSXElement;
|
|
456
457
|
|
|
@@ -1357,7 +1358,7 @@ export interface ComponentTypeAnnotation extends BaseNode {
|
|
|
1357
1358
|
+params: $ReadOnlyArray<ComponentTypeParameter>;
|
|
1358
1359
|
+rest: null | ComponentTypeParameter;
|
|
1359
1360
|
+typeParameters: null | TypeParameterDeclaration;
|
|
1360
|
-
+rendersType: null |
|
|
1361
|
+
+rendersType: null | TypeOperator;
|
|
1361
1362
|
}
|
|
1362
1363
|
export interface ComponentTypeParameter extends BaseNode {
|
|
1363
1364
|
+type: 'ComponentTypeParameter';
|
|
@@ -1487,6 +1488,11 @@ export interface TypeCastExpression extends BaseNode {
|
|
|
1487
1488
|
+expression: Expression;
|
|
1488
1489
|
+typeAnnotation: TypeAnnotation;
|
|
1489
1490
|
}
|
|
1491
|
+
export interface AsExpression extends BaseNode {
|
|
1492
|
+
+type: 'AsExpression';
|
|
1493
|
+
+expression: Expression;
|
|
1494
|
+
+typeAnnotation: TypeAnnotation;
|
|
1495
|
+
}
|
|
1490
1496
|
|
|
1491
1497
|
interface BaseInterfaceNode extends BaseNode {
|
|
1492
1498
|
+body: ObjectTypeAnnotation;
|
|
@@ -1655,7 +1661,7 @@ export interface DeclareComponent extends BaseNode {
|
|
|
1655
1661
|
+params: Array<ComponentTypeParameter>;
|
|
1656
1662
|
+rest: null | ComponentTypeParameter;
|
|
1657
1663
|
+typeParameters: null | TypeParameterDeclaration;
|
|
1658
|
-
+rendersType: null |
|
|
1664
|
+
+rendersType: null | TypeOperator;
|
|
1659
1665
|
}
|
|
1660
1666
|
|
|
1661
1667
|
export interface DeclareVariable extends BaseNode {
|