( reader: BinaryReader, readFunction: () => TResult )
| 56 | * @returns An array of elements of type `TResult` read from the binary source using the provided `readFunction`. |
| 57 | */ |
| 58 | export function readVector<TResult>( |
| 59 | reader: BinaryReader, |
| 60 | readFunction: () => TResult |
| 61 | ): TResult[] { |
| 62 | const length = reader.readUnsignedLEB128(); |
| 63 | return Array.from({ length }).map(() => readFunction()); |
| 64 | } |
no test coverage detected