}
function reduce(body, options) {
- return body.map(function (token) {
+ var reduced = [];
+
+ for (var i = 0, l = body.length; i < l; i++) {
+ var token = body[i];
var firstColon = token.indexOf(':');
var property = token.substring(0, firstColon);
var value = token.substring(firstColon + 1);
var important = false;
if (!options.compatibility && (property[0] == '_' || property[0] == '*'))
- return '';
+ continue;
if (value.indexOf('!important') > 0 || value.indexOf('! important') > 0) {
value = value.substring(0, value.indexOf('!')).trim();
value = multipleZerosMinifier(property, value);
value = colorMininifier(property, value, options.compatibility);
- return property + ':' + value + (important ? '!important' : '');
- });
+ reduced.push(property + ':' + value + (important ? '!important' : ''));
+ }
+
+ return reduced;
}
SimpleOptimizer.prototype.optimize = function(tokens) {