Skip to content

Commit

Permalink
fix(examples/sveltekit): remove typia fuction from svelte file tempor…
Browse files Browse the repository at this point in the history
…ally(#335)
  • Loading branch information
ryoppippi committed Nov 1, 2024
1 parent 3513c9a commit 28f4a83
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
10 changes: 1 addition & 9 deletions examples/sveltekit/src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
<script lang="ts">
import typia, { type tags } from "typia";
import {type IMember, validate} from "./validate";
const { data } = $props();
interface IMember {
id: string & tags.Format<"uuid">;
email: string & tags.Format<"email">;
age: number & tags.ExclusiveMinimum<19> & tags.Maximum<100>;
}
const validate = typia.createValidate<IMember>();
let member = $state<IMember>({
id: crypto.randomUUID(),
email: "[email protected]",
Expand Down
10 changes: 10 additions & 0 deletions examples/sveltekit/src/routes/validate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import typia, { type tags } from "typia";

export interface IMember {
id: string & tags.Format<"uuid">;
email: string & tags.Format<"email">;
age: number & tags.ExclusiveMinimum<19> & tags.Maximum<100>;
}

export const validate = typia.createValidate<IMember>();

0 comments on commit 28f4a83

Please sign in to comment.