* Append normalized transform result batches to an array (sync). * @param {Array } target * @param {*} result
(target, result)
| 285 | * @param {*} result |
| 286 | */ |
| 287 | function appendTransformResultSync(target, result) { |
| 288 | if (result === null) { |
| 289 | return; |
| 290 | } |
| 291 | if (isUint8ArrayBatch(result)) { |
| 292 | if (result.length > 0) { |
| 293 | ArrayPrototypePush(target, result); |
| 294 | } |
| 295 | return; |
| 296 | } |
| 297 | if (isUint8Array(result)) { |
| 298 | ArrayPrototypePush(target, [result]); |
| 299 | return; |
| 300 | } |
| 301 | if (typeof result === 'string') { |
| 302 | ArrayPrototypePush(target, [toUint8Array(result)]); |
| 303 | return; |
| 304 | } |
| 305 | if (isAnyArrayBuffer(result)) { |
| 306 | ArrayPrototypePush(target, [new Uint8Array(result)]); |
| 307 | return; |
| 308 | } |
| 309 | if (ArrayBufferIsView(result)) { |
| 310 | ArrayPrototypePush(target, [arrayBufferViewToUint8Array(result)]); |
| 311 | return; |
| 312 | } |
| 313 | for (const batch of processTransformResultSync(result)) { |
| 314 | ArrayPrototypePush(target, batch); |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | /** |
| 319 | * Process transform result (async). |
no test coverage detected
searching dependent graphs…