diff --git a/lib/connection.js b/lib/connection.js index 3d987af..272151e 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -43,7 +43,7 @@ module.exports = function Connection(opts) { var adaptor = module.adaptor(opts); - _.forEach(adaptor, function(prop, name) { + _.forIn(adaptor, function(prop, name) { if (name === "constructor") { return; } @@ -56,7 +56,7 @@ module.exports = function Connection(opts) { if (testMode()) { var testAdaptor = Registry.findByAdaptor("test").adaptor(opts); - _.forEach(adaptor, function(prop, name) { + _.forIn(adaptor, function(prop, name) { if (_.isFunction(prop) && !testAdaptor[name]) { testAdaptor[name] = function() { return true; }; } diff --git a/lib/device.js b/lib/device.js index ee1c974..75311c9 100644 --- a/lib/device.js +++ b/lib/device.js @@ -44,7 +44,7 @@ module.exports = function Device(opts) { var driver = module.driver(opts); - _.forEach(driver, function(prop, name) { + _.forIn(driver, function(prop, name) { if (name === "constructor") { return; } @@ -57,7 +57,7 @@ module.exports = function Device(opts) { if (testMode()) { var testDriver = Registry.findByDriver("test").driver(opts); - _.forEach(driver, function(prop, name) { + _.forIn(driver, function(prop, name) { if (_.isFunction(prop) && !testDriver[name]) { testDriver[name] = function() { return true; }; }