Comparing version 0.10.0 to 0.10.1
@@ -107,3 +107,2 @@ var homunculus=function(){var _0=require('homunculus');return _0.hasOwnProperty("default")?_0["default"]:_0}(); | ||
var _p = [0, 0, 0]; | ||
outer: | ||
for(var i = sel.length - 1; i >= 0; i--) { | ||
@@ -123,3 +122,14 @@ var temp = { | ||
case Token.PSEUDO: | ||
temp.p.push(s.replace(/^:+/, '')); | ||
var s2 = s.replace(/^:+/, ''); | ||
if(sel[i].content() == '(') { | ||
s2 += '('; | ||
for(var j = i + 1; j < sel.length; j++) { | ||
if(sel[j].content() == ')') { | ||
s2 += ')'; | ||
break; | ||
} | ||
s2 += sel[j].content(); | ||
} | ||
} | ||
temp.p.push(s2); | ||
break; | ||
@@ -129,5 +139,4 @@ case Token.SIGN: | ||
case ']': | ||
var item; | ||
var item = []; | ||
i--; | ||
item = []; | ||
t = t.prev(); | ||
@@ -155,3 +164,16 @@ while(t) { | ||
res = res[s]; | ||
continue outer; | ||
continue; | ||
//忽略掉(),因为其出现在:nth-child(n)中 | ||
case ')': | ||
i--; | ||
t = t.prev(); | ||
while(t) { | ||
s = t.content(); | ||
if(s == '(') { | ||
break; | ||
} | ||
i--; | ||
t = t.prev(); | ||
} | ||
break; | ||
} | ||
@@ -169,3 +191,14 @@ break; | ||
case Token.PSEUDO: | ||
temp.p.push(s.replace(/^:+/, '')); | ||
var s2 = s.replace(/^:+/, ''); | ||
if(sel[i].content() == '(') { | ||
s2 += '('; | ||
for(var j = i + 1; j < sel.length; j++) { | ||
if(sel[j].content() == ')') { | ||
s2 += ')'; | ||
break; | ||
} | ||
s2 += sel[j].content(); | ||
} | ||
} | ||
temp.p.push(s2); | ||
break; | ||
@@ -175,5 +208,4 @@ case Token.SIGN: | ||
case ']': | ||
var item; | ||
var item = []; | ||
i--; | ||
item = []; | ||
t = t.prev(); | ||
@@ -187,3 +219,3 @@ while(t) { | ||
t = t.prev(); | ||
s = s.replace(/^(['"'])(.*)\1/, '$2'); | ||
s = s.replace(/^(['"])(.*)\1$/, '$2'); | ||
item.unshift(s); | ||
@@ -196,2 +228,22 @@ } | ||
break; | ||
case '+': | ||
case '>': | ||
case '~': | ||
s = '_' + s; | ||
res[s] = res[s] || {}; | ||
res = res[s]; | ||
continue; | ||
//忽略掉(),因为其出现在:nth-child(n)中 | ||
case ')': | ||
i--; | ||
t = t.prev(); | ||
while(t) { | ||
s = t.content(); | ||
if(s == '(') { | ||
break; | ||
} | ||
i--; | ||
t = t.prev(); | ||
} | ||
break; | ||
} | ||
@@ -198,0 +250,0 @@ break; |
{ | ||
"name": "jaw", | ||
"version": "0.10.0", | ||
"version": "0.10.1", | ||
"description": "Parasitize CSS to JSX for migi", | ||
@@ -5,0 +5,0 @@ "maintainers": [ |
@@ -107,3 +107,2 @@ import homunculus from 'homunculus'; | ||
var _p = [0, 0, 0]; | ||
outer: | ||
for(var i = sel.length - 1; i >= 0; i--) { | ||
@@ -123,3 +122,14 @@ var temp = { | ||
case Token.PSEUDO: | ||
temp.p.push(s.replace(/^:+/, '')); | ||
var s2 = s.replace(/^:+/, ''); | ||
if(sel[i].content() == '(') { | ||
s2 += '('; | ||
for(var j = i + 1; j < sel.length; j++) { | ||
if(sel[j].content() == ')') { | ||
s2 += ')'; | ||
break; | ||
} | ||
s2 += sel[j].content(); | ||
} | ||
} | ||
temp.p.push(s2); | ||
break; | ||
@@ -129,5 +139,4 @@ case Token.SIGN: | ||
case ']': | ||
var item; | ||
var item = []; | ||
i--; | ||
item = []; | ||
t = t.prev(); | ||
@@ -155,3 +164,16 @@ while(t) { | ||
res = res[s]; | ||
continue outer; | ||
continue; | ||
//忽略掉(),因为其出现在:nth-child(n)中 | ||
case ')': | ||
i--; | ||
t = t.prev(); | ||
while(t) { | ||
s = t.content(); | ||
if(s == '(') { | ||
break; | ||
} | ||
i--; | ||
t = t.prev(); | ||
} | ||
break; | ||
} | ||
@@ -169,3 +191,14 @@ break; | ||
case Token.PSEUDO: | ||
temp.p.push(s.replace(/^:+/, '')); | ||
var s2 = s.replace(/^:+/, ''); | ||
if(sel[i].content() == '(') { | ||
s2 += '('; | ||
for(var j = i + 1; j < sel.length; j++) { | ||
if(sel[j].content() == ')') { | ||
s2 += ')'; | ||
break; | ||
} | ||
s2 += sel[j].content(); | ||
} | ||
} | ||
temp.p.push(s2); | ||
break; | ||
@@ -175,5 +208,4 @@ case Token.SIGN: | ||
case ']': | ||
var item; | ||
var item = []; | ||
i--; | ||
item = []; | ||
t = t.prev(); | ||
@@ -187,3 +219,3 @@ while(t) { | ||
t = t.prev(); | ||
s = s.replace(/^(['"'])(.*)\1/, '$2'); | ||
s = s.replace(/^(['"])(.*)\1$/, '$2'); | ||
item.unshift(s); | ||
@@ -196,2 +228,22 @@ } | ||
break; | ||
case '+': | ||
case '>': | ||
case '~': | ||
s = '_' + s; | ||
res[s] = res[s] || {}; | ||
res = res[s]; | ||
continue; | ||
//忽略掉(),因为其出现在:nth-child(n)中 | ||
case ')': | ||
i--; | ||
t = t.prev(); | ||
while(t) { | ||
s = t.content(); | ||
if(s == '(') { | ||
break; | ||
} | ||
i--; | ||
t = t.prev(); | ||
} | ||
break; | ||
} | ||
@@ -198,0 +250,0 @@ break; |
@@ -107,3 +107,2 @@ define(function(require, exports, module){var homunculus=function(){var _0=require('homunculus');return _0.hasOwnProperty("default")?_0["default"]:_0}(); | ||
var _p = [0, 0, 0]; | ||
outer: | ||
for(var i = sel.length - 1; i >= 0; i--) { | ||
@@ -123,3 +122,14 @@ var temp = { | ||
case Token.PSEUDO: | ||
temp.p.push(s.replace(/^:+/, '')); | ||
var s2 = s.replace(/^:+/, ''); | ||
if(sel[i].content() == '(') { | ||
s2 += '('; | ||
for(var j = i + 1; j < sel.length; j++) { | ||
if(sel[j].content() == ')') { | ||
s2 += ')'; | ||
break; | ||
} | ||
s2 += sel[j].content(); | ||
} | ||
} | ||
temp.p.push(s2); | ||
break; | ||
@@ -129,5 +139,4 @@ case Token.SIGN: | ||
case ']': | ||
var item; | ||
var item = []; | ||
i--; | ||
item = []; | ||
t = t.prev(); | ||
@@ -155,3 +164,16 @@ while(t) { | ||
res = res[s]; | ||
continue outer; | ||
continue; | ||
//忽略掉(),因为其出现在:nth-child(n)中 | ||
case ')': | ||
i--; | ||
t = t.prev(); | ||
while(t) { | ||
s = t.content(); | ||
if(s == '(') { | ||
break; | ||
} | ||
i--; | ||
t = t.prev(); | ||
} | ||
break; | ||
} | ||
@@ -169,3 +191,14 @@ break; | ||
case Token.PSEUDO: | ||
temp.p.push(s.replace(/^:+/, '')); | ||
var s2 = s.replace(/^:+/, ''); | ||
if(sel[i].content() == '(') { | ||
s2 += '('; | ||
for(var j = i + 1; j < sel.length; j++) { | ||
if(sel[j].content() == ')') { | ||
s2 += ')'; | ||
break; | ||
} | ||
s2 += sel[j].content(); | ||
} | ||
} | ||
temp.p.push(s2); | ||
break; | ||
@@ -175,5 +208,4 @@ case Token.SIGN: | ||
case ']': | ||
var item; | ||
var item = []; | ||
i--; | ||
item = []; | ||
t = t.prev(); | ||
@@ -187,3 +219,3 @@ while(t) { | ||
t = t.prev(); | ||
s = s.replace(/^(['"'])(.*)\1/, '$2'); | ||
s = s.replace(/^(['"])(.*)\1$/, '$2'); | ||
item.unshift(s); | ||
@@ -196,2 +228,22 @@ } | ||
break; | ||
case '+': | ||
case '>': | ||
case '~': | ||
s = '_' + s; | ||
res[s] = res[s] || {}; | ||
res = res[s]; | ||
continue; | ||
//忽略掉(),因为其出现在:nth-child(n)中 | ||
case ')': | ||
i--; | ||
t = t.prev(); | ||
while(t) { | ||
s = t.content(); | ||
if(s == '(') { | ||
break; | ||
} | ||
i--; | ||
t = t.prev(); | ||
} | ||
break; | ||
} | ||
@@ -198,0 +250,0 @@ break; |
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
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
139320
1453