feat(ast): add TSType::TSIntrinsicKeyword to is_keyword (#3775)

follow up #3767
This commit is contained in:
Dunqing 2024-06-19 16:00:57 +00:00
parent 7c44703a4c
commit 4b06dc72ae

View file

@ -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(_)
)
}