Summary
import TSON from "typescript-json";
//----
// MAIN FUNCTIONS
//----
TSON.assertType<T>(input); // runtime type checker throwing exception
TSON.is<T>(input); // runtime type checker returning boolean
TSON.stringify<T>(input); // 5x faster JSON.stringify()
//----
// APPENDIX FUNCTIONS
//----
TSON.application<[T, U, V], "swagger">(); // JSON schema application generator
TSON.create<T>(input); // 2x faster object creator (only one-time construction)
From now on, typescript-json
is not a wrapper library of fast-json-stringify
. It converts to JSON string by its optimal algorithm. By the new algorithm, typescript-json
generates JSON string much faster and safer. Also, its optimizer plan construction time is over 10,000 times faster than the previous fast-json-stringify
.
Also, typescript-json
supports runtime type checker functions. The new runtime type checker functions are much stronger and safer than ever. Only typescript-json
can validate complicate union typed structures. Other simliar libraries like ajv
, io-ts
or typescript-is
, all of them cannot understand the complicate union type.
What's Changed
- V3.0 RC by @samchon in #91
- V3.0 Publish by @samchon in #100
- Fix #101 by @samchon in #102
- v3.0.2,
isFinite()
andisNaN()
by @samchon in #106
Full Changelog: v2.1.6...v3.0.2