diff --git a/lib/nconf/stores/memory.js b/lib/nconf/stores/memory.js index a74cc8f..6205742 100644 --- a/lib/nconf/stores/memory.js +++ b/lib/nconf/stores/memory.js @@ -42,7 +42,7 @@ Memory.prototype.get = function (key) { // while (path.length > 0) { key = path.shift(); - if (target && typeof target !== 'string' && key in target) { + if (target && target.hasOwnProperty(key)) { target = target[key]; continue; } diff --git a/test/stores/memory-store-test.js b/test/stores/memory-store-test.js index f79fd50..5caf488 100644 --- a/test/stores/memory-store-test.js +++ b/test/stores/memory-store-test.js @@ -58,7 +58,7 @@ vows.describe('nconf/stores/memory').addBatch({ assert.equal(store.get('falsy:string:empty:not:exist'), undefined); }, TypeError); }, - "within empty strings": function (store) { + "within non-empty strings": function (store) { assert.doesNotThrow(function() { assert.equal(store.get('falsy:string:value:not:exist'), undefined); }, TypeError); @@ -105,4 +105,4 @@ vows.describe('nconf/stores/memory').addBatch({ } } } -}).export(module); \ No newline at end of file +}).export(module);