* Convert an array of chunks (strings or Uint8Arrays) to a Uint8Array[]. * Always returns a fresh copy of the array. * @param {Array } chunks * @returns {Uint8Array[]}
(chunks)
| 169 | * @returns {Uint8Array[]} |
| 170 | */ |
| 171 | function convertChunks(chunks) { |
| 172 | if (allUint8Array(chunks)) { |
| 173 | return ArrayPrototypeSlice(chunks); |
| 174 | } |
| 175 | const len = chunks.length; |
| 176 | const result = new Array(len); |
| 177 | for (let i = 0; i < len; i++) { |
| 178 | result[i] = toUint8Array(chunks[i]); |
| 179 | } |
| 180 | return result; |
| 181 | } |
| 182 | |
| 183 | /** |
| 184 | * Wrap a caught value as an Error, converting non-Error values. |
no test coverage detected
searching dependent graphs…