arrays_json.js 568 B

12345678910111213141516171819
  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. window.check = (received) => {
  8. expect(received).to.deep.equal([[], commit_data.slice(0, 2)]);
  9. };
  10. /**
  11. * @param {import("../peerjs").DataConnection} dataConnection
  12. */
  13. window.send = (dataConnection) => {
  14. dataConnection.send([]);
  15. dataConnection.send(commit_data.slice(0, 2));
  16. };
  17. window["connect-btn"].disabled = false;