|
1 | 1 | /* eslint-disable @typescript-eslint/no-empty-interface, jsdoc/require-jsdoc */ |
2 | 2 |
|
3 | 3 | import type { Type } from 'ast-types/lib/types'; |
4 | | -import type { ExpressionKind } from 'ast-types/gen/kinds'; |
5 | 4 | import type { |
6 | 5 | ASTNode, |
7 | 6 | ArrayExpression, |
@@ -314,7 +313,25 @@ export function isEOIdentifierAction(u: unknown): u is EOIdentifierAction { |
314 | 313 | } |
315 | 314 |
|
316 | 315 | export interface EOPropertySimple extends EOProperty { |
317 | | - value: ExpressionKind; // UNSAFE: We don't check this anywhere |
| 316 | + value: |
| 317 | + | ArrayExpression |
| 318 | + | Identifier |
| 319 | + | Literal |
| 320 | + | MemberExpression |
| 321 | + | ObjectExpression |
| 322 | + | CallExpression; |
| 323 | +} |
| 324 | + |
| 325 | +export function isEOPropertySimple(u: unknown): u is EOPropertySimple { |
| 326 | + return ( |
| 327 | + isEOProperty(u) && |
| 328 | + (isNode(u.value, 'ArrayExpression') || |
| 329 | + isNode(u.value, 'Identifier') || |
| 330 | + isNode(u.value, 'Literal') || |
| 331 | + isNode(u.value, 'MemberExpression') || |
| 332 | + isNode(u.value, 'ObjectExpression') || |
| 333 | + isNode(u.value, 'CallExpression')) |
| 334 | + ); |
318 | 335 | } |
319 | 336 |
|
320 | 337 | interface EOActionInfiniteCall extends CallExpression { |
@@ -378,17 +395,6 @@ function isEOActionInfiniteLiteral( |
378 | 395 | return isNode(u, 'Literal') && (!name || u.value === name); |
379 | 396 | } |
380 | 397 |
|
381 | | -export function isEOPropertySimple(u: unknown): u is EOPropertySimple { |
382 | | - return ( |
383 | | - isEOProperty(u) && |
384 | | - (isNode(u.value, 'ArrayExpression') || |
385 | | - isNode(u.value, 'Identifier') || |
386 | | - isNode(u.value, 'Literal') || |
387 | | - isNode(u.value, 'MemberExpression') || |
388 | | - isNode(u.value, 'ObjectExpression')) |
389 | | - ); |
390 | | -} |
391 | | - |
392 | 398 | export interface EOSuperExpression extends CallExpression { |
393 | 399 | callee: EOSuperExpressionCallee; |
394 | 400 | } |
|
0 commit comments