Documentation
    Preparing search index...

    Class Collection<Transformer, Depth, Variant>

    Represents a collection of transformers created for an array of source data.

    Type Parameters

    • Transformer extends Record<string, any>
    • Depth extends number
    • Variant extends string
    Index

    Constructors

    Properties

    Methods

    Constructors

    • Type Parameters

      • Transformer extends Record<string, any>
      • Depth extends number
      • Variant extends string

      Parameters

      • transformerData: undefined | any[]
      • transformer: new (...args: any[]) => Transformer
      • maxDepth: Depth
      • variant: Variant
      • debuggingError: RuntimeException

      Returns Collection<Transformer, Depth, Variant>

    Properties

    $type: "collection" = 'collection'

    Methods

    • Specify the depth of relationships to be resolved when creating the object tree.

      Type Parameters

      • T extends 1 | 2 | 3 | 4 | 5 | 6

      Parameters

      • value: T

      Returns Collection<Transformer, T, Variant>

    • Transforms the resources collection to plain JSON objects. The maxDepth and depth properties can be specified when transforming the collection as a relationship.

      Parameters

      • container: ContainerResolver<any>
      • depth: number
      • OptionalmaxDepth: number

      Returns Promise<InferData<Transformer, Variant>[]>