Here's the structure of the object:
{ where: { [Symbol(or)]: [ [Object], [Object] ] },hooks: true, rejectOnEmpty: false }
When I use JSON.stringify
on it, the result is:
{"where":{},"hooks":true,"rejectOnEmpty":false}
This happens because [Symbol(or)]
is undefined and gets removed by stringify
.
The value originates from Sequelize
operators, particularly Op.or
. Is there a way to make stringify
convert this into a string, so the output would be:
{"where":{"[Symbol(or)]": [[<<stringifiedObject>>], [<<stringifiedObject>>]]},"hooks":true,"rejectOnEmpty":false}
I am aware that I could use a custom function with JSON.stringify
to replace undefined
with a placeholder, but I prefer to keep the original Symbol in the string to differentiate between Symbol(and)
and Symbol(or)
, even if both are undefined.