Comparing version 1.1.1 to 1.1.2
@@ -96,2 +96,3 @@ // Load modules | ||
typeof target[key] !== 'object' || | ||
(Array.isArray(target[key]) ^ Array.isArray(value)) || | ||
value instanceof Date || | ||
@@ -98,0 +99,0 @@ value instanceof Buffer || |
{ | ||
"name": "hoek", | ||
"description": "General purpose node utilities", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"repository": "git://github.com/spumko/hoek", | ||
@@ -6,0 +6,0 @@ "main": "index", |
@@ -224,2 +224,40 @@ // Load modules | ||
it('merges array over an object', function (done) { | ||
var a = { | ||
x: ['n', 'm'] | ||
}; | ||
var b = { | ||
x: { | ||
n: '1', | ||
m: '2' | ||
} | ||
}; | ||
Hoek.merge(b, a); | ||
expect(a.x[0]).to.equal('n'); | ||
expect(a.x.n).to.not.exist; | ||
done(); | ||
}); | ||
it('merges object over an array', function (done) { | ||
var a = { | ||
x: ['n', 'm'] | ||
}; | ||
var b = { | ||
x: { | ||
n: '1', | ||
m: '2' | ||
} | ||
}; | ||
Hoek.merge(a, b); | ||
expect(a.x.n).to.equal('1'); | ||
expect(a.x[0]).to.not.exist; | ||
done(); | ||
}); | ||
it('does not throw if source is null', function (done) { | ||
@@ -226,0 +264,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
105802
1432