MCPcopy Index your code
hub / github.com/SocketCluster/socketcluster / fromArrayBuffer

Function fromArrayBuffer

app/public/socketcluster-client.js:2881–2902  ·  view source on GitHub ↗
(array, byteOffset, length)

Source from the content-addressed store, hash-verified

2879}
2880
2881function fromArrayBuffer (array, byteOffset, length) {
2882 if (byteOffset < 0 || array.byteLength < byteOffset) {
2883 throw new RangeError('"offset" is outside of buffer bounds')
2884 }
2885
2886 if (array.byteLength < byteOffset + (length || 0)) {
2887 throw new RangeError('"length" is outside of buffer bounds')
2888 }
2889
2890 var buf
2891 if (byteOffset === undefined && length === undefined) {
2892 buf = new Uint8Array(array)
2893 } else if (length === undefined) {
2894 buf = new Uint8Array(array, byteOffset)
2895 } else {
2896 buf = new Uint8Array(array, byteOffset, length)
2897 }
2898
2899 // Return an augmented `Uint8Array` instance
2900 buf.__proto__ = Buffer.prototype
2901 return buf
2902}
2903
2904function fromObject (obj) {
2905 if (Buffer.isBuffer(obj)) {

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…