Javascript – splice/shift first n bytes of AsyncIterable<Uint8Array>
reading the first n bytes of a byte stream (in form of a AsyncIterable) feels cumbersome and error prone. Is there a better way to implement this? async function shift( length: number, stream: AsyncIterable<Uint8Array> ): Promise<[Uint8Array, AsyncIterable<Uint8Array>]> { const prefix…