[Groonga-commit] groonga/express-kotoumi [master] Simplify createHandler() for API registeration

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Jan 16 17:13:18 JST 2013


YUKI Hiroshi	2013-01-16 17:13:18 +0900 (Wed, 16 Jan 2013)

  New Revision: df6da5bc61cfd19c18f59d253275818c4e13ccdb
  https://github.com/groonga/express-kotoumi/commit/df6da5bc61cfd19c18f59d253275818c4e13ccdb

  Log:
    Simplify createHandler() for API registeration

  Modified files:
    lib/index.js

  Modified: lib/index.js (+4 -9)
===================================================================
--- lib/index.js    2013-01-16 17:12:19 +0900 (bee5cf1)
+++ lib/index.js    2013-01-16 17:13:18 +0900 (66c69ef)
@@ -27,15 +27,10 @@ express.application.kotoumi = function(params) {
   }
 
   function createHandler(type) {
-  
-    return (
-      (
-        handlersFactory &&
-        typeof handlersFactory[type] == 'function' &&
-        handlersFactory[type](connection)
-      ) ||
-      createDefaultHandler(type, connection)
-    );
+    if (handlersFactory)
+      return handlersFactory[type](connection);
+    else
+      return createDefaultHandler(type, connection);
   }
 
 //  this.get(prefix + '/status/:target', createHandler('status'));
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index