utils
utils copied to clipboard
Forbid `undefined` values on request and response objects
Here's the problem:
> JSON.stringify({ foo: undefined })
'{}'
Any request or response objects that are serialized before being transported will lose any fields with the value undefined
. Introspecting params
or errors to suss out such fields is beyond the scope of this package, but there's an argument that we should throw errors if we detect that any top-level top-level request or response property exists and has the value undefined
.
That may also be out of scope for this package, but this is as good a place to track it as any.