-
-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add orphan Type to IJSONApplication
to save types
#1210
feat: add orphan Type to IJSONApplication
to save types
#1210
Conversation
src/schemas/json/IJsonApplication.ts
Outdated
export namespace IJsonApplication { | ||
export interface IV3_0 { | ||
export interface IV3_0<T> { | ||
[tag]: T; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This technique is called opaque types
fab8bc0
to
4e27c9b
Compare
commit:
|
0e9cb25
to
920d85b
Compare
920d85b
to
7309a02
Compare
Hmm, I'll check why test fails |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tested would be passed just by running the npm run generate
command in the ./test
directory.
Thanks. I'll check later |
@samchon |
Ah, I'm sorry. Run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fix test program template generation issue by myself.
Thanks for contribution.
Well, this affects to the validation code like below: TypeGuardError: Error on typia.assert(): invalid type on $input[0]["__@tag@9875"], expect to be Array<unknown>
at new TypeGuardError (D:\github\samchon\typia\test\node_modules\typia\src\TypeGuardError.ts:10:10)
at D:\github\samchon\typia\test\node_modules\typia\src\functional\$guard.ts:14:37
at D:\github\samchon\typia\test\node_modules\typia\src\functional\$guard.ts:14:64
at $ao0 (D:\github\samchon\typia\test\bin\features\assert\test_assert_UltimateUnion.js:115:63)
at D:\github\samchon\typia\test\bin\features\assert\test_assert_UltimateUnion.js:854:31
at Array.every (<anonymous>)
at D:\github\samchon\typia\test\bin\features\assert\test_assert_UltimateUnion.js:850:37
at D:\github\samchon\typia\test\bin\features\assert\test_assert_UltimateUnion.js:862:27
at D:\github\samchon\typia\test\bin\features\assert\test_assert_UltimateUnion.js:865:8
at D:\github\samchon\typia\test\bin\internal\_test_assert.js:11:24 {
method: 'typia.assert',
path: '$input[0]["__@tag@9875"]',
expected: 'Array<unknown>',
value: undefined
} |
@samchon |
Hmm, you can remove it if you want |
…e bit emension on the `unique symbol` tag type.
This is a small PR.
This PR modify
IJsonApplication
types.Now
IJsonApplication
keeps the original Type which is passed totypia.json.application
.This is useful if we make third-party library using typia(ex. https://github.com/ryoppippi/typiautil/blob/ab71cf9cbb73c751474136c6698a3ea23eb8f4b1/openai/mod.ts#L17)