MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / assertDeepEq

Function assertDeepEq

example/tests/gm_xhr_test.js:1947–1951  ·  view source on GitHub ↗
(a, b, msg)

Source from the content-addressed store, hash-verified

1945 if (a !== b) throw new Error(msg ? `${msg}: expected ${b}, got ${a}` : `expected ${b}, got ${a}`);
1946 }
1947 function assertDeepEq(a, b, msg) {
1948 const aj = JSON.stringify(a);
1949 const bj = JSON.stringify(b);
1950 if (aj !== bj) throw new Error(msg ? `${msg}: expected ${bj}, got ${aj}` : `deep equal failed`);
1951 }
1952 function getHeader(headersStr, key) {
1953 const lines = (headersStr || "").split(/\r?\n/);
1954 const line = lines.find((l) => l.toLowerCase().startsWith(key.toLowerCase() + ":"));

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected