Copies the contents of an immutable ArrayBuffer into a fresh
mutable Uint8Array.
Immutable ArrayBuffer instances (proposal-immutable-arraybuffer)
cannot back a Uint8Array view directly, and APIs such as
TextDecoder.decode reject them. This helper produces a working
Uint8Array copy that callers can pass to those APIs.
Accepts any ArrayBufferLike so callers do not need to narrow the
argument before invoking.
Copies the contents of an immutable
ArrayBufferinto a fresh mutableUint8Array.Immutable
ArrayBufferinstances (proposal-immutable-arraybuffer) cannot back aUint8Arrayview directly, and APIs such asTextDecoder.decodereject them. This helper produces a workingUint8Arraycopy that callers can pass to those APIs.Accepts any
ArrayBufferLikeso callers do not need to narrow the argument before invoking.