Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b5df6b9

Browse files
author
James Halliday
committed
fix formatting
1 parent 7e139e8 commit b5df6b9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

‎index.js‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,18 @@ module.exports = function (obj, opts) {
3636
else {
3737
if (seen.indexOf(node) !== -1) {
3838
if (cycles) return stringify('__cycle__');
39-
else throw new TypeError('Converting circular structure to JSON');
40-
} else {
41-
seen.push(node);
39+
throw new TypeError('Converting circular structure to JSON');
4240
}
41+
else seen.push(node);
42+
4343
var keys = objectKeys(node).sort(cmp && cmp(node));
4444
var out = [];
4545
for (var i = 0; i < keys.length; i++) {
4646
var key = keys[i];
47-
var keyValue = stringify(key,0) + colonSeparator + stringify(node[key],level+1);
47+
var keyValue = stringify(key,0)
48+
+ colonSeparator
49+
+ stringify(node[key],level+1)
50+
;
4851
out.push(indent + space + keyValue);
4952
}
5053
return '{' + out.join(',') + indent + '}';

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /