tsutils icon indicating copy to clipboard operation
tsutils copied to clipboard

Add is*Type for newer types such as BigInt and TemplateLiteral?

Open JoshuaKGoldberg opened this issue 3 years ago • 0 comments

In https://github.com/typescript-eslint/typescript-eslint/pull/4378/files#diff-b7600c047aa2f2fb16eafae5010267ecc7e6ab19a7a165d6a4cb860ffc0dfffa, I added the following functions:

export function isTypeBigIntLiteralType(
  type: ts.Type,
): type is ts.BigIntLiteralType {
  return isTypeFlagSet(type, ts.TypeFlags.BigIntLiteral);
}

export function isTypeTemplateLiteralType(
  type: ts.Type,
): type is ts.TemplateLiteralType {
  return isTypeFlagSet(type, ts.TypeFlags.TemplateLiteral);
}

For these types and presumably other new types, would you accept a PR adding them in? 🌹

JoshuaKGoldberg avatar Jan 02 '22 19:01 JoshuaKGoldberg