ts-api-utils - v3.0.0-rc.1
    Preparing search index...

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

      Parameters

      • type: Type

      Returns type is LiteralType

      declare const type: ts.Type;

      if (typeIsLiteral(type)) {
      // ...
      }