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

Method check

src/webpage/typeChecker/checkers/string.ts:9–16  ·  view source on GitHub ↗
(obj: unknown)

Source from the content-addressed store, hash-verified

7 this.str = str;
8 }
9 check(obj: unknown): void {
10 if (this.str === undefined) {
11 if (typeof obj !== "string") throw new Error(`${obj} is not a string`);
12 } else if (this.str instanceof RegExp) {
13 if (typeof obj !== "string") throw new Error(`${obj} is not a string`);
14 if (!obj.match(this.str)) throw new Error(`${obj} does not match ${this.str}`);
15 } else if (this.str !== obj) throw new Error(`${obj} does not match ${this.str}`);
16 }
17}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected