Removes EmptyRemoval as no longer needed.
authorJakub Pawlowicz <contact@jakubpawlowicz.com>
Fri, 26 Sep 2014 14:23:40 +0000 (15:23 +0100)
committerJakub Pawlowicz <contact@jakubpawlowicz.com>
Fri, 10 Oct 2014 20:22:44 +0000 (21:22 +0100)
lib/clean.js
lib/selectors/empty-removal.js [deleted file]

index 86e191e..42c7123 100644 (file)
@@ -12,7 +12,6 @@ var ColorLongToShortHex = require('./colors/long-to-short-hex');
 
 var ImportInliner = require('./imports/inliner');
 var UrlRebase = require('./images/url-rebase');
-var EmptyRemoval = require('./selectors/empty-removal');
 
 var CommentsProcessor = require('./text/comments');
 var ExpressionsProcessor = require('./text/expressions');
diff --git a/lib/selectors/empty-removal.js b/lib/selectors/empty-removal.js
deleted file mode 100644 (file)
index 5ce39c8..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-module.exports = function EmptyRemoval(data) {
-  var stripEmpty = function(cssData) {
-    var tempData = [];
-    var nextEmpty = 0;
-    var cursor = 0;
-
-    for (; nextEmpty < cssData.length;) {
-      nextEmpty = cssData.indexOf('{}', cursor);
-      if (nextEmpty == -1)
-        break;
-
-      var startsAt = nextEmpty - 1;
-      while (cssData[startsAt] && cssData[startsAt] != '}' && cssData[startsAt] != '{' && cssData[startsAt] != ';')
-        startsAt--;
-
-      tempData.push(cssData.substring(cursor, startsAt + 1));
-      cursor = nextEmpty + 2;
-    }
-
-    return tempData.length > 0 ?
-      stripEmpty(tempData.join('') + cssData.substring(cursor, cssData.length)) :
-      cssData;
-  };
-
-  return {
-    process: function() {
-      return stripEmpty(data);
-    }
-  };
-};