MCPcopy Index your code
hub / github.com/nodejs/node / testBytesAsyncSAB

Function testBytesAsyncSAB

test/parallel/test-stream-iter-sharedarraybuffer.js:58–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56}
57
58async function testBytesAsyncSAB() {
59 const sab = new SharedArrayBuffer(5);
60 new Uint8Array(sab).set([104, 101, 108, 108, 111]); // 'hello'
61 const data = await bytes(from(sab));
62 assert.deepStrictEqual(data, new Uint8Array([104, 101, 108, 108, 111]));
63}
64
65function testTextSyncSAB() {
66 const sab = new SharedArrayBuffer(5);

Calls 3

bytesFunction · 0.50
fromFunction · 0.50
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…