MCPcopy Index your code
hub / github.com/nodejs/node / fixBufferList

Function fixBufferList

lib/dgram.js:662–678  ·  view source on GitHub ↗
(list)

Source from the content-addressed store, hash-verified

660
661
662function fixBufferList(list) {
663 const newlist = new Array(list.length);
664
665 for (let i = 0, l = list.length; i < l; i++) {
666 const buf = list[i];
667 if (typeof buf === 'string')
668 newlist[i] = Buffer.from(buf);
669 else if (Buffer.isBuffer(buf))
670 newlist[i] = buf;
671 else if (!isArrayBufferView(buf))
672 return null;
673 else
674 newlist[i] = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
675 }
676
677 return newlist;
678}
679
680
681function enqueue(self, toEnqueue) {

Callers 1

dgram.jsFile · 0.85

Calls 1

fromMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…