json-cycle
Advanced tools
Comparing version 1.4.0 to 1.5.0
@@ -47,7 +47,12 @@ 'use strict'; | ||
var _value = value && value.toJSON instanceof Function ? value.toJSON() : value; | ||
var _value = value | ||
try { | ||
_value = value.toJSON() | ||
} catch (error) {} | ||
// typeof null === 'object', so go on if this value is really an object but not | ||
// one of the weird builtin objects. | ||
if (typeof _value === 'object' && _value !== null) { | ||
if (typeof _value === 'object' && _value) { | ||
// If the value is an object or array, look to see if we have already | ||
@@ -54,0 +59,0 @@ // encountered it. If so, return a $ref/path object. This is a hard way, |
{ | ||
"name": "json-cycle", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"description": "Encode/decode circular structures for converting to and from JSON.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
11382
124