function flatten(chunks) {
  if (!chunks) return []
  if (chunks.length === 1) return chunks[0]
  /** @type {any[]} */
  const output = []
  for (const chunk of chunks) {
    concat(output, chunk)
  }
  return output
}
Flatten a list of lists into a single list.

@param {DecodedArray[]} [chunks]
@returns {DecodedArray}