Comparing version 0.0.5 to 0.0.6
@@ -10,3 +10,4 @@ // Load modules | ||
var internals = { | ||
indentLevel: 0 | ||
indentLevel: 0, | ||
seen: [] | ||
}; | ||
@@ -37,2 +38,7 @@ | ||
if (internals.seen.indexOf(object) !== -1) { | ||
return '[Circular]'.grey.bold; | ||
} | ||
internals.seen.push(object); | ||
var keys = Object.keys(object); | ||
@@ -39,0 +45,0 @@ var out = '{\n'; |
{ | ||
"name": "purdy", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "print objects real purdy", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -24,2 +24,8 @@ var Lab = require('lab'); | ||
Purdy([1,2,'foo', it, Array.isArray, new Date,1,1,1,1,12,[1,2]]); | ||
var circularObj = { | ||
a: { | ||
b: {} | ||
} | ||
}; | ||
circularObj.a.b = circularObj.a; | ||
Purdy({ | ||
@@ -35,3 +41,4 @@ a: 3, | ||
trueBool: true, | ||
emptyArr: [] | ||
emptyArr: [], | ||
circular: circularObj | ||
}); | ||
@@ -38,0 +45,0 @@ done(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5081
142