Is there a way for an object predicate to differentiate between key with value undefined
, and key not present?
#234
Labels
undefined
, and key not present?
#234
If we want to validate an object with optional parameters for a spread:
This doesn't work, as ow will assert
patchBody
aswhen really we want
Which makes a difference, as js treats undefined value and no key differently when spreading:
Unless I'm missing something, it doesn't look like
ow
provides a way to do this out of the box.In the mean time, I've worked around this by passing in an explicit type argument:
The text was updated successfully, but these errors were encountered: