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

Method constructor

src/webpage/typeChecker/checkers/string.ts:5–8  ·  view source on GitHub ↗
(str?: string | RegExp)

Source from the content-addressed store, hash-verified

3export class StringChecker extends TypeChecker {
4 str?: string | RegExp;
5 constructor(str?: string | RegExp) {
6 super();
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`);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected