JSTC
Runtime JS Type Checker with Protection Levels.
Runtime Validation, Not Static Types
JSTC validates values at runtime. It does not replace TypeScript compile-time checks.
Pages
- Classes:
JSTypeChecker - Types:
ProtectionLevel,JSType,JSTypeOrArray - Constants:
JSTC
Quick Start
ts
import { JSTC } from "@briklab/lib/jstc";
JSTC.setProtectionLevel("boundary");
const isValid = JSTC.for([42]).check(["number"]); // trueNotes
- Use
JSTypeCheckerwhen you need isolated checker instances. - Use
JSTCwhen a singleton checker is sufficient.