Browse Source

EAGLESIX-2992: Organizing the code to be better understood.

Scott Munday 11 years ago
parent
commit
f08eb3b8d7
1 changed files with 8 additions and 7 deletions
  1. 8 7
      lib/pipeline/matcher/TypeMatchExpression.js

+ 8 - 7
lib/pipeline/matcher/TypeMatchExpression.js

@@ -66,19 +66,20 @@ klass.type = function type(e) {
 		case 'boolean':
 			return 8;
 		case 'object':
-			if (e instanceof Array)
+			if (e instanceof Array) {
 				return 4;
-			if (e instanceof RegExp)
+			} else if (e instanceof RegExp) {
 				return 11;
-			if (e instanceof Date)
+			} else if (e instanceof Date) {
 				return 9;
-			if (e.constructor.name == 'MinKey')
+			} else if (e.constructor.name == 'MinKey') {
 				return -1;
-			if (e.constructor.name == 'MaxKey')
+			} else if (e.constructor.name == 'MaxKey') {
 				return 127;
-		default:
-			return 42;
+			}
 	}
+
+	return 42;
 };
 
 /**