array<TDecoded>(condition: ArrayWhileCondition<TDecoded>): Coder<TDecoded[]>
Creates a Coder for arrays that automatically chooses between length-prefixed and fixed-length based on the arguments provided.
- If a lengthType coder is provided as the second argument, it creates a length-prefixed array
- If a length number/reference is provided as the second argument, it creates a fixed-length array
condition: ArrayWhileCondition<TDecoded>
A condition function for while-loop arrays
array<TDecoded>(lengthCoderOrLengthType: Coder<number> | LengthOrRef): Coder<TDecoded[]>
Creates a Coder for arrays that automatically chooses between length-prefixed and fixed-length based on the arguments provided.
- If a lengthType coder is provided as the second argument, it creates a length-prefixed array
- If a length number/reference is provided as the second argument, it creates a fixed-length array
lengthCoderOrLengthType: Coder<number> | LengthOrRef
Either a length coder (for length-prefixed) or length value/reference (for fixed-length)