You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
there seems to be a bug when you try to make unknown() optional. Let's take a look at the simple example:
const TestStruct = object({
foo: optional(string()),
baz: optional(unknown())
});
type Type = Infer<typeof TestStruct>;
Both foo and baz should be optional, but if you add the snippet to VSCode, hover mouse over Type, you can see that "foo" is optional, but "baz" is required.
If we compare this to the standard TS type:
type Type = {
baz?: unknown
}
If you hover mouse over "Type", you can see that "baz" is actually optional, which is also expected behaviour.
It looks like a bug to me? Please let me know what u guys think?
Amazing library btw! ;)
best regards,
Neon
The text was updated successfully, but these errors were encountered:
Hi there,
there seems to be a bug when you try to make unknown() optional. Let's take a look at the simple example:
Both foo and baz should be optional, but if you add the snippet to VSCode, hover mouse over Type, you can see that "foo" is optional, but "baz" is required.
If we compare this to the standard TS type:
If you hover mouse over "Type", you can see that "baz" is actually optional, which is also expected behaviour.
It looks like a bug to me? Please let me know what u guys think?
Amazing library btw! ;)
best regards,
Neon
The text was updated successfully, but these errors were encountered: