Comparing version 0.0.7 to 0.0.8
@@ -25,3 +25,9 @@ (function() { | ||
for (var i=0; i<names.length; i++) { | ||
base = base[names[i]] = base[names[i]] || { }; | ||
if(names[i] instanceof Array) { | ||
names[i] = names[i][0]; | ||
base[names[i]] = base[names[i]] || []; | ||
base = base[names[i]][base[names[i]].length] = {}; | ||
} else { | ||
base = base[names[i]] = base[names[i]] || { }; | ||
} | ||
} | ||
@@ -28,0 +34,0 @@ |
{ | ||
"name": "esq", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "Easily build elasticsearch queries", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -63,2 +63,8 @@ var assert = require('assert'); | ||
it('with array type name parameters', function() { | ||
esq._createNestedObject(base, [['a'], 'b'], 'c'); | ||
esq._createNestedObject(base, [['a'], 'd'], 'e'); | ||
assert.deepEqual(base, { a: [ { b: 'c' }, { d: 'e' } ] }); | ||
}); | ||
it('with array type value parameters', function() { | ||
@@ -65,0 +71,0 @@ esq._createNestedObject(base, ['a'], [{ b: 'c' }]); |
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
66904
577