• @MapTo decorator map each array value to a child relation constructor.

    Type Parameters

    • This
    • Value

    Parameters

    Returns DecoratorType<This, Value>

    class SubClass {
    _size: number

    @Count('_size')
    @Relation(PrimitiveSymbol.u8)
    data: number[]

    constructor(size: number) {
    this._size = size
    }
    }

    class TestClass {
    @MapTo([1, 2])
    @Relation(SubClass)
    field: number
    }