github samchon/typia v5.4.3

latest releases: v6.0.3, v6.0.2, v6.0.1...
3 months ago

Added more format tags like below.

export interface TypeTagFormat {
  // SPECIAL CHARACTERS
  byte: string & tags.Format<"byte">;
  password: string & tags.Format<"password">;
  regex: string & tags.Format<"regex">;
  uuid: string & tags.Format<"uuid">;

  // ADDRESSES
  email: string & tags.Format<"email">;
  hostname: string & tags.Format<"hostname">;
  idnEmail: string & tags.Format<"idn-email">;
  idnHostname: string & tags.Format<"idn-hostname">;
  iri: string & tags.Format<"iri">;
  iriReference: string & tags.Format<"iri-reference">;
  ipv4: string & tags.Format<"ipv4">;
  ipv6: string & tags.Format<"ipv6">;
  uri: string & tags.Format<"uri">;
  uriReference: string & tags.Format<"uri-reference">;
  uriTemplate: string & tags.Format<"uri-template">;
  url: string & tags.Format<"url">;

  // TIMESTAMPS
  datetime: string & tags.Format<"date-time">;
  date: string & tags.Format<"date">;
  time: string & tags.Format<"time">;
  duration: string & tags.Format<"duration">;

  // POINTERS
  jsonPointer: string & tags.Format<"json-pointer">;
  relativeJsonPointer: string & tags.Format<"relative-json-pointer">;
}

Also, new function typia.http.assertFormData<T>(input: FormData): Resolved<T> function added.

With the function, you can parse the FormData instance even including the Blob or File property.

import typia, { tags } from "typia";

interface ObjectHttpFormData {
  id: string & tags.Format<"uuid">;
  strings: string[];
  number: number;
  integers: Array<number & tags.Type<"int32">>;
  blob: Blob;
  blobs: Blob[];
  file: File;
  files: File[];
}
const data: ObjectHttpFormData = typia.http.assertFormData<ObjectHttpFormData>();

What's Changed

Full Changelog: v5.3.12...v5.4.3

Don't miss a new typia release

NewReleases is sending notifications on new releases.