mirror of
https://github.com/donl/JSON-js.git
synced 2026-05-25 22:06:23 -06:00
For Kyle
This commit is contained in:
parent
f89de6216e
commit
40f3377a63
1 changed files with 9 additions and 3 deletions
12
cycle.js
12
cycle.js
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
cycle.js
|
||||
2012-07-18
|
||||
2012-08-19
|
||||
|
||||
Public Domain.
|
||||
|
||||
|
|
@ -54,9 +54,15 @@ if (typeof JSON.decycle !== 'function') {
|
|||
case 'object':
|
||||
|
||||
// typeof null === 'object', so get out if this value is not really an object.
|
||||
// Also get out if it is a weird builtin object.
|
||||
|
||||
if (!value) {
|
||||
return null;
|
||||
if (value === null ||
|
||||
value instanceof Boolean ||
|
||||
value instanceof Date ||
|
||||
value instanceof Number ||
|
||||
value instanceof RegExp ||
|
||||
value instanceof String) {
|
||||
return value;
|
||||
}
|
||||
|
||||
// If the value is an object or array, look to see if we have already
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue