Super-fast/easy runtime validations and serializations through transformation
@samchon/openapi
on test program by @samchon in https://github.com/samchon/typia/pull/1032
@samchon/openapi
and fix comment tag @type
. by @samchon in https://github.com/samchon/typia/pull/1033
Full Changelog: https://github.com/samchon/typia/compare/v6.0.2...v6.0.3
test/src/generated
by @samchon in https://github.com/samchon/typia/pull/1028
application_plugin()
function. by @samchon in https://github.com/samchon/typia/pull/1029
Full Changelog: https://github.com/samchon/typia/compare/v6.0.1...v6.0.2
typia.json.application()
function has been changed to support standard OpenAPI v3.0/v3.1 specified JSON schema.
About the detailed OpenAPI spec's JSON schema structures, visit one of below:
You can use it like below:
typia.json.application<[X, Y, Z], "3.0">();
typia.json.application<[X, Y, Z], "3.1">();
Record<string, string>
bug of typia.json.application<"3.1">()
function. by @samchon in https://github.com/samchon/typia/pull/1025
Full Changelog: https://github.com/samchon/typia/compare/v5.5.10...v6.0.1
Full Changelog: https://github.com/samchon/typia/compare/v5.5.8...v5.5.10
Full Changelog: https://github.com/samchon/typia/compare/v5.5.7...v5.5.8
Full Changelog: https://github.com/samchon/typia/compare/v5.5.5...v5.5.7
Full Changelog: https://github.com/samchon/typia/compare/v5.5.4...v5.5.5
Full Changelog: https://github.com/samchon/typia/compare/v5.5.3...v5.5.4
Full Changelog: https://github.com/samchon/typia/compare/v5.5.2...v5.5.3
New module functional
for entire function level validation.
export namespace functional {
export function assertFunction<T extends Function>(func: T): T;
export function isFunction<T extends (...args: any[]) => any>(
func: T,
): T extends (...args: infer Arguments) => infer Output
? Output extends Promise<infer R>
? (...args: Arguments) => Promise<R | null>
: (...args: Arguments) => Output | null
: never;
export function validateFunction<T extends (...args: any[]) => any>(
func: T,
): T extends (...args: infer Arguments) => infer Output
? Output extends Promise<infer R>
? (...args: Arguments) => Promise<IValidation<R>>
: (...args: Arguments) => IValidation<Output>
: never;
}
Also, when using assert
functions, you can customize the error class to throw.
import typia from "typia";
class MyCustomError extends Error {
public constructor(props: typia.TypeGuard.IProps);
}
typia.assert<number>("not-a-number", (props) => MyCustomError(props));
Additionally, checked that no problem on the new TypeScript v5.4 update.
typia.functional.assertFunction()
. by @samchon in https://github.com/samchon/typia/pull/989
isFunction()
and validateFunction()
. by @samchon in https://github.com/samchon/typia/pull/992
typia.functional
module for async or implicit return type case. by @samchon in https://github.com/samchon/typia/pull/994
functional
module when generation mode by @samchon in https://github.com/samchon/typia/pull/997
Full Changelog: https://github.com/samchon/typia/compare/v5.4.14...v5.5.2