strings_json.js 549 B

12345678910111213141516171819
  1. /**
  2. * JSON transfer does not chunk, large_string is too large to send
  3. */
  4. import { strings, long_string } 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(strings);
  9. };
  10. /**
  11. * @param {import("../peerjs").DataConnection} dataConnection
  12. */
  13. window.send = (dataConnection) => {
  14. for (const string of strings) {
  15. dataConnection.send(string);
  16. }
  17. };
  18. window["connect-btn"].disabled = false;