Function typeIsLiteral

  • 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().

    See https://github.com/microsoft/TypeScript/pull/50929

    Parameters

    • type: Type

    Returns type is LiteralType