Simplifies regular expressions in CleanUp module.
authorJakub Pawlowicz <contact@jakubpawlowicz.com>
Sun, 7 Dec 2014 22:12:01 +0000 (22:12 +0000)
committerJakub Pawlowicz <contact@jakubpawlowicz.com>
Mon, 8 Dec 2014 09:42:55 +0000 (09:42 +0000)
lib/selectors/optimizers/clean-up.js

index d60f79f..3d0ac9d 100644 (file)
@@ -46,15 +46,14 @@ var CleanUp = {
 
   block: function (block) {
     return block
-      .replace(/(\s{2,}|\s)/g, ' ')
+      .replace(/\s+/g, ' ')
       .replace(/(,|:|\() /g, '$1')
       .replace(/ \)/g, ')');
   },
 
   atRule: function (block) {
     return block
-      .replace(/\s/g, ' ')
-      .replace(/\s{2,}/g, ' ')
+      .replace(/\s+/g, ' ')
       .trim();
   }
 };