Skip to content

Commit

Permalink
feat(ast): add TSType::TSIntrinsicKeyword to is_keyword (#3775)
Browse files Browse the repository at this point in the history
follow up #3767
  • Loading branch information
Dunqing committed Jun 19, 2024
1 parent 7c44703 commit 4b06dc7
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions crates/oxc_ast/src/ast/ts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,22 +266,13 @@ impl<'a> TSType<'a> {
}
}

#[rustfmt::skip]
pub fn is_keyword(&self) -> bool {
matches!(
self,
TSType::TSAnyKeyword(_)
| TSType::TSBigIntKeyword(_)
| TSType::TSBooleanKeyword(_)
| TSType::TSNeverKeyword(_)
| TSType::TSNullKeyword(_)
| TSType::TSNumberKeyword(_)
| TSType::TSObjectKeyword(_)
| TSType::TSStringKeyword(_)
| TSType::TSSymbolKeyword(_)
| TSType::TSThisType(_)
| TSType::TSUndefinedKeyword(_)
| TSType::TSUnknownKeyword(_)
| TSType::TSVoidKeyword(_)
matches!(self, TSType::TSAnyKeyword(_) | TSType::TSBigIntKeyword(_) | TSType::TSBooleanKeyword(_)
| TSType::TSNeverKeyword(_) | TSType::TSNullKeyword(_) | TSType::TSNumberKeyword(_)
| TSType::TSObjectKeyword(_) | TSType::TSStringKeyword(_)| TSType::TSVoidKeyword(_)
| TSType::TSIntrinsicKeyword(_) | TSType::TSSymbolKeyword(_) | TSType::TSThisType(_)
| TSType::TSUndefinedKeyword(_) | TSType::TSUnknownKeyword(_)
)
}

Expand Down

0 comments on commit 4b06dc7

Please sign in to comment.