MCPcopy Create free account
hub / github.com/UI5/webcomponents / fromArrayBuffer

Function fromArrayBuffer

packages/main/test/pages/diffable-html.js:359–380  ·  view source on GitHub ↗
(array, byteOffset, length)

Source from the content-addressed store, hash-verified

357 }
358
359 function fromArrayBuffer (array, byteOffset, length) {
360 if (byteOffset < 0 || array.byteLength < byteOffset) {
361 throw new RangeError('"offset" is outside of buffer bounds')
362 }
363
364 if (array.byteLength < byteOffset + (length || 0)) {
365 throw new RangeError('"length" is outside of buffer bounds')
366 }
367
368 var buf
369 if (byteOffset === undefined && length === undefined) {
370 buf = new Uint8Array(array)
371 } else if (length === undefined) {
372 buf = new Uint8Array(array, byteOffset)
373 } else {
374 buf = new Uint8Array(array, byteOffset, length)
375 }
376
377 // Return an augmented `Uint8Array` instance
378 buf.__proto__ = Buffer.prototype
379 return buf
380 }
381
382 function fromObject (obj) {
383 if (Buffer.isBuffer(obj)) {

Callers 1

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