// 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 fasterthan
class-validator
- JSON serialization is200x fasterthan
class-transformer
Thanks for your support.
Your donation encouragestypia
development.
Also,typia
is re-distributing half of donations to core contributors oftypia
.
You can experience how typia works byplayground website:
Check out the document in thewebsite:
- Runtime Validators
- Enhanced JSON
- Protocol Buffer
- Random Generator
- Miscellaneous
- API Documents
- Utillization Cases
- ⇲ Benchmark Result
- ⇲
dev.to
Articles