Skip to content
/ typia Public

Super-fast/easy runtime validations and serializations through transformation

License

Notifications You must be signed in to change notification settings

samchon/typia

Repository files navigation

Typia

Typia Logo

GitHub license npm version Downloads Build Status Guide Documents

// RUNTIME VALIDATORS
exportfunctionis<T>(input:unknown):inputisT;// returns boolean
exportfunctionassert<T>(input:unknown):T;// throws TypeGuardError
exportfunctionassertGuard<T>(input:unknown):assertsinputisT;
exportfunctionvalidate<T>(input:unknown):IValidation<T>;// detailed

// JSON FUNCTIONS
exportnamespacejson{
exportfunctionapplication<T>():IJsonApplication;// JSON schema
exportfunctionassertParse<T>(input:string):T;// type safe parser
exportfunctionassertStringify<T>(input:T):string;// safe and faster
}

// PROTOCOL BUFFER
exportnamespaceprotobuf{
exportfunctionmessage<T>():string;// Protocol Buffer message
exportfunctionassertDecode<T>(buffer:Uint8Array):T;// safe decoder
exportfunctionassertEncode<T>(input:T):Uint8Array;// safe encoder
}

// RANDOM GENERATOR
exportfunctionrandom<T>(g?:Partial<IRandomGenerator>):T;

Typia is a transformer library supporting below features:

  • Super-fast Runtime Validators
  • Enhanced JSON functions
  • Protocol Buffer encoder and decoder
  • Random data generator

Note

  • Only one linerequired, with pure TypeScript type
  • Runtime validator is20,000x fasterthanclass-validator
  • JSON serialization is200x fasterthanclass-transformer

Sponsors

Thanks for your support.

Your donation encouragestypiadevelopment.

Also,typiais re-distributing half of donations to core contributors oftypia.

Sponsers

Playground

You can experience how typia works byplayground website:

Guide Documents

Check out the document in thewebsite:

🏠 Home

📖 Features

🔗 Appendix