Super-fast/easy runtime validations and serializations through transformation
MIT License
Bot releases are visible (Hide)
Published by samchon about 1 year ago
random
function by @samchon in https://github.com/samchon/typia/pull/759
Full Changelog: https://github.com/samchon/typia/compare/v4.2.1...v4.2.2
Published by samchon about 1 year ago
When typia.stringify<T>()
be used for an object type which has template typed key containing a number type, and exponential log being used in the template key type, typia
could not write the property because regex pattern for numeric value of typia
had not supported the exponential log value.
This is an extremely rare case, but fixed for extensionality.
export interface ISomething {
[key: `value_${number}`]: boolean | string | number;
}
const something: ISomething = {
"5.175933557310941e-7": -0.170261004873707,
};
typia.stringify(something);
stringify
to support exponential log value by @samchon in https://github.com/samchon/typia/pull/749
Full Changelog: https://github.com/samchon/typia/compare/v4.2.0...v4.2.1
Published by samchon about 1 year ago
Thanks to @enyineer for reporting.
yarn berry
npm run postinstall
command insteadUnfortunately, ts-patch
does not support yarn berry
. Therefore, it is not possible to use transform mode of typia
in the yarn berry
. Therefore, to inform it and recommend not to use yarn berry
in typia
, I've changed setup wizard program. This change would be rolled back when ts-patch
starts supporting the yarn berry
.
Also, yarn berry
does not support the npm run prepare
command. I think this nonsensible story because the npm run prepare
command is a standard feature of NPM, but this is the reality, so I can't help it. By the way, if ts-patch
starts supporting yarn berry
, configuring npm run prepare
command by setup wizard can be a big problem. So, I've changed setup wizard to use npm run postinstall
command instead of the previous npm run prepare
command.
yarn berry
. by @samchon in https://github.com/samchon/typia/pull/747
Full Changelog: https://github.com/samchon/typia/compare/v4.1.16...v4.2.0
Published by samchon about 1 year ago
https://dev.to/samchon/good-bye-typescript-is-ancestor-of-typia-20000x-faster-validator-49fi
typia
had started from a helper library of fast-json-stringify
. At that time, package name was typescript-json
, and slogan was convenient JSON serialization boosting without JSON schema definition, but with pure TypeScript type. In such reason, typia
still has same logic with fast-json-stringify
about string
type's JSON serialization.
In today, fast-json-stringify
has changed their string
type logic, and developer of fast-json-stringify
informed me the update. I've measured benchmark with him, and could understand that the new logic is efficient than before. Therefore, updated typia
to follow the fast-json-stringify
.
Special thanks for fast-json-stringify
developer @Uzlopak
v4.1.15
is a mis-published version. Do not use it please.
string
type by @samchon in https://github.com/samchon/typia/pull/740
length
problem. by @samchon in https://github.com/samchon/typia/pull/743
Full Changelog: https://github.com/samchon/typia/compare/v4.1.14...v4.1.16
Published by samchon about 1 year ago
Date
by @samchon in https://github.com/samchon/typia/pull/735
Full Changelog: https://github.com/samchon/typia/compare/v4.1.13...v4.1.14
Published by samchon about 1 year ago
IJsonSchema.descript
no more includes comment tags by @samchon in https://github.com/samchon/typia/pull/733
Full Changelog: https://github.com/samchon/typia/compare/v1.4.12...v4.1.13
Published by samchon about 1 year ago
@hidden
tag for JSON schema by @samchon in https://github.com/samchon/typia/pull/730
Full Changelog: https://github.com/samchon/typia/compare/v1.4.11...v1.4.12
Published by samchon about 1 year ago
JSDocParameterTag
case. by @samchon in https://github.com/samchon/typia/pull/728
Full Changelog: https://github.com/samchon/typia/compare/v4.1.8...v1.4.11
Published by samchon about 1 year ago
stringify()
when any typed property by @samchon in https://github.com/samchon/typia/pull/720
Full Changelog: https://github.com/samchon/typia/compare/v4.1.7...v4.1.8
Published by samchon over 1 year ago
Full Changelog: https://github.com/samchon/typia/compare/v4.1.6...v4.1.7
Published by samchon over 1 year ago
package
word on reserved keywords. by @samchon in https://github.com/samchon/typia/pull/711
Full Changelog: https://github.com/samchon/typia/compare/v4.1.5...v4.1.6
Published by samchon over 1 year ago
Full Changelog: https://github.com/samchon/typia/compare/v4.1.4...v4.1.5
Published by samchon over 1 year ago
exactOptionalPropertyTypes
option by @samchon in https://github.com/samchon/typia/pull/707
Full Changelog: https://github.com/samchon/typia/compare/v4.1.3...v4.1.4
Published by samchon over 1 year ago
Full Changelog: https://github.com/samchon/typia/compare/v4.1.2...v4.1.3
Published by samchon over 1 year ago
Started supporting repeated intersection type like below:
export type ISetupConfig =
| ({
type: 'Main';
} & ISetupConfigMain)
| ({
type: 'Before';
} & ISetupConfigBefore)
| ({
type: 'After';
} & ISetupConfigAfter);
export type ISetupConfigMain = {
content: ISetupConfig;
};
export type ISetupConfigBefore = {
content: ISetupConfig;
};
export type ISetupConfigAfter = {
content: ISetupConfig;
};
react-split-pane
by @samchon in https://github.com/samchon/typia/pull/684
Full Changelog: https://github.com/samchon/typia/compare/v4.1.1...v4.1.2
Published by samchon over 1 year ago
https://[typia.io/playground](https://typia.io/playground)
From now on, you can easily enjoy typia
just in website.
Let's test how typia
compiles validation code in the playground website.
Special thanks to @GoogleFeud for hint about that.
Full Changelog: https://github.com/samchon/typia/compare/v4.1.0...v4.1.1
Published by samchon over 1 year ago
Enhance JSON schema generator, especially about AJV mode.
Also, @webNeat enhanced validate()
function a little bit faster.
Object.toJSON()
type. by @samchon in https://github.com/samchon/typia/pull/659
Date
as string (@format date-time)
by @samchon in https://github.com/samchon/typia/pull/664
is()
function by enhanced inlining by @samchon in https://github.com/samchon/typia/pull/670
IJsonSchema.ITuple
type. by @samchon in https://github.com/samchon/typia/pull/672
Full Changelog: https://github.com/samchon/typia/compare/v4.0.6...v4.1.0
Published by samchon over 1 year ago
atomic & object
by @samchon in https://github.com/samchon/typia/pull/657
typia.random<T>()
problem by @8471919 in https://github.com/samchon/typia/pull/656
Full Changelog: https://github.com/samchon/typia/compare/v4.0.5...v4.0.6
Published by samchon over 1 year ago
strictNullChecks
to be true by @samchon in https://github.com/samchon/typia/pull/651
Full Changelog: https://github.com/samchon/typia/compare/v4.0.3...v4.0.5
Published by samchon over 1 year ago
Major update due to break changes on API, and 3rd party libraries like
nestia
being affected.
In prisma
case, its JsonValue contains infinite repeated Array type like below.
If only infinite repeated array type comes, it is not allowed in TypeScript. However, if infinite repeated array type is capsuled in an union type like below JsonValue
case, TypeScript allows it. I hadn't known such spec, and none of other validator libraries had supported it, either.
However, as prisma
is using such type, I've tried typia
to support such special type. And today, I've succeeded to fully implement it, with new 300K line of codes. The implementation difficulty of it was terribly high, but I'm glad I succeeded in implementing it in the end.
export type JsonValue =
| string
| number
| boolean
| JsonObject
| JsonArray
| null;
export interface JsonObject {
[key: string]: JsonValue | undefined;
}
export type JsonArray = Array<JsonValue>;
Furthermore, typia
supports extreme union type of infinite repeated union array type. Below ArrayRepeatedUnionWithTuple
type is one of such extreme type used for automated testing program of typia
. From now on, I can say again that, "typia
" supports every TypeScript type".
export type ArrayRepeatedUnionWithTuple =
| boolean
| number
| string[]
| ArrayRepeatedUnionWithTuple[]
| ArrayRepeatedUnionWithTuple.IBox3D[]
| [string, number, boolean]
| [
ArrayRepeatedUnionWithTuple.IBox3D,
ArrayRepeatedUnionWithTuple.IPoint3D,
];
export namespace ArrayRepeatedUnionWithTuple {
export interface IBox3D {
scale: IPoint3D;
position: IPoint3D;
rotate: IPoint3D;
pivot: IPoint3D;
}
export interface IPoint3D {
x: number;
y: number;
z: number;
}
}
type
tag like @type {int}
by @samchon in https://github.com/samchon/typia/pull/643
components.schemas
property by @samchon in https://github.com/samchon/typia/pull/645
$ref
also had to be changed. by @samchon in https://github.com/samchon/typia/pull/646
Required<T>
problem by @samchon in https://github.com/samchon/typia/pull/648
Full Changelog: https://github.com/samchon/typia/compare/v3.8.9...v4.0.3