redactyl.js
redactyl.js copied to clipboard
"TypeError: A valid JSON object must be specified" error with arrays containing string values in redactyl.js after updating from version 1.4.3
Hello,
I am experiencing an error after updating to higher versions from version 1.4.3 in redactyl.js
. Specifically, I am getting a TypeError: A valid JSON object must be specified
error when inserting an object into the redact
function. The object looks like this:
redactyl.redact({
emails: ['[email protected]']
})
This object worked perfectly fine in version 1.4.3, but after updating, the error started to occur. Interestingly, if I create a property in the object that looks like this: emails: [{ email: '[email protected]' }]
, the error is not thrown. So, it seems that the problem is caused when the property is an array with string values.
Any help resolving this issue would be greatly appreciated.
Thank you.
Hi, @FilipHavel . Thank you for posting this issue. I'm facing the same issue under the same circumstances.
Looks to have been introduced through https://github.com/rcjpisani/redactyl.js/pull/14.
Happy to raise PR and get this sorted if needed!