github samchon/typia v5.1.5

latest releases: v6.10.2, v6.10.1, v6.10.0...
11 months ago

New module http has been newly added.

export namespace http {
    export function parameter<T extends boolean | bigint | number | string>(input: string): T;

    export function headers<T extends object>(input: Record<string, string | string[] | undefined>): Resolved<T>;
    export function isHeaders<T extends object>(input: Record<string, string | string[] | undefined>): Resolved<T> | null;
    export function assertHeaders<T extends object>(input: Record<string, string | string[] | undefined>): Resolved<T>;
    export function validateHeaders<T extends object>(input: Record<string, string | string[] | undefined>): IValidation<Resolved<T>>;

    export function query<T extends object>(input: URLSearchParams): Resolved<T>;
    export function isQuery<T extends object>(input: URLSearchParams): Resolved<T> | null;
    export function assertQuery<T extends object>(input: URLSearchParams): Resolved<T>;
    export function validateQuery<T extends object>(input: URLSearchParams): IValidation<Resolved<T>>;
}

For reference, those features had been developed in @nestia/core for a long time.

The reason why migrating them from @nestia/core is to support Fastify plugin like nestia case. In the same reason, I've changed naming strategy of JSON schema (IJsonComponents) to be much simpler.

Also, fixed a bug occurred only when tsconfig.json has configured exactOptionalPropertyTypes option and utilizing Partial<T> and Required<T> types.

What's Changed

Full Changelog: v5.0.5...v5.1.5

Don't miss a new typia release

NewReleases is sending notifications on new releases.