Comparing version 2.0.2 to 2.0.3
@@ -43,3 +43,3 @@ // Part of https://github.com/chris-rock/node-crypto-examples | ||
// recursively encrypt | ||
if (typeof v[item] === 'object') { | ||
if (v[item] && typeof v[item] === 'object') { | ||
acc[item] = e(v[item]) | ||
@@ -46,0 +46,0 @@ return acc; |
{ | ||
"name": "deepcrypt", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "encrypt/decrypt js objects", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -8,3 +8,3 @@ var test = require('tape') | ||
t.plan(8) | ||
t.plan(10) | ||
// basic tests | ||
@@ -14,2 +14,4 @@ t.deepEqual(deepDecrypt(deepEncrypt({ foo: "foo" })), { foo: "foo" }); | ||
t.deepEqual(deepDecrypt(deepEncrypt({ foo: 1, bar: true })), { foo: 1, bar: true }); | ||
t.deepEqual(deepDecrypt(deepEncrypt({ bar: null })), { bar: null }); | ||
t.deepEqual(deepDecrypt(deepEncrypt({ foo: undefined, bar: null })), { foo: undefined, bar: null }); | ||
@@ -16,0 +18,0 @@ // test exlude fields |
5599
107