Permalink
Browse files

export servers and clients independently

  • Loading branch information...
1 parent 066d378 commit 45ffe0abb4eed38e861c5e49fc638a4830fd775e @substack substack committed Dec 15, 2010
Showing with 9 additions and 11 deletions.
  1. +9 −11 lib/index.js
View
@@ -3,14 +3,12 @@ var mod = module.exports = {
servers : require('./servers')
};
-Object.keys(mod.clients)
- .filter(function (key) {
- return mod.servers[key];
- })
- .forEach(function (key) {
- mod[key] = {
- createServer : mod.servers[key],
- createConnection : mod.clients[key],
- };
- })
-;
+Object.keys(mod.servers).forEach(function (key) {
+ if (!mod[key]) mod[key] = {};
+ mod[key].createServer = mod.servers[key];
+});
+
+Object.keys(mod.clients).forEach(function (key) {
+ if (!mod[key]) mod[key] = {};
+ mod[key].createConnection = mod.clients[key];
+});

0 comments on commit 45ffe0a

Please sign in to comment.