MCPcopy Index your code
hub / github.com/python/cpython / asUint8Array

Function asUint8Array

Platforms/emscripten/streams.mjs:102–108  ·  view source on GitHub ↗
(arg)

Source from the content-addressed store, hash-verified

100}
101
102function asUint8Array(arg) {
103 if (ArrayBuffer.isView(arg)) {
104 return new Uint8Array(arg.buffer, arg.byteOffset, arg.byteLength);
105 } else {
106 return new Uint8Array(arg);
107 }
108}
109
110const prepareBuffer = (buffer, offset, length) =>
111 asUint8Array(buffer).subarray(offset, offset + length);

Callers 1

prepareBufferFunction · 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…