MCPcopy Create free account
hub / github.com/microsoft/SandDance / fromArrayView

Function fromArrayView

docs/app/js/sanddance-app.js:113018–113024  ·  view source on GitHub ↗
(arrayView)

Source from the content-addressed store, hash-verified

113016 return buf;
113017}
113018function fromArrayView(arrayView) {
113019 if (isInstance(arrayView, Uint8Array)) {
113020 var copy = new Uint8Array(arrayView);
113021 return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength);
113022 }
113023 return fromArrayLike(arrayView);
113024}
113025function 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');

Callers 1

fromFunction · 0.70

Calls 3

isInstanceFunction · 0.70
fromArrayBufferFunction · 0.70
fromArrayLikeFunction · 0.70

Tested by

no test coverage detected