Nog CLI Developer Guide - v0.11.1
    Preparing search index...

    Utility class for building complex TypeScript expressions (objects, arrays, functions). Designed to be injected via DI.

    Index

    Constructors

    Methods

    • Creates an array literal expression.

      Parameters

      • elements: Expression[]

        Array of AST Expressions.

      Returns ArrayLiteralExpression

      [elem1, elem2]
      
    • Creates an arrow function that returns an identifier.

      Parameters

      • identifierName: string

      Returns ArrowFunction

      () => GuardDogTraits
      
    • Creates a numeric literal, wrapping negative values in a unary minus. ts.factory.createNumericLiteral asserts on negative input, so the sign has to be modelled as a prefix expression rather than baked into the literal.

      Parameters

      • value: number

      Returns Expression

    • Creates an object literal expression.

      Parameters

      • props: Record<string, ts.Expression>

        A map of key-value pairs where values are AST Expressions.

      Returns ObjectLiteralExpression

      { keepDiscriminatorProperty: true }