}
if (ArrayBuffer.isView(value)) {
- return fromArrayLike(value)
+ return fromArrayView(value)
}
if (value == null) {
return buf
}
+function fromArrayView (arrayView) {
+ if (isInstance(arrayView, Uint8Array)) {
+ var copy = Uint8Array.from(arrayView)
+ return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)
+ }
+ return fromArrayLike(arrayView)
+}
+
function fromArrayBuffer (array, byteOffset, length) {
if (byteOffset < 0 || array.byteLength < byteOffset) {
throw new RangeError('"offset" is outside of buffer bounds')