MCPcopy
hub / github.com/feross/buffer / buildBuffer

Function buildBuffer

test/node/test-buffer-alloc.js:549–556  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

547}
548
549function buildBuffer(data) {
550 if (Array.isArray(data)) {
551 const buffer = Buffer.allocUnsafe(data.length);
552 data.forEach((v, k) => buffer[k] = v);
553 return buffer;
554 }
555 return null;
556}
557
558const x = buildBuffer([0x81, 0xa3, 0x66, 0x6f, 0x6f, 0xa3, 0x62, 0x61, 0x72]);
559

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…