-
-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…being used Fixed that bug, and new version is `4.1.14`. The bug had been occured by ommission of native types in intersection algorithm of `Metadata`.
- Loading branch information
Showing
9 changed files
with
98 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import typia from "typia"; | ||
|
||
type A = { | ||
createdAt: Date; | ||
value: number; | ||
}; | ||
type B = { | ||
createdAt: Date; | ||
value: string; | ||
}; | ||
type AB = A | B; | ||
|
||
export const test_issue_native_union_property = () => { | ||
const matched: boolean[] = [ | ||
{ | ||
createdAt: new Date(), | ||
value: 10, | ||
}, | ||
{ | ||
createdAt: new Date(), | ||
value: "test", | ||
}, | ||
].map((input) => typia.is<AB>(input)); | ||
if (matched.some((v) => v === false)) | ||
throw new Error( | ||
"Bug on typia.is: failed to understand the native union property.", | ||
); | ||
}; |
27 changes: 27 additions & 0 deletions
27
test/generated/output/issues/test_issue_native_union_property.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import typia from "typia"; | ||
|
||
type A = { | ||
createdAt: Date; | ||
value: number; | ||
}; | ||
type B = { | ||
createdAt: Date; | ||
value: string; | ||
}; | ||
type AB = A | B; | ||
export const test_issue_native_union_property = () => { | ||
const matched: boolean[] = [ | ||
{ | ||
createdAt: new Date(), | ||
value: 10, | ||
}, | ||
{ | ||
createdAt: new Date(), | ||
value: "test", | ||
}, | ||
].map((input) => typia.is<AB>(input)); | ||
if (matched.some((v) => v === false)) | ||
throw new Error( | ||
"Bug on typia.is: failed to understand the native union property.", | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import typia from "typia"; | ||
|
||
type A = { | ||
createdAt: Date; | ||
value: number; | ||
}; | ||
type B = { | ||
createdAt: Date; | ||
value: string; | ||
}; | ||
type AB = A | B; | ||
|
||
console.log(typia.createIs<AB>().toString()); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"> | ||
<url><loc>https://typia.io/</loc><lastmod>2023-07-31T08:47:27.998Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/</loc><lastmod>2023-07-31T08:47:27.998Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/json/parse/</loc><lastmod>2023-07-31T08:47:27.998Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/json/schema/</loc><lastmod>2023-07-31T08:47:27.998Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/json/stringify/</loc><lastmod>2023-07-31T08:47:27.998Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/miscellaneous/</loc><lastmod>2023-07-31T08:47:27.998Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/pure/</loc><lastmod>2023-07-31T08:47:27.998Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/random/</loc><lastmod>2023-07-31T08:47:27.998Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/setup/</loc><lastmod>2023-07-31T08:47:27.998Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/utilization/nestjs/</loc><lastmod>2023-07-31T08:47:27.998Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/utilization/prisma/</loc><lastmod>2023-07-31T08:47:27.998Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/utilization/trpc/</loc><lastmod>2023-07-31T08:47:27.998Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/validators/assert/</loc><lastmod>2023-07-31T08:47:27.998Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/validators/comment-tags/</loc><lastmod>2023-07-31T08:47:27.998Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/validators/is/</loc><lastmod>2023-07-31T08:47:27.998Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/validators/validate/</loc><lastmod>2023-07-31T08:47:27.998Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/playground/</loc><lastmod>2023-07-31T08:47:27.998Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/</loc><lastmod>2023-08-02T09:01:58.728Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/</loc><lastmod>2023-08-02T09:01:58.728Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/json/parse/</loc><lastmod>2023-08-02T09:01:58.728Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/json/schema/</loc><lastmod>2023-08-02T09:01:58.728Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/json/stringify/</loc><lastmod>2023-08-02T09:01:58.728Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/miscellaneous/</loc><lastmod>2023-08-02T09:01:58.728Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/pure/</loc><lastmod>2023-08-02T09:01:58.728Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/random/</loc><lastmod>2023-08-02T09:01:58.728Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/setup/</loc><lastmod>2023-08-02T09:01:58.728Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/utilization/nestjs/</loc><lastmod>2023-08-02T09:01:58.728Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/utilization/prisma/</loc><lastmod>2023-08-02T09:01:58.728Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/utilization/trpc/</loc><lastmod>2023-08-02T09:01:58.728Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/validators/assert/</loc><lastmod>2023-08-02T09:01:58.728Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/validators/comment-tags/</loc><lastmod>2023-08-02T09:01:58.728Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/validators/is/</loc><lastmod>2023-08-02T09:01:58.728Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/docs/validators/validate/</loc><lastmod>2023-08-02T09:01:58.728Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
<url><loc>https://typia.io/playground/</loc><lastmod>2023-08-02T09:01:58.728Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url> | ||
</urlset> |