import type {Decoder} from '../../type/decoder.js'; import type {Decoding} from '../../type/decoding.js'; import {listDecoder} from '../list/list-decoder.js'; function arrayAppend(array: T[], item: T): void { array.push(item); } export function arrayDecoder(decoder: Decoder): Decoding { return listDecoder([], decoder, arrayAppend); }