api-check
api-check copied to clipboard
New Checker: nothing
So the expected way to make sure that a property does not exist is to just not include it in the apiCheck specification, correct? But I think there might be a use case for having a type called nothing
that will fail if the user provides the property and pass if they don't.
To use an example from formly, I've written a custom formly type that doesn't make use of formly's key
property. To make sure users of the type don't expect it to use the key
property I'd like to override the base formly apiCheck that makes sure key is string
and instead make sure it's not included.
Honestly, I'm not even sure the override would work with formly. But if it would, would there be a use case for a nothing
type? Or am I missing something?
I think there's definitely a use-case for a nothing type. Feel free to makeapullrequest.com!
As for you're specific use case... Hmmm... You probably shouldn't try to override the formly check. That'd probably not wouldn't. But you could give that type a controller and manually throw an error there.