Overview of Typia features and API
masterTypia is a TypeScript transformer library that provides super-fast runtime validators, safe JSON parsing/stringifying, and JSON schema generation. It uses AOT (Ahead of Time) compilation to achieve high performance.
Key features include:
- Super-fast Runtime Validators: Validates data against TypeScript types at runtime.
- Strict Validators: Performs deep equality checks.
- JSON Utilities: Safe parsing and fast stringification.
- JSON Schema: Generates schemas directly from TypeScript types.
All Typia functions are designed to be used with a single line of code, requiring no manual JSON schema definitions or decorators.
// RUNTIME VALIDATORS
export function is<T>(input: unknown | T): input is T; // returns boolean
export function assert<T>(input: unknown | T): T; // throws TypeGuardError
export function validate<T>(input: unknown | T): IValidation<T>; // detailed
// STRICT VALIDATORS
export function equals<T>(input: unknown | T): input is T;
export function assertEquals<T>(input: unknown | T): T;
export function validateEquals<T>(input: unknown | T): IValidation<T>;
// JSON
export function application<T>(): IJsonApplication; // JSON schema
export function assertParse<T>(input: string): T; // type safe parser
export function assertStringify<T>(input: T): string; // safe and faster