Comparing version 1.2.8 to 1.2.9
@@ -31,7 +31,11 @@ function TRBL(name) { | ||
var s = this.sides, | ||
i, x, side, a = []; | ||
i, x, side, a = [], | ||
last; | ||
if ((i = name.lastIndexOf('-')) !== -1) { | ||
side = name.substr(i + 1); | ||
if (side in s) { | ||
if (!s[side]) s[side] = { s: sValue, t: tValue[0] }; | ||
if (!s[side]) { | ||
s[side] = { s: sValue, t: [tValue[0]] }; | ||
if (tValue[0][1] === 'unary') s[side].t.push(tValue[1]); | ||
} | ||
return true; | ||
@@ -43,11 +47,14 @@ } | ||
switch(x[1]) { | ||
case 'unary': | ||
a.push({ s: x[2], t: last = [x] }); | ||
break; | ||
case 'number': | ||
case 'ident': | ||
a.push({ s: x[2], t: x }); | ||
last = (last ? last.push(x) : a.push({ s: x[2], t: [x] }), null); | ||
break; | ||
case 'percentage': | ||
a.push({ s: x[2][2] + '%', t: x }); | ||
last = (last ? last.push(x) : a.push({ s: x[2][2] + '%', t: [x] }), null); | ||
break; | ||
case 'dimension': | ||
a.push({ s: x[2][2] + x[3][2], t: x }); | ||
last = (last ? last.push(x) : a.push({ s: x[2][2] + x[3][2], t: [x] }), null); | ||
break; | ||
@@ -98,6 +105,6 @@ case 's': | ||
for (var i = 0; i < a.length - 1; i++) { | ||
r.push(a[i].t); | ||
r = r.concat(a[i].t); | ||
r.push([{ s: ' ' }, 's', ' ']); | ||
} | ||
r.push(a[i].t); | ||
r = r.concat(a[i].t); | ||
@@ -104,0 +111,0 @@ return r; |
var fs = require('fs'), | ||
print = require('sys').print, | ||
print = require('util').print, | ||
csso = require('./cssoapi.js'), | ||
@@ -32,3 +32,3 @@ src, x; | ||
if (single.contains(['-dp', '--parser'])) csso.printTree(csso.parse(src, rule)); | ||
if (single.contains(['-dp', '--parser'])) csso.printTree(csso.cleanInfo(csso.parse(src, rule))); | ||
else { | ||
@@ -35,0 +35,0 @@ if (!outFile) print(csso.justDoIt(src, ro)); |
@@ -607,2 +607,5 @@ function CSSOParser() {} | ||
var _b_; | ||
if (_b_ = this.$()._o('notselector')._()) { | ||
return _b_[0]; | ||
} | ||
if (_b_ = this.$()._o('ident')._o('.(')._o('functionBody')._o('.)')._()) { | ||
@@ -612,2 +615,20 @@ return [this._info(), 'funktion', _b_[0], _b_[2]]; | ||
}; | ||
CSSOParser.prototype.notselectorident = function() { | ||
var _b_; | ||
if (_b_ = this.$()._o('.not')._()) { | ||
return [this._info(), 'ident', _b_[0]]; | ||
} | ||
}; | ||
CSSOParser.prototype.notselector = function() { | ||
var _b_; | ||
if (_b_ = this.$()._o('notselectorident')._o('.(')._o('notselectorBody')._o('.)')._()) { | ||
return [this._info(), 'funktion', _b_[0], _b_[2]]; | ||
} | ||
}; | ||
CSSOParser.prototype.notselectorBody = function() { | ||
var _b_; | ||
if (_b_ = this.$()._zo('simpleselector')._()) { | ||
return [this._info(), 'functionBody', _b_[0]]; | ||
} | ||
}; | ||
CSSOParser.prototype.braces = function() { | ||
@@ -614,0 +635,0 @@ var _b_; |
{ | ||
"name": "csso", | ||
"description": "CSSO — CSS optimizer", | ||
"version": "1.2.8", | ||
"version": "1.2.9", | ||
"homepage": "http://github.com/afelix/csso", | ||
@@ -6,0 +6,0 @@ "author": "Sergey Kryzhanovsky <skryzhanovsky@ya.ru> (http://github.com/afelix)", |
@@ -31,7 +31,11 @@ function TRBL(name) { | ||
var s = this.sides, | ||
i, x, side, a = []; | ||
i, x, side, a = [], | ||
last; | ||
if ((i = name.lastIndexOf('-')) !== -1) { | ||
side = name.substr(i + 1); | ||
if (side in s) { | ||
if (!s[side]) s[side] = { s: sValue, t: tValue[0] }; | ||
if (!s[side]) { | ||
s[side] = { s: sValue, t: [tValue[0]] }; | ||
if (tValue[0][1] === 'unary') s[side].t.push(tValue[1]); | ||
} | ||
return true; | ||
@@ -43,11 +47,14 @@ } | ||
switch(x[1]) { | ||
case 'unary': | ||
a.push({ s: x[2], t: last = [x] }); | ||
break; | ||
case 'number': | ||
case 'ident': | ||
a.push({ s: x[2], t: x }); | ||
last = (last ? last.push(x) : a.push({ s: x[2], t: [x] }), null); | ||
break; | ||
case 'percentage': | ||
a.push({ s: x[2][2] + '%', t: x }); | ||
last = (last ? last.push(x) : a.push({ s: x[2][2] + '%', t: [x] }), null); | ||
break; | ||
case 'dimension': | ||
a.push({ s: x[2][2] + x[3][2], t: x }); | ||
last = (last ? last.push(x) : a.push({ s: x[2][2] + x[3][2], t: [x] }), null); | ||
break; | ||
@@ -98,6 +105,6 @@ case 's': | ||
for (var i = 0; i < a.length - 1; i++) { | ||
r.push(a[i].t); | ||
r = r.concat(a[i].t); | ||
r.push([{ s: ' ' }, 's', ' ']); | ||
} | ||
r.push(a[i].t); | ||
r = r.concat(a[i].t); | ||
@@ -104,0 +111,0 @@ return r; |
@@ -639,2 +639,5 @@ var $util = {}; | ||
var _b_; | ||
if (_b_ = this.$()._o('notselector')._()) { | ||
return _b_[0]; | ||
} | ||
if (_b_ = this.$()._o('ident')._o('.(')._o('functionBody')._o('.)')._()) { | ||
@@ -644,2 +647,20 @@ return [this._info(), 'funktion', _b_[0], _b_[2]]; | ||
}; | ||
CSSOParser.prototype.notselectorident = function() { | ||
var _b_; | ||
if (_b_ = this.$()._o('.not')._()) { | ||
return [this._info(), 'ident', _b_[0]]; | ||
} | ||
}; | ||
CSSOParser.prototype.notselector = function() { | ||
var _b_; | ||
if (_b_ = this.$()._o('notselectorident')._o('.(')._o('notselectorBody')._o('.)')._()) { | ||
return [this._info(), 'funktion', _b_[0], _b_[2]]; | ||
} | ||
}; | ||
CSSOParser.prototype.notselectorBody = function() { | ||
var _b_; | ||
if (_b_ = this.$()._zo('simpleselector')._()) { | ||
return [this._info(), 'functionBody', _b_[0]]; | ||
} | ||
}; | ||
CSSOParser.prototype.braces = function() { | ||
@@ -945,7 +966,11 @@ var _b_; | ||
var s = this.sides, | ||
i, x, side, a = []; | ||
i, x, side, a = [], | ||
last; | ||
if ((i = name.lastIndexOf('-')) !== -1) { | ||
side = name.substr(i + 1); | ||
if (side in s) { | ||
if (!s[side]) s[side] = { s: sValue, t: tValue[0] }; | ||
if (!s[side]) { | ||
s[side] = { s: sValue, t: [tValue[0]] }; | ||
if (tValue[0][1] === 'unary') s[side].t.push(tValue[1]); | ||
} | ||
return true; | ||
@@ -957,11 +982,14 @@ } | ||
switch(x[1]) { | ||
case 'unary': | ||
a.push({ s: x[2], t: last = [x] }); | ||
break; | ||
case 'number': | ||
case 'ident': | ||
a.push({ s: x[2], t: x }); | ||
last = (last ? last.push(x) : a.push({ s: x[2], t: [x] }), null); | ||
break; | ||
case 'percentage': | ||
a.push({ s: x[2][2] + '%', t: x }); | ||
last = (last ? last.push(x) : a.push({ s: x[2][2] + '%', t: [x] }), null); | ||
break; | ||
case 'dimension': | ||
a.push({ s: x[2][2] + x[3][2], t: x }); | ||
last = (last ? last.push(x) : a.push({ s: x[2][2] + x[3][2], t: [x] }), null); | ||
break; | ||
@@ -1012,6 +1040,6 @@ case 's': | ||
for (var i = 0; i < a.length - 1; i++) { | ||
r.push(a[i].t); | ||
r = r.concat(a[i].t); | ||
r.push([{ s: ' ' }, 's', ' ']); | ||
} | ||
r.push(a[i].t); | ||
r = r.concat(a[i].t); | ||
@@ -1018,0 +1046,0 @@ return r; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
303139
1184
6432
0
1