Comparing version 0.0.12 to 0.0.13
@@ -42,3 +42,4 @@ (function() { | ||
} | ||
base = base[lastName] = ((typeof base[lastName] === "object") ? base[lastName] : undefined) || value || Object.create(null); | ||
base = base[lastName] = ((typeof base[lastName] === "object") ? base[lastName] : undefined) || | ||
((value === null || typeof value === "undefined") ? Object.create(null) : value); | ||
} | ||
@@ -45,0 +46,0 @@ |
{ | ||
"name": "esq", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"description": "Easily build elasticsearch queries", | ||
@@ -5,0 +5,0 @@ "author": "Rahul Patel <rahul.patel@holidayextras.com>", |
@@ -48,2 +48,13 @@ var assert = require('assert'); | ||
}); | ||
it('with zero value', function() { | ||
var result = esq.query('foo', 0); | ||
assert.deepEqual(result, { foo: 0 }); | ||
}); | ||
it('with false value', function() { | ||
var result = esq.query('foo', false); | ||
assert.deepEqual(result, { foo: false }); | ||
}); | ||
}); | ||
@@ -70,2 +81,12 @@ | ||
it('with zero value parameter', function() { | ||
esq._createNestedObject(base, ['a', 'b'], 0); | ||
assert.deepEqual(base, { a: { b: 0 } }); | ||
}); | ||
it('with false value parameter', function() { | ||
esq._createNestedObject(base, ['a', 'b'], false); | ||
assert.deepEqual(base, { a: { b: false } }); | ||
}); | ||
it('with object type value parameters', function() { | ||
@@ -72,0 +93,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
33824
634