Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

more-css

Package Overview
Dependencies
Maintainers
2
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

more-css - npm Package Compare versions

Comparing version 0.10.5 to 0.11.0

39

build/Impact.js

@@ -21,2 +21,6 @@ var KEY_HASH=function(){var _0=require('./abbreviationKey.js');return _0.hasOwnProperty("KEY_HASH")?_0.KEY_HASH:_0.hasOwnProperty("default")?_0.default:_0}();

}
//都是tag结尾则无冲突
else if(this.allTag(list, first, last)) {
return this.imCache[first + ',' + last + ',' + child] = true;
}
//非紧邻若无相同样式或important优先级不同无影响

@@ -131,2 +135,37 @@ else {

}
Impact.prototype.allTag = function(list, first, last) {
var hash = {};
for(var i = 0, len = list[first].selectors.length; i < len; i++) {
var s = list[first].selectors[i];
//div全字母为tag
if(/^[a-z]+$/i.test(s)) {
hash[s] = true;
continue;
}
// div前面空格类型
if(/ [a-z]+$/i.test(s)) {
hash[/ [a-z]+$/i.exec(s)[0].slice(1)] = true;
continue;
}
//>div
if(/>[a-z]+$/i.test(s)) {
hash[/>[a-z]+$/i.exec(s)[0].slice(1)] = true;
continue;
}
return false;
}
for(var i = 0, len = list[last].selectors.length; i < len; i++) {
var s = list[last].selectors[i];
if(/^[a-z]+$/i.test(s) && !hash[s]) {
continue;
}
if(/ [a-z]+$/i.test(s) && !hash[/ [a-z]+$/i.exec(s)[0].slice(1)]) {
continue;
}
if(/>[a-z]+$/i.test(s) && !hash[/>[a-z]+$/i.exec(s)[0].slice(1)]) {
continue;
}
return false;
}
}

@@ -133,0 +172,0 @@

42

build/ImpactChild.js

@@ -21,2 +21,6 @@ var KEY_HASH=function(){var _0=require('./abbreviationKey.js');return _0.hasOwnProperty("KEY_HASH")?_0.KEY_HASH:_0.hasOwnProperty("default")?_0.default:_0}();

}
//都是tag结尾则无冲突
else if(this.allTag(list, first, last)) {
return this.imCache[first + ',' + last + ',' + child] = true;
}
//非紧邻若无相同样式或important优先级不同无影响

@@ -36,3 +40,4 @@ else {

var item = list[i];
if(this.isChildren(item, list[last]) || this.isChildren(item, list[first])) {
if(this.isChildren(item, list[last])
|| this.isChildren(item, list[first])) {
this.imCache[i + ',' + last + ',' + child] = true;

@@ -81,2 +86,37 @@ continue;

}
ImpactChild.prototype.allTag = function(list, first, last) {
var hash = {};
for(var i = 0, len = list[first].selectors.length; i < len; i++) {
var s = list[first].selectors[i];
//div全字母为tag
if(/^[a-z]+$/i.test(s)) {
hash[s] = true;
continue;
}
// div前面空格类型
if(/ [a-z]+$/i.test(s)) {
hash[/ [a-z]+$/i.exec(s)[0].slice(1)] = true;
continue;
}
//>div
if(/>[a-z]+$/i.test(s)) {
hash[/>[a-z]+$/i.exec(s)[0].slice(1)] = true;
continue;
}
return false;
}
for(var i = 0, len = list[last].selectors.length; i < len; i++) {
var s = list[last].selectors[i];
if(/^[a-z]+$/i.test(s) && !hash[s]) {
continue;
}
if(/ [a-z]+$/i.test(s) && !hash[/ [a-z]+$/i.exec(s)[0].slice(1)]) {
continue;
}
if(/>[a-z]+$/i.test(s) && !hash[/>[a-z]+$/i.exec(s)[0].slice(1)]) {
continue;
}
return false;
}
}

@@ -83,0 +123,0 @@

@@ -24,2 +24,3 @@ var sort=function(){var _0=require('./sort');return _0.hasOwnProperty("sort")?_0.sort:_0.hasOwnProperty("default")?_0.default:_0}();

2和3已被clean-css实现,无需重复
追加:除5外都被clean-css实现,但尚不完整,对!important冲突判断有误
*/

@@ -33,2 +34,4 @@ this.merge(this.list);

this.extract(this.list);
this.merge(this.list);
this.merge(this.list, true);
return this.join(this.list);

@@ -35,0 +38,0 @@ }

4

package.json
{
"name": "more-css",
"version": "0.10.5",
"version": "0.11.0",
"description": "a css pre-compiler&agressive compressor",

@@ -33,3 +33,3 @@ "maintainers": [

"dependencies": {
"clean-css": "~3.0.10",
"clean-css": "~3.2.8",
"homunculus": "~0.9.2",

@@ -36,0 +36,0 @@ "glob": "~5.0.5",

@@ -21,2 +21,6 @@ import KEY_HASH from './abbreviationKey.js';

}
//都是tag结尾则无冲突
else if(this.allTag(list, first, last)) {
return this.imCache[first + ',' + last + ',' + child] = true;
}
//非紧邻若无相同样式或important优先级不同无影响

@@ -131,2 +135,37 @@ else {

}
allTag(list, first, last) {
var hash = {};
for(var i = 0, len = list[first].selectors.length; i < len; i++) {
var s = list[first].selectors[i];
//div全字母为tag
if(/^[a-z]+$/i.test(s)) {
hash[s] = true;
continue;
}
// div前面空格类型
if(/ [a-z]+$/i.test(s)) {
hash[/ [a-z]+$/i.exec(s)[0].slice(1)] = true;
continue;
}
//>div
if(/>[a-z]+$/i.test(s)) {
hash[/>[a-z]+$/i.exec(s)[0].slice(1)] = true;
continue;
}
return false;
}
for(var i = 0, len = list[last].selectors.length; i < len; i++) {
var s = list[last].selectors[i];
if(/^[a-z]+$/i.test(s) && !hash[s]) {
continue;
}
if(/ [a-z]+$/i.test(s) && !hash[/ [a-z]+$/i.exec(s)[0].slice(1)]) {
continue;
}
if(/>[a-z]+$/i.test(s) && !hash[/>[a-z]+$/i.exec(s)[0].slice(1)]) {
continue;
}
return false;
}
}
}

@@ -133,0 +172,0 @@

@@ -21,2 +21,6 @@ import KEY_HASH from './abbreviationKey.js';

}
//都是tag结尾则无冲突
else if(this.allTag(list, first, last)) {
return this.imCache[first + ',' + last + ',' + child] = true;
}
//非紧邻若无相同样式或important优先级不同无影响

@@ -36,3 +40,4 @@ else {

var item = list[i];
if(this.isChildren(item, list[last]) || this.isChildren(item, list[first])) {
if(this.isChildren(item, list[last])
|| this.isChildren(item, list[first])) {
this.imCache[i + ',' + last + ',' + child] = true;

@@ -81,2 +86,37 @@ continue;

}
allTag(list, first, last) {
var hash = {};
for(var i = 0, len = list[first].selectors.length; i < len; i++) {
var s = list[first].selectors[i];
//div全字母为tag
if(/^[a-z]+$/i.test(s)) {
hash[s] = true;
continue;
}
// div前面空格类型
if(/ [a-z]+$/i.test(s)) {
hash[/ [a-z]+$/i.exec(s)[0].slice(1)] = true;
continue;
}
//>div
if(/>[a-z]+$/i.test(s)) {
hash[/>[a-z]+$/i.exec(s)[0].slice(1)] = true;
continue;
}
return false;
}
for(var i = 0, len = list[last].selectors.length; i < len; i++) {
var s = list[last].selectors[i];
if(/^[a-z]+$/i.test(s) && !hash[s]) {
continue;
}
if(/ [a-z]+$/i.test(s) && !hash[/ [a-z]+$/i.exec(s)[0].slice(1)]) {
continue;
}
if(/>[a-z]+$/i.test(s) && !hash[/>[a-z]+$/i.exec(s)[0].slice(1)]) {
continue;
}
return false;
}
}
}

@@ -83,0 +123,0 @@

@@ -24,2 +24,3 @@ import sort from './sort';

2和3已被clean-css实现,无需重复
追加:除5外都被clean-css实现,但尚不完整,对!important冲突判断有误
*/

@@ -33,2 +34,4 @@ this.merge(this.list);

this.extract(this.list);
this.merge(this.list);
this.merge(this.list, true);
return this.join(this.list);

@@ -35,0 +38,0 @@ }

@@ -21,2 +21,6 @@ define(function(require, exports, module){var KEY_HASH=function(){var _0=require('./abbreviationKey.js');return _0.hasOwnProperty("KEY_HASH")?_0.KEY_HASH:_0.hasOwnProperty("default")?_0.default:_0}();

}
//都是tag结尾则无冲突
else if(this.allTag(list, first, last)) {
return this.imCache[first + ',' + last + ',' + child] = true;
}
//非紧邻若无相同样式或important优先级不同无影响

@@ -131,2 +135,37 @@ else {

}
Impact.prototype.allTag = function(list, first, last) {
var hash = {};
for(var i = 0, len = list[first].selectors.length; i < len; i++) {
var s = list[first].selectors[i];
//div全字母为tag
if(/^[a-z]+$/i.test(s)) {
hash[s] = true;
continue;
}
// div前面空格类型
if(/ [a-z]+$/i.test(s)) {
hash[/ [a-z]+$/i.exec(s)[0].slice(1)] = true;
continue;
}
//>div
if(/>[a-z]+$/i.test(s)) {
hash[/>[a-z]+$/i.exec(s)[0].slice(1)] = true;
continue;
}
return false;
}
for(var i = 0, len = list[last].selectors.length; i < len; i++) {
var s = list[last].selectors[i];
if(/^[a-z]+$/i.test(s) && !hash[s]) {
continue;
}
if(/ [a-z]+$/i.test(s) && !hash[/ [a-z]+$/i.exec(s)[0].slice(1)]) {
continue;
}
if(/>[a-z]+$/i.test(s) && !hash[/>[a-z]+$/i.exec(s)[0].slice(1)]) {
continue;
}
return false;
}
}

@@ -133,0 +172,0 @@

@@ -21,2 +21,6 @@ define(function(require, exports, module){var KEY_HASH=function(){var _0=require('./abbreviationKey.js');return _0.hasOwnProperty("KEY_HASH")?_0.KEY_HASH:_0.hasOwnProperty("default")?_0.default:_0}();

}
//都是tag结尾则无冲突
else if(this.allTag(list, first, last)) {
return this.imCache[first + ',' + last + ',' + child] = true;
}
//非紧邻若无相同样式或important优先级不同无影响

@@ -36,3 +40,4 @@ else {

var item = list[i];
if(this.isChildren(item, list[last]) || this.isChildren(item, list[first])) {
if(this.isChildren(item, list[last])
|| this.isChildren(item, list[first])) {
this.imCache[i + ',' + last + ',' + child] = true;

@@ -81,2 +86,37 @@ continue;

}
ImpactChild.prototype.allTag = function(list, first, last) {
var hash = {};
for(var i = 0, len = list[first].selectors.length; i < len; i++) {
var s = list[first].selectors[i];
//div全字母为tag
if(/^[a-z]+$/i.test(s)) {
hash[s] = true;
continue;
}
// div前面空格类型
if(/ [a-z]+$/i.test(s)) {
hash[/ [a-z]+$/i.exec(s)[0].slice(1)] = true;
continue;
}
//>div
if(/>[a-z]+$/i.test(s)) {
hash[/>[a-z]+$/i.exec(s)[0].slice(1)] = true;
continue;
}
return false;
}
for(var i = 0, len = list[last].selectors.length; i < len; i++) {
var s = list[last].selectors[i];
if(/^[a-z]+$/i.test(s) && !hash[s]) {
continue;
}
if(/ [a-z]+$/i.test(s) && !hash[/ [a-z]+$/i.exec(s)[0].slice(1)]) {
continue;
}
if(/>[a-z]+$/i.test(s) && !hash[/>[a-z]+$/i.exec(s)[0].slice(1)]) {
continue;
}
return false;
}
}

@@ -83,0 +123,0 @@

@@ -24,2 +24,3 @@ define(function(require, exports, module){var sort=function(){var _0=require('./sort');return _0.hasOwnProperty("sort")?_0.sort:_0.hasOwnProperty("default")?_0.default:_0}();

2和3已被clean-css实现,无需重复
追加:除5外都被clean-css实现,但尚不完整,对!important冲突判断有误
*/

@@ -33,2 +34,4 @@ this.merge(this.list);

this.extract(this.list);
this.merge(this.list);
this.merge(this.list, true);
return this.join(this.list);

@@ -35,0 +38,0 @@ }

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc