strings.js 527 B

1234567891011121314151617
  1. import { strings, long_string } from "../data.js";
  2. import { expect } from "https://esm.sh/v126/chai@4.3.7/X-dHMvZXhwZWN0/es2021/chai.bundle.mjs";
  3. /** @param {unknown[]} received */
  4. window.check = (received) => {
  5. expect(received).to.deep.equal([long_string, ...strings]);
  6. };
  7. /**
  8. * @param {import("../peerjs").DataConnection} dataConnection
  9. */
  10. window.send = (dataConnection) => {
  11. dataConnection.send(long_string);
  12. for (const string of strings) {
  13. dataConnection.send(string);
  14. }
  15. };
  16. window["connect-btn"].disabled = false;