just-is-circular
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -38,5 +38,5 @@ module.exports = isCircular; | ||
JSON.stringify(obj); | ||
} catch(err) { | ||
} catch (err) { | ||
var index = errorKeywords.length; | ||
while(index--) { | ||
while (index--) { | ||
if (err.message.indexOf(errorKeywords[index]) > -1) { | ||
@@ -43,0 +43,0 @@ return true; |
{ | ||
"name": "just-is-circular", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "determine if an object contains a circular reference", | ||
@@ -10,10 +10,3 @@ "main": "index.js", | ||
"repository": "https://github.com/angus-c/just", | ||
"keywords": [ | ||
"object", | ||
"circular", | ||
"reference", | ||
"structure", | ||
"no-dependencies", | ||
"just" | ||
], | ||
"keywords": ["object", "circular", "reference", "structure", "no-dependencies", "just"], | ||
"author": "Angus Croll", | ||
@@ -20,0 +13,0 @@ "license": "MIT", |
## just-is-circular | ||
Part of a [library](../../../../) of zero-dependency npm modules that do just do one thing. | ||
Part of a [library](../../../../) of zero-dependency npm modules that do just do | ||
one thing.\ | ||
Guilt-free utilities for every occasion. | ||
@@ -8,2 +9,4 @@ | ||
NOTE: not supported in IE or microsoft edge | ||
```js | ||
@@ -13,23 +16,23 @@ import isCircular from 'just-is-circular'; | ||
a.b = a; | ||
isCircular(a) // true | ||
isCircular(a); // true | ||
const a = {}; | ||
a.b = { | ||
c: a | ||
} | ||
isCircular(a) // true | ||
c: a | ||
}; | ||
isCircular(a); // true | ||
const a = {}; | ||
a.b = { | ||
c: 4 | ||
} | ||
isCircular(a) // false | ||
c: 4 | ||
}; | ||
isCircular(a); // false | ||
const a = []; | ||
a.push(a); | ||
isCircular(a) // true | ||
isCircular(a); // true | ||
isCircular({}) // false | ||
isCircular('hi') // false | ||
isCircular(undefined) // false | ||
isCircular({}); // false | ||
isCircular('hi'); // false | ||
isCircular(undefined); // false | ||
``` |
1879
37