INFRA-132 - js/model/crm.uf.js - Cleanup empty checks to satisfy jshint
authorTim Otten <totten@civicrm.org>
Mon, 5 Jan 2015 21:45:11 +0000 (13:45 -0800)
committerTim Otten <totten@civicrm.org>
Mon, 5 Jan 2015 21:46:28 +0000 (13:46 -0800)
js/model/crm.uf.js

index 08b725a0a1dcf59951f182843a7fd621777fdc14..9ed880d157e988927164f0d5c9ac3326b460ba65 100644 (file)
     var coreTypesExpr = parts[0];
     var subTypesExpr = parts[1];
 
-    if (coreTypesExpr && coreTypesExpr != '') {
+    if (!_.isEmpty(coreTypesExpr)) {
       _.each(coreTypesExpr.split(','), function(coreType){
         typeList.coreTypes[coreType] = true;
       });
     }
 
     //CRM-15427 Allow Multiple subtype filtering
-    if (subTypesExpr && subTypesExpr != '') {
+    if (!_.isEmpty(subTypesExpr)) {
       if (subTypesExpr.indexOf(';;') !== -1) {
         var subTypeparts = subTypesExpr.replace(/;;/g,'\0').split('\0');
         _.each(subTypeparts, function(subTypepart) {
             case 'create':
             case 'update':
             case 'delete':
+              throw 'Unsupported method: ' + method;
+
             default:
               throw 'Unsupported method: ' + method;
           }
     checkGroupType: function(validTypesExpr, allowAllSubtypes) {
       var allMatched = true;
       allowAllSubtypes = allowAllSubtypes || false;
-      if (! this.get('group_type') || this.get('group_type') == '') {
+      if (_.isEmpty(this.get('group_type'))) {
         return true;
       }