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

Function createBuffer

index.js:78–86  ·  view source on GitHub ↗
(length)

Source from the content-addressed store, hash-verified

76})
77
78function createBuffer (length) {
79 if (length > K_MAX_LENGTH) {
80 throw new RangeError('The value "' + length + '" is invalid for option "size"')
81 }
82 // Return an augmented `Uint8Array` instance
83 const buf = new Uint8Array(length)
84 Object.setPrototypeOf(buf, Buffer.prototype)
85 return buf
86}
87
88/**
89 * The Buffer constructor returns instances of `Uint8Array` that have their

Callers 5

allocFunction · 0.85
allocUnsafeFunction · 0.85
fromStringFunction · 0.85
fromArrayLikeFunction · 0.85
fromObjectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…