Skip to content

Commit

Permalink
chore: Remove meaningless typeof undefined (#15395)
Browse files Browse the repository at this point in the history
remove
  • Loading branch information
liuxingbaoyu committed Feb 2, 2023
1 parent 41aac8b commit 91b24d5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/babel-parser/src/plugins/typescript/index.ts
Expand Up @@ -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";
Expand Down Expand Up @@ -1790,7 +1788,7 @@ export default (superClass: ClassWithMixin<typeof Parser, IJSXParserMixin>) =>
}
}

tsEatThenParseType(token: TokenType): N.TsType | typeof undefined {
tsEatThenParseType(token: TokenType): N.TsType | undefined {
return !this.match(token) ? undefined : this.tsNextThenParseType();
}

Expand Down

0 comments on commit 91b24d5

Please sign in to comment.