(array, byteOffset, length)
| 113023 | return fromArrayLike(arrayView); |
| 113024 | } |
| 113025 | function fromArrayBuffer(array, byteOffset, length) { |
| 113026 | if (byteOffset < 0 || array.byteLength < byteOffset) throw new RangeError('"offset" is outside of buffer bounds'); |
| 113027 | if (array.byteLength < byteOffset + (length || 0)) throw new RangeError('"length" is outside of buffer bounds'); |
| 113028 | var buf; |
| 113029 | if (byteOffset === undefined && length === undefined) buf = new Uint8Array(array); |
| 113030 | else if (length === undefined) buf = new Uint8Array(array, byteOffset); |
| 113031 | else buf = new Uint8Array(array, byteOffset, length); |
| 113032 | // Return an augmented `Uint8Array` instance |
| 113033 | Object.setPrototypeOf(buf, Buffer.prototype); |
| 113034 | return buf; |
| 113035 | } |
| 113036 | function fromObject(obj) { |
| 113037 | if (Buffer.isBuffer(obj)) { |
| 113038 | var len = checked(obj.length) | 0; |
no outgoing calls
no test coverage detected