Super-fast/easy runtime validations and serializations through transformation
MIT License
Bot releases are visible (Hide)
Published by samchon over 1 year ago
IJsonSchema.IUnknown.type
to be optional by @samchon in https://github.com/samchon/typia/pull/635
Full Changelog: https://github.com/samchon/typia/compare/v3.8.6...v3.8.9
Published by samchon over 1 year ago
Full Changelog: https://github.com/samchon/typia/compare/v3.8.5...v3.8.6
Published by samchon over 1 year ago
There are some fucking documentation libraries enforcing user to write invalid @type
tagged comments like below, even in TypeScript.
In such reason, typia
stops throwing compilation error when invalid @type
tag comes.
Of course, validation and random generation logic would not be affected by the invalid @type
tag.
@type
tags by @samchon in https://github.com/samchon/typia/pull/624
Full Changelog: https://github.com/samchon/typia/compare/v3.8.4...v3.8.5
Published by samchon over 1 year ago
Full Changelog: https://github.com/samchon/typia/compare/v3.8.3...v3.8.4
Published by samchon over 1 year ago
Full Changelog: https://github.com/samchon/typia/compare/v3.8.2...v3.8.3
Published by samchon over 1 year ago
strictNullChecks: true
by @samchon in https://github.com/samchon/typia/pull/615
Full Changelog: https://github.com/samchon/typia/compare/v3.8.1...v3.8.2
Published by samchon over 1 year ago
From now on, typia
abandons ttypescript
and utilizes ts-patch
only.
It's the reason why ttypescript
has stopped maintaining, but ts-patch
is on going.
Thanks for keeping such wonderful library ts-patch
@nonara.
docs
directory in the master
branch by @samchon in https://github.com/samchon/typia/pull/596
assertParse<T>()
returns Primitive<T>
by @samchon in https://github.com/samchon/typia/pull/604
ts-patch
version to be 2.1.0
by @samchon in https://github.com/samchon/typia/pull/605
typia.prune<T>()
to support Record<string, T>
type by @samchon in https://github.com/samchon/typia/pull/608
ttypescript
and use ts-patch
only by @samchon in https://github.com/samchon/typia/pull/609
IJsonSchema.IUnknown
type by @samchon in https://github.com/samchon/typia/pull/610
ApplicationProgrammer.generate()
was wrong by @samchon in https://github.com/samchon/typia/pull/612
Full Changelog: https://github.com/samchon/typia/compare/v3.7.6...v3.8.1
Published by samchon over 1 year ago
I've published Guide Documents on https://typia.io/docs/ domain.
Also, @LorenzHenk had fixed npx typia generate
command on ESM environments. Thanks for contribution.
npx typia setup
command by @samchon in https://github.com/samchon/typia/pull/593
Full Changelog: https://github.com/samchon/typia/compare/v3.7.4...v3.7.6
Published by samchon over 1 year ago
pnpm
by @samchon in https://github.com/samchon/typia/pull/582
Full Changelog: https://github.com/samchon/typia/compare/v3.7.3...v3.7.4
Published by samchon over 1 year ago
From now on, assert()
and validate()
functions are superfast like is()
function.
is()
in assert()
and validate()
by @samchon in https://github.com/samchon/typia/pull/580
Full Changelog: https://github.com/samchon/typia/compare/v3.7.2...v3.7.3
Published by samchon over 1 year ago
New function typia.literals()
:
export function literals<T extends Atomic.Type>(): T[];
literals<"A" | 2 | false>(); // ["A", 2, false] as const
literals()
by @samchon in https://github.com/samchon/typia/pull/576
Full Changelog: https://github.com/samchon/typia/compare/v3.7.1...v3.7.2
Published by samchon over 1 year ago
From now on, customization of random data generation is possible:
import typia from "typia";
export interface TagCustom {
/**
* Regular feature supported by typia
*
* @format uuid
*/
id: string;
/**
* Custom feature composed with "$" + number
*
* @dollar
*/
dollar: string;
/**
* Custom feature composed with string + "abcd"
*
* @postfix abcd
*/
postfix: string;
/**
* Custom feature meaning x^y
*
* @powerOf 10
*/
log: number;
}
const data: TagCustom = typia.random<TagCustom>({
customs: {
string: (tags: typia.IRandomGenerator.ICommentTag[]) => {
if (tags.find((t) => t.name === "dollar") !== undefined)
return "$" + RandomGenerator.integer();
const postfix = tags.find((t) => t.name === "postfix");
if (postfix !== undefined)
return RandomGenerator.string() + postfix.value;
},
number: (tags: typia.IRandomGenerator.ICommentTag[]) => {
const powerOf = tags.find((t) => t.name === "powerOf");
if (powerOf !== undefined)
return Math.pow(
Number(powerOf.value),
RandomGenerator.integer(1, 4),
);
},
}
});
Full Changelog: https://github.com/samchon/typia/compare/v3.7.0...v3.7.1
Published by samchon over 1 year ago
From now on, you can add custom validation function utilizing comment tags like below:
typia.customValidators.insert("powerOf")("number")(
(text: string) => {
const denominator: number = Math.log(Number(text));
return (value: number) => {
value = Math.log(value) / denominator;
return value === Math.floor(value);
};
}
);
typia.customValidators.insert("dollar")("string")(
() => (value: string) => value.startsWith("$"),
);
interface TagCustom {
/**
* @powerOf 10
*/
powerOf: number;
/**
* @dollar
*/
dollar: string;
}
class-transformer
by @samchon in https://github.com/samchon/typia/pull/571
Full Changelog: https://github.com/samchon/typia/compare/v3.6.9...v3.7.0
Published by samchon over 1 year ago
@format date(time)
tags by @samchon in https://github.com/samchon/typia/pull/564
Full Changelog: https://github.com/samchon/typia/compare/v3.6.8...v3.6.9
Published by samchon over 1 year ago
Full Changelog: https://github.com/samchon/typia/compare/v3.6.7...v3.6.8
Published by samchon over 1 year ago
IJsonSchema.INumeric.exclusiveMinimum
is boolean
type by @samchon in https://github.com/samchon/typia/pull/549
Full Changelog: https://github.com/samchon/typia/compare/v3.6.6...v3.6.7
Published by samchon over 1 year ago
IJsonSchema.maximum
condition by @samchon in https://github.com/samchon/typia/pull/546
Full Changelog: https://github.com/samchon/typia/compare/v3.6.4...v3.6.6
Published by samchon over 1 year ago
Full Changelog: https://github.com/samchon/typia/compare/v3.6.3...v3.6.4
Published by samchon over 1 year ago
Full Changelog: https://github.com/samchon/typia/compare/v3.6.2...v3.6.3
Published by samchon over 1 year ago
Full Changelog: https://github.com/samchon/typia/compare/v3.6.1...v3.6.2