MCPcopy Index your code
hub / github.com/plotly/plotly.js / fromArrayBuffer

Function fromArrayBuffer

stackgl_modules/index.js:257–276  ·  view source on GitHub ↗
(array, byteOffset, length)

Source from the content-addressed store, hash-verified

255 return fromArrayLike(arrayView);
256}
257function fromArrayBuffer(array, byteOffset, length) {
258 if (byteOffset < 0 || array.byteLength < byteOffset) {
259 throw new RangeError('"offset" is outside of buffer bounds');
260 }
261 if (array.byteLength < byteOffset + (length || 0)) {
262 throw new RangeError('"length" is outside of buffer bounds');
263 }
264 var buf;
265 if (byteOffset === undefined && length === undefined) {
266 buf = new Uint8Array(array);
267 } else if (length === undefined) {
268 buf = new Uint8Array(array, byteOffset);
269 } else {
270 buf = new Uint8Array(array, byteOffset, length);
271 }
272
273 // Return an augmented `Uint8Array` instance
274 Object.setPrototypeOf(buf, Buffer.prototype);
275 return buf;
276}
277function fromObject(obj) {
278 if (Buffer.isBuffer(obj)) {
279 var len = checked(obj.length) | 0;

Callers 2

fromFunction · 0.85
fromArrayViewFunction · 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…