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

Function fromArrayLike

lib/buffer.js:554–568  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

552}
553
554function fromArrayLike(obj) {
555 const { length } = obj;
556 if (length <= 0)
557 return new FastBuffer();
558 if (length < (Buffer.poolSize >>> 1)) {
559 if (length > (poolSize - poolOffset))
560 createPool();
561 const b = new FastBuffer(allocPool, poolOffset, length);
562 TypedArrayPrototypeSet(b, obj, 0);
563 poolOffset += length;
564 alignPool();
565 return b;
566 }
567 return new FastBuffer(obj);
568}
569
570function fromObject(obj) {
571 if (obj.length !== undefined || isAnyArrayBuffer(obj.buffer)) {

Callers 2

buffer.jsFile · 0.85
fromObjectFunction · 0.85

Calls 2

createPoolFunction · 0.85
alignPoolFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…