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
Hello! I noticed some peculiarity when working with optional properties. For example:
interface SomeInterface { someOptionalProperty?: string; } const value: SomeInterface = { someOptionalProperty: undefined };
This code is quite valid and can be compiled without any problems.
Example with assertType: For example:
interface SomeInterface { someOptionalProperty?: string; } const value: SomeInterface = assertType<SomeInterface>({ someOptionalProperty: undefined });
In this case, I will get the error:
TypeGuardError: validation failed at $.someOptionalProperty: expected a string
The text was updated successfully, but these errors were encountered:
@woutervh- Can you check it please?
Sorry, something went wrong.
hi @mvcbox
This is by design. Please see #25 for more info ;)
@woutervh- , okay( Thank for answer
No branches or pull requests
Hello!
I noticed some peculiarity when working with optional properties.
For example:
This code is quite valid and can be compiled without any problems.
Example with assertType:
For example:
In this case, I will get the error:
The text was updated successfully, but these errors were encountered: