From 17eaa1737f3171e26ee666477655416ad3174112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Sun, 13 Jun 2021 22:29:41 +0200 Subject: [PATCH] feat(ast-spec): use `PunctuatorTokenToText` for `PunctuatorToken`'s `value` type --- .../src/token/PunctuatorToken/spec.ts | 64 ++----------------- 1 file changed, 4 insertions(+), 60 deletions(-) diff --git a/packages/ast-spec/src/token/PunctuatorToken/spec.ts b/packages/ast-spec/src/token/PunctuatorToken/spec.ts index 5b2ed7a31150..68156aad6638 100644 --- a/packages/ast-spec/src/token/PunctuatorToken/spec.ts +++ b/packages/ast-spec/src/token/PunctuatorToken/spec.ts @@ -1,68 +1,12 @@ import type { AST_TOKEN_TYPES } from '../../ast-token-types'; import type { BaseToken } from '../../base/BaseToken'; +import type { PunctuatorTokenToText } from './PunctuatorTokenToText'; export * from './PunctuatorTokenToText'; +type ValueOf = T[keyof T]; + export interface PunctuatorToken extends BaseToken { type: AST_TOKEN_TYPES.Punctuator; - value: - | '--' - | '-' - | '-=' - | ',' - | ';' - | ':' - | '!' - | '!=' - | '!==' - | '??' - | '??=' - | '?.' - | '?' - | '...' - | '.' - | '(' - | ')' - | '[' - | ']' - | '{' - | '}' - | '@' - | '*' - | '**' - | '**=' - | '*=' - | '/' - | '/=' - | '&' - | '&&' - | '&&=' - | '&=' - | '%' - | '%=' - | '^' - | '^=' - | '+' - | '++' - | '+=' - | '<' - | '' - | '>' - | '>=' - | '>>' - | '>>=' - | '>>>' - | '>>>=' - | '|' - | '|=' - | '||' - | '||=' - | '~'; + value: ValueOf; }