From 91b24d5d556257c547da9411011d77b49a77ca7f Mon Sep 17 00:00:00 2001 From: liuxingbaoyu <30521560+liuxingbaoyu@users.noreply.github.com> Date: Thu, 2 Feb 2023 18:42:57 +0800 Subject: [PATCH] chore: Remove meaningless `typeof undefined` (#15395) remove --- packages/babel-parser/src/plugins/typescript/index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/babel-parser/src/plugins/typescript/index.ts b/packages/babel-parser/src/plugins/typescript/index.ts index 5ef8e86129ad..e781b07987be 100644 --- a/packages/babel-parser/src/plugins/typescript/index.ts +++ b/packages/babel-parser/src/plugins/typescript/index.ts @@ -238,9 +238,7 @@ const TSErrors = ParseErrorEnum`typescript`({ // Doesn't handle "void" or "null" because those are keywords, not identifiers. // It also doesn't handle "intrinsic", since usually it's not a keyword. -function keywordTypeFromName( - value: string, -): N.TsKeywordTypeType | typeof undefined { +function keywordTypeFromName(value: string): N.TsKeywordTypeType | undefined { switch (value) { case "any": return "TSAnyKeyword"; @@ -1790,7 +1788,7 @@ export default (superClass: ClassWithMixin) => } } - tsEatThenParseType(token: TokenType): N.TsType | typeof undefined { + tsEatThenParseType(token: TokenType): N.TsType | undefined { return !this.match(token) ? undefined : this.tsNextThenParseType(); }