We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ddc97cf commit 82f855fCopy full SHA for 82f855f
__test__/objects.spec.ts
@@ -37,6 +37,14 @@ describe("Binarypack", () => {
37
expect(await packAndUnpack(undefined)).toEqual(undefined);
38
});
39
40
+ it("should transfer Uint8Array views correctly", async () => {
41
+ const arr = new Uint8Array(8);
42
+ for (let i = 0; i < 8; i++) arr[i] = i;
43
+ const v = new Uint8Array(arr.buffer, 4); // Half the array
44
+
45
+ expect(new Uint8Array(await packAndUnpack<ArrayBuffer>(v))).toEqual(v);
46
+ });
47
48
it("should transfer Uint8Array as ArrayBuffer", async () => {
49
const values = [
50
new Uint8Array(),
0 commit comments