MCPcopy
hub / github.com/webpack/webpack / batchWrite

Method batchWrite

lib/serialization/FileMiddleware.js:538–560  ·  view source on GitHub ↗
(err)

Source from the content-addressed store, hash-verified

536 * @param {(Error | null)=} err err
537 */
538 const batchWrite = (err) => {
539 // will be handled in "on" error handler
540 if (err) return;
541
542 if (i === len) {
543 stream.end();
544 return;
545 }
546
547 // queue up a batch of chunks up to the write limit
548 // end is exclusive
549 let end = i;
550 let sum = chunks[end++].length;
551 while (end < len) {
552 sum += chunks[end].length;
553 if (sum > WRITE_LIMIT_TOTAL) break;
554 end++;
555 }
556 while (i < end - 1) {
557 stream.write(chunks[i++]);
558 }
559 stream.write(chunks[i++], batchWrite);
560 };
561 batchWrite();
562 }
563 );

Callers

nothing calls this directly

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected