ether fix my code or replace all undefined with nu...
# pact-js
a
m
I think I should update the Typescript type to prevent the use of undefined in the parameters - that’s the first step
but it won’t fix JS users, so it will need some validation also
I think we should explictly error if we find
undefined
because it may lead to unintended consequences
👍 1
In your case, I’m not sure what works best - replacing
undefined
with
null
or some alternative?
a
I'm trying now
Copy code
optionalParams = JSON.stringify(optionalParams)
  optionalParams = JSON.parse(optionalParams)
that should delete all keys with undefined values
💯 1
message has been deleted
THX
m
Excellent! Thanks for letting me know. I'll fix the above in the next release (next few days)
I’ve made a patch locally for this. It’s not my ideal solution, but having it will prevent a regression and provide a target for addressing later.
I’ll push it up in the next couple of days