arrays_unchunked.js 540 B

123456789101112131415161718
  1. /**
  2. * JSON transfer does not chunk, commit_data is too large to send
  3. */
  4. import { commit_data } from "../data.js";
  5. import { expect } from "https://esm.sh/v126/chai@4.3.7/X-dHMvZXhwZWN0/es2021/chai.bundle.mjs";
  6. /** @param {unknown[]} received */
  7. export const check = (received) => {
  8. expect(received).to.deep.equal([[], commit_data.slice(0, 2)]);
  9. };
  10. /**
  11. * @param {import("../peerjs").DataConnection} dataConnection
  12. */
  13. export const send = (dataConnection) => {
  14. dataConnection.send([]);
  15. dataConnection.send(commit_data.slice(0, 2));
  16. };