TS's type.isLiteral() is bugged before TS v5.0 and won't return true for bigint literals. Use this function instead if you need to check for bigint literals in TS versions before v5.0. Otherwise, you should just use type.isLiteral().
type.isLiteral()
true
https://github.com/microsoft/TypeScript/pull/50929
declare const type: ts.Type;if (typeIsLiteral(type)) { // ...} Copy
declare const type: ts.Type;if (typeIsLiteral(type)) { // ...}
TS's
type.isLiteral()is bugged before TS v5.0 and won't returntruefor bigint literals. Use this function instead if you need to check for bigint literals in TS versions before v5.0. Otherwise, you should just usetype.isLiteral().