objects.js 516 B

12345678910111213141516
  1. import { commit_data } 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. export const check = (received) => {
  5. expect(received).to.be.an("array").with.lengthOf(commit_data.length);
  6. expect(received).to.deep.equal(commit_data);
  7. };
  8. /**
  9. * @param {import("../peerjs").DataConnection} dataConnection
  10. */
  11. export const send = (dataConnection) => {
  12. for (const commit of commit_data) {
  13. dataConnection.send(commit);
  14. }
  15. };