From: Jakub Pawlowicz Date: Fri, 26 Sep 2014 14:23:40 +0000 (+0100) Subject: Removes EmptyRemoval as no longer needed. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=a5f667362f85c0fed4f5f7a315f584c45c816d27;p=clean-css.git Removes EmptyRemoval as no longer needed. --- 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); - } - }; -};