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
https://typia.io/playground/?script=JYWwDg9gTgLgBDAnmYBDOAzKERwERIqp4DcAUGYWgHQA2wMAplKrQM4A8A5AIJdwAfOADsArrVoA+ABQBKIA
Currently null does not work, the extends for literals does not allow for it and when suppressing the error it just omits the value from the array
The text was updated successfully, but these errors were encountered:
I think that null cannot be distinguished as constant literal value of atomic values.
In JS classification, null is a type of object. Therefore, current typia supports only those types in literals function.
Sorry, something went wrong.
I don't quite see how that affects it, I managed to add a few lines of code into literalsProgrammer to get nulls to work
I'd happily take a closer look at the original code but I can't seem to get the tests to work
A bit off topic: I wanted to add a github action step to check that the test:generate has been run, seemed to notify just fine, but after running test:generate the tests don't seem to pass https://github.com/KristjanTammekivi/typia/actions/runs/5414154249/jobs/9840790293
You can just check nullable through Metadata.nullable property in the LiteralsProgrammer.
Metadata.nullable
LiteralsProgrammer
Also, you have to change generic type of literals function to like below:
literals
export function literals<T extends Atomic.Type | null>(): T[];
samchon
Successfully merging a pull request may close this issue.
Feature Request
https://typia.io/playground/?script=JYWwDg9gTgLgBDAnmYBDOAzKERwERIqp4DcAUGYWgHQA2wMAplKrQM4A8A5AIJdwAfOADsArrVoA+ABQBKIA
Currently null does not work, the extends for literals does not allow for it and when suppressing the error it just omits the value from the array
The text was updated successfully, but these errors were encountered: