defekt
defekt copied to clipboard
data attribute might not always be optional
What is this issue about?
At the moment you can set a type for data attribute of a custom error, but it will still always be optional. This seems like an unnecessary restriction. By default the type of data is any, so therefore optional anyway and if you want it to be optional for the custom type you provide, you could just write it explicitly like t | undefined. So I think we can safely make it the data attribute required.