Super-fast/easy runtime validations and serializations through transformation
MIT License
Bot releases are visible (Hide)
Published by samchon almost 2 years ago
Performance tunings on assertType()
, validate()
and related functions are done.
Therefore, those became faster.
Before
After
assertType()
and validate()
by @samchon in https://github.com/samchon/typescript-json/pull/284
validate()
shorter by @samchon in https://github.com/samchon/typescript-json/pull/285
assertType@v3
became faster by @samchon in https://github.com/samchon/typescript-json/pull/286
Full Changelog: https://github.com/samchon/typescript-json/compare/v3.3.16...v3.3.17
Published by samchon almost 2 years ago
Fix error of https://github.com/samchon/typescript-json/issues/269
I've taken a mistake omitting an @internal
tag, therefore hotfix it
Full Changelog: https://github.com/samchon/typescript-json/compare/v3.3.15...v3.3.16
Published by samchon almost 2 years ago
export function stringify<T>(input: T): string; // unsafe but fatest
export function assertStringify<T>(input: T): string; // throws TypeGuardError
export function isStringify<T>(input: T): string | null; // wrong type be null
export function createStringify<T>(): (input: T) => string;
export function createAssertStringify<T>(): (input: T) => string;
export function createIsStringify<T>(): (input: T) => string | null;
JSON string converters are enhanced.
isStringify()
function by @samchon in https://github.com/samchon/typescript-json/pull/267
Full Changelog: https://github.com/samchon/typescript-json/compare/v3.3.14...v3.3.15
Published by samchon almost 2 years ago
export function assertStringify<T>(input: T): string;
export function createAssertStringify<T>(): (input: T) => string;
Two functions assertStringify()
and createAssertStringify()
have been newly added.
They're composite functions combined assertType()
and stringify()
, so that much safer and even than JSON.stringify()
.
I hope them to be killer functions of typescript-json
.
assertStringify()
by @samchon in https://github.com/samchon/typescript-json/pull/263
Full Changelog: https://github.com/samchon/typescript-json/compare/v3.3.13...v3.3.14
Published by samchon almost 2 years ago
Reusable functions are newly added:
TSON.createAssertType()
TSON.createIs()
TSON.createValidate()
TSON.createAssertEquals()
TSON.createEquals()
TSON.createValidateEquals()
TSON.createStringify()
Also, TypeBox
author @sinclairzx81 has helped me and benchmarked each libraries.
It seems that TypeBox
is much faster than my library when comparing is()
and equals()
functions.
TypeBox
would be the best choice when using JavaScript or TypeScript environment which cannot utilize transformer.
class-validator
by @samchon in https://github.com/samchon/typescript-json/pull/248
TypeBox
by @samchon in https://github.com/samchon/typescript-json/pull/255
Full Changelog: https://github.com/samchon/typescript-json/compare/v3.3.12...v3.3.13
Published by samchon about 2 years ago
Full Changelog: https://github.com/samchon/typescript-json/compare/v3.3.11...v3.3.12
Published by samchon about 2 years ago
@internal
tagged properties by @samchon in https://github.com/samchon/typescript-json/pull/242
Full Changelog: https://github.com/samchon/typescript-json/compare/v3.3.10...v3.3.11
Published by samchon about 2 years ago
I'd thought that I had supported full spec of TypeScript type, but it was not.
The enumeration typed property key was the one had not been supported, but now support it.
Full Changelog: https://github.com/samchon/typescript-json/compare/v3.3.9...v3.3.10
Published by samchon about 2 years ago
Dynamic propertied array, it was the only one I'd ommitted in the test program.
Therefore, from now on, test program covers all of the TypeScript types and there would not be validation error more, maybe?
TypeGuardError.path
bug by @samchon in https://github.com/samchon/typescript-json/pull/235
Full Changelog: https://github.com/samchon/typescript-json/compare/v3.3.8...v3.3.9
Published by samchon about 2 years ago
io-ts
and zod
by @samchon in https://github.com/samchon/typescript-json/pull/229
vite
by @samchon in https://github.com/samchon/typescript-json/pull/231
Full Changelog: https://github.com/samchon/typescript-json/compare/v3.3.7...v3.3.8
Published by samchon about 2 years ago
Full Changelog: https://github.com/samchon/typescript-json/compare/v3.3.6...v3.3.7
Published by samchon about 2 years ago
From now on, dynamic properties (#153) are fully supported.
TSON.stringify()
supports dynamic properties by @samchon in https://github.com/samchon/typescript-json/pull/225
Full Changelog: https://github.com/samchon/typescript-json/compare/v3.3.4...v3.3.6
Published by samchon about 2 years ago
Full Changelog: https://github.com/samchon/typescript-json/compare/v3.3.3...v3.3.4
Published by samchon about 2 years ago
IJsonComponents.IObject.patternProperties
by @samchon in https://github.com/samchon/typescript-json/pull/219
Full Changelog: https://github.com/samchon/typescript-json/compare/v3.3.2...v3.3.3
Published by samchon about 2 years ago
/
by @samchon in https://github.com/samchon/typescript-json/pull/217
Full Changelog: https://github.com/samchon/typescript-json/compare/v3.3.1...v3.3.2
Published by samchon about 2 years ago
Thanks for @Inkdpixels
@format
tag values #212 by @Inkdpixels in https://github.com/samchon/typescript-json/pull/213
@default
tag for JSON schema by @samchon in https://github.com/samchon/typescript-json/pull/215
Full Changelog: https://github.com/samchon/typescript-json/compare/v3.3.0...v3.3.1
Published by samchon about 2 years ago
Supports template literal type.
From now on, such crazy template literal type can be validated.
Also, dynamic properties (#153) would be supported soon (maybe next Sunday), by v3.4 update.
export interface TemplateUnion {
prefix: `prefix_${string | number | boolean}`;
postfix: `${string | number | boolean}_postfix`;
middle: `the_${number | boolean}_value`;
mixed:
| `the_${number | "A" | "B"}_value`
| { name: string }
| boolean
| number;
}
MetadataProperty
for dynamic properties by @samchon in https://github.com/samchon/typescript-json/pull/201
MetadataFactory
by @samchon in https://github.com/samchon/typescript-json/pull/207
Metadata.templates
by @samchon in https://github.com/samchon/typescript-json/pull/209
Full Changelog: https://github.com/samchon/typescript-json/compare/v3.2.8...v3.3.0
Published by samchon about 2 years ago
IValidation
by @samchon in https://github.com/samchon/typescript-json/pull/204
Full Changelog: https://github.com/samchon/typescript-json/compare/v3.2.7...v3.2.8
Published by samchon about 2 years ago
undefined
value comes by @samchon in https://github.com/samchon/typescript-json/pull/198
Full Changelog: https://github.com/samchon/typescript-json/compare/v3.2.6...v3.2.7
Published by samchon about 2 years ago
Started supporting equivalent validators which do not allow superfluous properties.
equals
assertEquals
validateEquals
Full Changelog: https://github.com/samchon/typescript-json/compare/v3.2.5...v3.2.6