From a5f667362f85c0fed4f5f7a315f584c45c816d27 Mon Sep 17 00:00:00 2001 From: Jakub Pawlowicz Date: Fri, 26 Sep 2014 15:23:40 +0100 Subject: [PATCH] Removes EmptyRemoval as no longer needed. --- lib/clean.js | 1 - lib/selectors/empty-removal.js | 30 ------------------------------ 2 files changed, 31 deletions(-) delete mode 100644 lib/selectors/empty-removal.js diff --git a/lib/clean.js b/lib/clean.js index 86e191e3..42c71232 100644 --- a/lib/clean.js +++ b/lib/clean.js @@ -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 index 5ce39c81..00000000 --- a/lib/selectors/empty-removal.js +++ /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); - } - }; -}; -- 2.34.1