MCPcopy Create free account
hub / github.com/MathMan05/Fermi / check

Method check

src/webpage/typeChecker/checkers/array.ts:13–25  ·  view source on GitHub ↗
(obj: unknown)

Source from the content-addressed store, hash-verified

11 }
12 }
13 check(obj: unknown) {
14 if (!(obj instanceof Array)) throw new Error(`${obj} is not of type array`);
15 if (this.arr instanceof Array) {
16 if (this.arr.length !== obj.length) throw new Error(`${obj} does not match array schema`);
17 for (let i = 0; i < obj.length; i++) {
18 this.arr[i].check(obj[i]);
19 }
20 } else {
21 for (const elm of obj) {
22 this.arr.check(elm);
23 }
24 }
25 }
26}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected