We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2ba4482 commit becde37Copy full SHA for becde37
src/Gren/Kernel/Json.js
@@ -231,7 +231,7 @@ function _Json_runHelp(decoder, value) {
231
232
var keyValuePairs = [];
233
for (var key in value) {
234
- if (value.hasOwnProperty(key)) {
+ if (Object.hasOwn(value, key)) {
235
var result = _Json_runHelp(decoder.__decoder, value[key]);
236
if (!__Result_isOk(result)) {
237
return __Result_Err(
@@ -414,7 +414,10 @@ function _Json_emptyObject() {
414
}
415
416
var _Json_addField = F3(function (key, value, object) {
417
- object[key] = _Json_unwrap(value);
+ var unwrapped = _Json_unwrap(value);
418
+ if (!(key === "toJSON" && typeof unwrapped === "function")) {
419
+ object[key] = unwrapped;
420
+ }
421
return object;
422
});
423
0 commit comments