4

Typia Guide Documents - Index

 1 year ago
source link: https://typia.io/docs/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
📖 Guide Documents
🙋🏻‍♂️ Introduction

Outline

// 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
export const customValidators: CustomValidatorMap; // customizable
 
// ENHANCED JSON
export function application<...Args>(): IJsonApplication; // JSON schema
export function assertParse<T>(input: string): T; // type safe parser
export function assertStringify<T>(input: T): string; // safe and faster
    // +) isParse, validateParse 
    // +) stringify, isStringify, validateStringify
 
// RANDOM DATA GENERATOR
export function random<T>(g?: Partial<IRandomGenerator>): Primitive<T>;

Typia is a transformer library, supporting those features:

  • Super-fast Runtime Validators
  • Safe JSON parse and fast stringify
  • JSON schema generator
  • Random data generator

Only one line required, with pure TypeScript type

Runtime validator is 20,000x faster than class-validator

JSON serialization is 200x faster than class-transformer

Sponsors

Thanks for your support.

Your donation would encourage typia development.

Last updated on April 18, 2023

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK