We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Write a short summary of the bug in here.
Write detailed description in here.
When trying to write a validator that accepts tuples (with noUncheckedIndexedAccess enabled) I receive the following errors:
src/types_gen/dialogueTypes.ts:39:21 - error TS2532: Object is possibly 'undefined'. 39 if (pred[0](array)) ... more of the same...
I believe the fix is simply to change the compiled code to be if (pred[0]!(array)) as it looks overall a safe lookup. I believe this can be accomplished by adding the exclamation marks to the createIdentifier lines on 136 and 142 (but not familiar enough with the code to be sure): https://github.com/samchon/typia/blob/b0005b7516d58dadcda9f2afbaf645cc42a165e1/src/programmers/internal/check_union_array_like.ts#L136C9-L142C67
if (pred[0]!(array))
https://typia.io/playground/?script=JYWwDg9gTgLgBDAnmYBDANHA3g1BzAZzgF84AzKCEOAIiRVRoG4AoF4AOxgFMozUAxtzgAxCBGxwpcFlIBGqKAC44AbQ4BXEHN6YAdAc3beqgLqmAPqoIwonPPoM27HPGdMtibAPTeAtAF+LL5wAGoAggAyAJIAIuEAKtEA8gBywf6BLPRoegJQ3Kg80QQAPGIQAHwAFACUrBmBQSEASuGpsckAso1ZOah5BUXcLagcACZU5eI19T6ZARlwAFIAymm9i-16AFYEEByDhTyrtvbAZIjTVXUNIb5NSyEACi3JCckAwsmRcABCAFURCIAKItJ4LZreBDIXJgSgwCByDRkI7DEEcAQQcbca6zVhAA
import typia from "typia"; interface Foo { bar: [number, ...number[]]|[string, ...string[]] } const test = typia.createValidateEquals<Foo>();
The text was updated successfully, but these errors were encountered:
4b91066
Merge pull request #805 from samchon/features/noUncheckedIndexedAccess
e387322
Fix #804 - support `noUncheckedIndexedAccess` option.
Thanks for bug reporting. Upgrade to v5.0.2, then it would be fixed.
v5.0.2
Sorry, something went wrong.
Woah, was not expecting a fix this fast!
Confirmed on my end, and now I can delete ~30 lines of validation code.
Thanks so much!!!
samchon
No branches or pull requests
📝 Summary
Write a short summary of the bug in here.
Write detailed description in here.
When trying to write a validator that accepts tuples (with noUncheckedIndexedAccess enabled) I receive the following errors:
I believe the fix is simply to change the compiled code to be
if (pred[0]!(array))
as it looks overall a safe lookup. I believe this can be accomplished by adding the exclamation marks to the createIdentifier lines on 136 and 142 (but not familiar enough with the code to be sure): https://github.com/samchon/typia/blob/b0005b7516d58dadcda9f2afbaf645cc42a165e1/src/programmers/internal/check_union_array_like.ts#L136C9-L142C67⏯ Playground Link
https://typia.io/playground/?script=JYWwDg9gTgLgBDAnmYBDANHA3g1BzAZzgF84AzKCEOAIiRVRoG4AoF4AOxgFMozUAxtzgAxCBGxwpcFlIBGqKAC44AbQ4BXEHN6YAdAc3beqgLqmAPqoIwonPPoM27HPGdMtibAPTeAtAF+LL5wAGoAggAyAJIAIuEAKtEA8gBywf6BLPRoegJQ3Kg80QQAPGIQAHwAFACUrBmBQSEASuGpsckAso1ZOah5BUXcLagcACZU5eI19T6ZARlwAFIAymm9i-16AFYEEByDhTyrtvbAZIjTVXUNIb5NSyEACi3JCckAwsmRcABCAFURCIAKItJ4LZreBDIXJgSgwCByDRkI7DEEcAQQcbca6zVhAA
💻 Code occuring the bug
The text was updated successfully, but these errors were encountered: