Comparing version 0.8.4 to 0.8.5
@@ -36,3 +36,6 @@ // Load modules | ||
if (obj.hasOwnProperty(i)) { | ||
if (obj[i] instanceof Date) { | ||
if (obj[i] instanceof Buffer) { | ||
newObj[i] = new Buffer(obj[i]); | ||
} | ||
else if (obj[i] instanceof Date) { | ||
newObj[i] = new Date(obj[i].getTime()); | ||
@@ -39,0 +42,0 @@ } |
{ | ||
"name": "hoek", | ||
"description": "General purpose node utilities", | ||
"version": "0.8.4", | ||
"version": "0.8.5", | ||
"author": "Eran Hammer <eran@hueniverse.com> (http://hueniverse.com)", | ||
@@ -6,0 +6,0 @@ "contributors":[ |
@@ -186,2 +186,16 @@ // Load modules | ||
}); | ||
it('should copy a buffer', function(done){ | ||
var tls = { | ||
key: new Buffer([1,2,3,4,5]), | ||
cert: new Buffer([1,2,3,4,5,6,10]) | ||
} | ||
copiedTls = Hoek.clone(tls); | ||
expect(Buffer.isBuffer(copiedTls.key)).to.equal(true); | ||
expect(JSON.stringify(copiedTls.key)).to.equal(JSON.stringify(tls.key)) | ||
expect(Buffer.isBuffer(copiedTls.cert)).to.equal(true); | ||
expect(JSON.stringify(copiedTls.cert)).to.equal(JSON.stringify(tls.cert)) | ||
done(); | ||
}); | ||
}); | ||
@@ -188,0 +202,0 @@ |
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
101270
1305