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

j2c

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

j2c - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

7

dist/inline/j2c.amd.js

@@ -59,10 +59,9 @@ define('j2c', function(){return (function () {

function finalize(buf) {return buf.reverse().join("\n");}
/*/-inline-/*/
function j2c(o, buf) {
_declarations(o, buf = [], "", j2c.vendors);
return finalize(buf);
return buf.reverse().join("\n");
}
/*/-inline-/*/

@@ -69,0 +68,0 @@

@@ -1,1 +0,1 @@

define("j2c",function(){return function(){function n(n,e,t,c,i,o){c=[];for(o in e)if(f.call(e,o))for(i in n)f.call(n,i)&&c.push(r(n[i],e[o],t));return c}function r(n,r,e){return e&&r.indexOf("&")+1?r.replace("&",n):n+r}function e(n,r,t,c,l,u,s){switch(i.call(n)){case a:for(l=n.length;l--;)e(n[l],r,t,c);break;case o:t=t&&t+"-";for(l in n)if(u=n[l],l.indexOf("$")+1)for(s in l=l.split("$"))f.call(l,s)&&e(u,r,t+l[s],c);else e(u,r,t+l,c);break;default:for(r.push(n=(t&&t.replace(/_/g,"-")+":")+n+";"),l=c.length;l--;)r.push("-"+c[l]+"-"+n)}}function t(n){return n.reverse().join("\n")}function c(n,r){return e(n,r=[],"",c.vendors),t(r)}{var i={}.toString,f={}.hasOwnProperty,o=i.call({}),a=i.call([]);i.call(""),".j2c_"+(1e9*Math.random()|0)+"_"+1*new Date+"_"}return c.prefix=function(r,e){return n(r.map(function(n){return"-"+n+"-"}).concat([""]),[e])},c.vendors=[],c}()});
define("j2c",function(){return function(){function n(n,r,t,c,a,f){c=[];for(f in r)if(i.call(r,f))for(a in n)i.call(n,a)&&c.push(e(n[a],r[f],t));return c}function e(n,e,r){return r&&e.indexOf("&")+1?e.replace("&",n):n+e}function r(n,e,t,l,o,u,s){switch(c.call(n)){case f:for(o=n.length;o--;)r(n[o],e,t,l);break;case a:t=t&&t+"-";for(o in n)if(u=n[o],o.indexOf("$")+1)for(s in o=o.split("$"))i.call(o,s)&&r(u,e,t+o[s],l);else r(u,e,t+o,l);break;default:for(e.push(n=(t&&t.replace(/_/g,"-")+":")+n+";"),o=l.length;o--;)e.push("-"+l[o]+"-"+n)}}function t(n,e){return r(n,e=[],"",t.vendors),e.reverse().join("\n")}{var c={}.toString,i={}.hasOwnProperty,a=c.call({}),f=c.call([]);c.call(""),".j2c_"+(1e9*Math.random()|0)+"_"+1*new Date+"_"}return t.prefix=function(e,r){return n(e.map(function(n){return"-"+n+"-"}).concat([""]),[r])},t.vendors=[],t}()});

@@ -59,10 +59,9 @@ module.exports = (function () {

function finalize(buf) {return buf.reverse().join("\n");}
/*/-inline-/*/
function j2c(o, buf) {
_declarations(o, buf = [], "", j2c.vendors);
return finalize(buf);
return buf.reverse().join("\n");
}
/*/-inline-/*/

@@ -69,0 +68,0 @@

@@ -1,1 +0,1 @@

module.exports=function(){function n(n,e,t,c,o,a){c=[];for(a in e)if(l.call(e,a))for(o in n)l.call(n,o)&&c.push(r(n[o],e[a],t));return c}function r(n,r,e){return e&&r.indexOf("&")+1?r.replace("&",n):n+r}function e(n,r,t,c,f,u,s){switch(o.call(n)){case i:for(f=n.length;f--;)e(n[f],r,t,c);break;case a:t=t&&t+"-";for(f in n)if(u=n[f],f.indexOf("$")+1)for(s in f=f.split("$"))l.call(f,s)&&e(u,r,t+f[s],c);else e(u,r,t+f,c);break;default:for(r.push(n=(t&&t.replace(/_/g,"-")+":")+n+";"),f=c.length;f--;)r.push("-"+c[f]+"-"+n)}}function t(n){return n.reverse().join("\n")}function c(n,r){return e(n,r=[],"",c.vendors),t(r)}{var o={}.toString,l={}.hasOwnProperty,a=o.call({}),i=o.call([]);o.call(""),".j2c_"+(1e9*Math.random()|0)+"_"+1*new Date+"_"}return c.prefix=function(r,e){return n(r.map(function(n){return"-"+n+"-"}).concat([""]),[e])},c.vendors=[],c}();
module.exports=function(){function n(n,r,t,c,o,a){c=[];for(a in r)if(l.call(r,a))for(o in n)l.call(n,o)&&c.push(e(n[o],r[a],t));return c}function e(n,e,r){return r&&e.indexOf("&")+1?e.replace("&",n):n+e}function r(n,e,t,i,f,u,s){switch(c.call(n)){case a:for(f=n.length;f--;)r(n[f],e,t,i);break;case o:t=t&&t+"-";for(f in n)if(u=n[f],f.indexOf("$")+1)for(s in f=f.split("$"))l.call(f,s)&&r(u,e,t+f[s],i);else r(u,e,t+f,i);break;default:for(e.push(n=(t&&t.replace(/_/g,"-")+":")+n+";"),f=i.length;f--;)e.push("-"+i[f]+"-"+n)}}function t(n,e){return r(n,e=[],"",t.vendors),e.reverse().join("\n")}{var c={}.toString,l={}.hasOwnProperty,o=c.call({}),a=c.call([]);c.call(""),".j2c_"+(1e9*Math.random()|0)+"_"+1*new Date+"_"}return t.prefix=function(e,r){return n(e.map(function(n){return"-"+n+"-"}).concat([""]),[r])},t.vendors=[],t}();

@@ -59,10 +59,9 @@ export default (function () {

function finalize(buf) {return buf.reverse().join("\n");}
/*/-inline-/*/
function j2c(o, buf) {
_declarations(o, buf = [], "", j2c.vendors);
return finalize(buf);
return buf.reverse().join("\n");
}
/*/-inline-/*/

@@ -69,0 +68,0 @@

@@ -59,10 +59,9 @@ ;var j2c = (function () {

function finalize(buf) {return buf.reverse().join("\n");}
/*/-inline-/*/
function j2c(o, buf) {
_declarations(o, buf = [], "", j2c.vendors);
return finalize(buf);
return buf.reverse().join("\n");
}
/*/-inline-/*/

@@ -69,0 +68,0 @@

@@ -1,1 +0,1 @@

var j2c=function(){function n(n,e,t,c,a,l){c=[];for(l in e)if(i.call(e,l))for(a in n)i.call(n,a)&&c.push(r(n[a],e[l],t));return c}function r(n,r,e){return e&&r.indexOf("&")+1?r.replace("&",n):n+r}function e(n,r,t,c,f,u,s){switch(a.call(n)){case o:for(f=n.length;f--;)e(n[f],r,t,c);break;case l:t=t&&t+"-";for(f in n)if(u=n[f],f.indexOf("$")+1)for(s in f=f.split("$"))i.call(f,s)&&e(u,r,t+f[s],c);else e(u,r,t+f,c);break;default:for(r.push(n=(t&&t.replace(/_/g,"-")+":")+n+";"),f=c.length;f--;)r.push("-"+c[f]+"-"+n)}}function t(n){return n.reverse().join("\n")}function c(n,r){return e(n,r=[],"",c.vendors),t(r)}{var a={}.toString,i={}.hasOwnProperty,l=a.call({}),o=a.call([]);a.call(""),".j2c_"+(1e9*Math.random()|0)+"_"+1*new Date+"_"}return c.prefix=function(r,e){return n(r.map(function(n){return"-"+n+"-"}).concat([""]),[e])},c.vendors=[],c}();
var j2c=function(){function n(n,e,t,c,l,i){c=[];for(i in e)if(a.call(e,i))for(l in n)a.call(n,l)&&c.push(r(n[l],e[i],t));return c}function r(n,r,e){return e&&r.indexOf("&")+1?r.replace("&",n):n+r}function e(n,r,t,o,f,u,s){switch(c.call(n)){case i:for(f=n.length;f--;)e(n[f],r,t,o);break;case l:t=t&&t+"-";for(f in n)if(u=n[f],f.indexOf("$")+1)for(s in f=f.split("$"))a.call(f,s)&&e(u,r,t+f[s],o);else e(u,r,t+f,o);break;default:for(r.push(n=(t&&t.replace(/_/g,"-")+":")+n+";"),f=o.length;f--;)r.push("-"+o[f]+"-"+n)}}function t(n,r){return e(n,r=[],"",t.vendors),r.reverse().join("\n")}{var c={}.toString,a={}.hasOwnProperty,l=c.call({}),i=c.call([]);c.call(""),".j2c_"+(1e9*Math.random()|0)+"_"+1*new Date+"_"}return t.prefix=function(r,e){return n(r.map(function(n){return"-"+n+"-"}).concat([""]),[e])},t.vendors=[],t}();

@@ -59,2 +59,5 @@ define('j2c', function(){return (function () {

/*/-statements-/*/
function finalize(buf) {return buf.reverse().join("\n");}

@@ -68,4 +71,2 @@

/*/-statements-/*/
// Add rulesets and other CSS statements to the sheet.

@@ -161,3 +162,3 @@ function _add(statements, buf, prefix, vendors, /*var*/ k, v, decl) {

buf = new String(finalize(buf));
buf.classes = classes
for (k in statements) if (own.call(statements, k)) buf[k] = classes[k]
return buf

@@ -164,0 +165,0 @@ }

@@ -1,1 +0,1 @@

define("j2c",function(){return function(){function n(n,r,t,c,i,a){c=[];for(a in r)if(s.call(r,a))for(i in n)s.call(n,i)&&c.push(e(n[i],r[a],t));return c}function e(n,e,r){return r&&e.indexOf("&")+1?e.replace("&",n):n+e}function r(n,e,t,c,i,l,o){switch(a.call(n)){case u:for(i=n.length;i--;)r(n[i],e,t,c);break;case f:t=t&&t+"-";for(i in n)if(l=n[i],i.indexOf("$")+1)for(o in i=i.split("$"))s.call(i,o)&&r(l,e,t+i[o],c);else r(l,e,t+i,c);break;default:for(e.push(n=(t&&t.replace(/_/g,"-")+":")+n+";"),i=c.length;i--;)e.push("-"+c[i]+"-"+n)}}function t(n){return n.reverse().join("\n")}function c(n,e){return r(n,e=[],"",c.vendors),t(e)}function i(t,c,o,h,p,d,w){switch(w=t,a.call(t)){case u:for(p=t.length;p--;)i(t[p],c,o,h);break;case f:w={};for(p in t)d=t[p],"@"==p[0]?p.match(/^@keyframes /)?(c.push("}"),i(d,c,"",h),c.push(p+"{"),c.push("}"),i(d,c,"",["webkit"]),c.push("@-webkit-"+p.slice(1)+"{")):p.match(/^@font-face/)?i(d,c,p,[]):a.call(d)==l?c.push(p+" "+d+";"):(c.push("}"),i(d,c,o,h),c.push(p+"{")):p.match(/^[-\w$]+$/)?w[p]=d:i(d,c,o.indexOf(",")+p.indexOf(",")+2?n(o.split(","),p.split(","),1).join(","):e(o,p,1),h);case l:for(p in w)if(s.call(w,p)){c.push("}"),r(w,c,"",h),c.push(o+"{");break}}}var a={}.toString,s={}.hasOwnProperty,f=a.call({}),u=a.call([]),l=a.call(""),o=".j2c_"+(1e9*Math.random()|0)+"_"+1*new Date+"_",h=0;return c.sheet=function(n,e){return e=[],i(n,e,"",c.vendors),t(e)},c.scoped=function(n,e){var r={},a=[];for(e in n)s.call(n,e)&&(r[e]=o+h++,i(n[e],a,r[e],c.vendors));return a=new String(t(a)),a.classes=r,a},c.prefix=function(e,r){return n(e.map(function(n){return"-"+n+"-"}).concat([""]),[r])},c.vendors=[],c}()});
define("j2c",function(){return function(){function n(n,r,t,c,i,a){c=[];for(a in r)if(f.call(r,a))for(i in n)f.call(n,i)&&c.push(e(n[i],r[a],t));return c}function e(n,e,r){return r&&e.indexOf("&")+1?e.replace("&",n):n+e}function r(n,e,t,c,i,u,s){switch(a.call(n)){case o:for(i=n.length;i--;)r(n[i],e,t,c);break;case l:t=t&&t+"-";for(i in n)if(u=n[i],i.indexOf("$")+1)for(s in i=i.split("$"))f.call(i,s)&&r(u,e,t+i[s],c);else r(u,e,t+i,c);break;default:for(e.push(n=(t&&t.replace(/_/g,"-")+":")+n+";"),i=c.length;i--;)e.push("-"+c[i]+"-"+n)}}function t(n){return n.reverse().join("\n")}function c(n,e){return r(n,e=[],"",c.vendors),t(e)}function i(t,c,s,h,p,d,w){switch(w=t,a.call(t)){case o:for(p=t.length;p--;)i(t[p],c,s,h);break;case l:w={};for(p in t)d=t[p],"@"==p[0]?p.match(/^@keyframes /)?(c.push("}"),i(d,c,"",h),c.push(p+"{"),c.push("}"),i(d,c,"",["webkit"]),c.push("@-webkit-"+p.slice(1)+"{")):p.match(/^@font-face/)?i(d,c,p,[]):a.call(d)==u?c.push(p+" "+d+";"):(c.push("}"),i(d,c,s,h),c.push(p+"{")):p.match(/^[-\w$]+$/)?w[p]=d:i(d,c,s.indexOf(",")+p.indexOf(",")+2?n(s.split(","),p.split(","),1).join(","):e(s,p,1),h);case u:for(p in w)if(f.call(w,p)){c.push("}"),r(w,c,"",h),c.push(s+"{");break}}}var a={}.toString,f={}.hasOwnProperty,l=a.call({}),o=a.call([]),u=a.call(""),s=".j2c_"+(1e9*Math.random()|0)+"_"+1*new Date+"_",h=0;return c.sheet=function(n,e){return e=[],i(n,e,"",c.vendors),t(e)},c.scoped=function(n,e){var r={},a=[];for(e in n)f.call(n,e)&&(r[e]=s+h++,i(n[e],a,r[e],c.vendors));a=new String(t(a));for(e in n)f.call(n,e)&&(a[e]=r[e]);return a},c.prefix=function(e,r){return n(e.map(function(n){return"-"+n+"-"}).concat([""]),[r])},c.vendors=[],c}()});

@@ -59,2 +59,5 @@ module.exports = (function () {

/*/-statements-/*/
function finalize(buf) {return buf.reverse().join("\n");}

@@ -68,4 +71,2 @@

/*/-statements-/*/
// Add rulesets and other CSS statements to the sheet.

@@ -161,3 +162,3 @@ function _add(statements, buf, prefix, vendors, /*var*/ k, v, decl) {

buf = new String(finalize(buf));
buf.classes = classes
for (k in statements) if (own.call(statements, k)) buf[k] = classes[k]
return buf

@@ -164,0 +165,0 @@ }

@@ -1,1 +0,1 @@

module.exports=function(){function n(n,r,t,c,i,a){c=[];for(a in r)if(s.call(r,a))for(i in n)s.call(n,i)&&c.push(e(n[i],r[a],t));return c}function e(n,e,r){return r&&e.indexOf("&")+1?e.replace("&",n):n+e}function r(n,e,t,c,i,u,f){switch(a.call(n)){case o:for(i=n.length;i--;)r(n[i],e,t,c);break;case l:t=t&&t+"-";for(i in n)if(u=n[i],i.indexOf("$")+1)for(f in i=i.split("$"))s.call(i,f)&&r(u,e,t+i[f],c);else r(u,e,t+i,c);break;default:for(e.push(n=(t&&t.replace(/_/g,"-")+":")+n+";"),i=c.length;i--;)e.push("-"+c[i]+"-"+n)}}function t(n){return n.reverse().join("\n")}function c(n,e){return r(n,e=[],"",c.vendors),t(e)}function i(t,c,f,h,p,d,w){switch(w=t,a.call(t)){case o:for(p=t.length;p--;)i(t[p],c,f,h);break;case l:w={};for(p in t)d=t[p],"@"==p[0]?p.match(/^@keyframes /)?(c.push("}"),i(d,c,"",h),c.push(p+"{"),c.push("}"),i(d,c,"",["webkit"]),c.push("@-webkit-"+p.slice(1)+"{")):p.match(/^@font-face/)?i(d,c,p,[]):a.call(d)==u?c.push(p+" "+d+";"):(c.push("}"),i(d,c,f,h),c.push(p+"{")):p.match(/^[-\w$]+$/)?w[p]=d:i(d,c,f.indexOf(",")+p.indexOf(",")+2?n(f.split(","),p.split(","),1).join(","):e(f,p,1),h);case u:for(p in w)if(s.call(w,p)){c.push("}"),r(w,c,"",h),c.push(f+"{");break}}}var a={}.toString,s={}.hasOwnProperty,l=a.call({}),o=a.call([]),u=a.call(""),f=".j2c_"+(1e9*Math.random()|0)+"_"+1*new Date+"_",h=0;return c.sheet=function(n,e){return e=[],i(n,e,"",c.vendors),t(e)},c.scoped=function(n,e){var r={},a=[];for(e in n)s.call(n,e)&&(r[e]=f+h++,i(n[e],a,r[e],c.vendors));return a=new String(t(a)),a.classes=r,a},c.prefix=function(e,r){return n(e.map(function(n){return"-"+n+"-"}).concat([""]),[r])},c.vendors=[],c}();
module.exports=function(){function n(n,r,t,c,i,a){c=[];for(a in r)if(l.call(r,a))for(i in n)l.call(n,i)&&c.push(e(n[i],r[a],t));return c}function e(n,e,r){return r&&e.indexOf("&")+1?e.replace("&",n):n+e}function r(n,e,t,c,i,s,u){switch(a.call(n)){case f:for(i=n.length;i--;)r(n[i],e,t,c);break;case o:t=t&&t+"-";for(i in n)if(s=n[i],i.indexOf("$")+1)for(u in i=i.split("$"))l.call(i,u)&&r(s,e,t+i[u],c);else r(s,e,t+i,c);break;default:for(e.push(n=(t&&t.replace(/_/g,"-")+":")+n+";"),i=c.length;i--;)e.push("-"+c[i]+"-"+n)}}function t(n){return n.reverse().join("\n")}function c(n,e){return r(n,e=[],"",c.vendors),t(e)}function i(t,c,u,h,p,d,w){switch(w=t,a.call(t)){case f:for(p=t.length;p--;)i(t[p],c,u,h);break;case o:w={};for(p in t)d=t[p],"@"==p[0]?p.match(/^@keyframes /)?(c.push("}"),i(d,c,"",h),c.push(p+"{"),c.push("}"),i(d,c,"",["webkit"]),c.push("@-webkit-"+p.slice(1)+"{")):p.match(/^@font-face/)?i(d,c,p,[]):a.call(d)==s?c.push(p+" "+d+";"):(c.push("}"),i(d,c,u,h),c.push(p+"{")):p.match(/^[-\w$]+$/)?w[p]=d:i(d,c,u.indexOf(",")+p.indexOf(",")+2?n(u.split(","),p.split(","),1).join(","):e(u,p,1),h);case s:for(p in w)if(l.call(w,p)){c.push("}"),r(w,c,"",h),c.push(u+"{");break}}}var a={}.toString,l={}.hasOwnProperty,o=a.call({}),f=a.call([]),s=a.call(""),u=".j2c_"+(1e9*Math.random()|0)+"_"+1*new Date+"_",h=0;return c.sheet=function(n,e){return e=[],i(n,e,"",c.vendors),t(e)},c.scoped=function(n,e){var r={},a=[];for(e in n)l.call(n,e)&&(r[e]=u+h++,i(n[e],a,r[e],c.vendors));a=new String(t(a));for(e in n)l.call(n,e)&&(a[e]=r[e]);return a},c.prefix=function(e,r){return n(e.map(function(n){return"-"+n+"-"}).concat([""]),[r])},c.vendors=[],c}();

@@ -59,2 +59,5 @@ export default (function () {

/*/-statements-/*/
function finalize(buf) {return buf.reverse().join("\n");}

@@ -68,4 +71,2 @@

/*/-statements-/*/
// Add rulesets and other CSS statements to the sheet.

@@ -161,3 +162,3 @@ function _add(statements, buf, prefix, vendors, /*var*/ k, v, decl) {

buf = new String(finalize(buf));
buf.classes = classes
for (k in statements) if (own.call(statements, k)) buf[k] = classes[k]
return buf

@@ -164,0 +165,0 @@ }

@@ -59,2 +59,5 @@ ;var j2c = (function () {

/*/-statements-/*/
function finalize(buf) {return buf.reverse().join("\n");}

@@ -68,4 +71,2 @@

/*/-statements-/*/
// Add rulesets and other CSS statements to the sheet.

@@ -161,3 +162,3 @@ function _add(statements, buf, prefix, vendors, /*var*/ k, v, decl) {

buf = new String(finalize(buf));
buf.classes = classes
for (k in statements) if (own.call(statements, k)) buf[k] = classes[k]
return buf

@@ -164,0 +165,0 @@ }

@@ -1,1 +0,1 @@

var j2c=function(){function n(n,r,t,c,a,i){c=[];for(i in r)if(s.call(r,i))for(a in n)s.call(n,a)&&c.push(e(n[a],r[i],t));return c}function e(n,e,r){return r&&e.indexOf("&")+1?e.replace("&",n):n+e}function r(n,e,t,c,a,o,u){switch(i.call(n)){case f:for(a=n.length;a--;)r(n[a],e,t,c);break;case l:t=t&&t+"-";for(a in n)if(o=n[a],a.indexOf("$")+1)for(u in a=a.split("$"))s.call(a,u)&&r(o,e,t+a[u],c);else r(o,e,t+a,c);break;default:for(e.push(n=(t&&t.replace(/_/g,"-")+":")+n+";"),a=c.length;a--;)e.push("-"+c[a]+"-"+n)}}function t(n){return n.reverse().join("\n")}function c(n,e){return r(n,e=[],"",c.vendors),t(e)}function a(t,c,u,h,p,d,v){switch(v=t,i.call(t)){case f:for(p=t.length;p--;)a(t[p],c,u,h);break;case l:v={};for(p in t)d=t[p],"@"==p[0]?p.match(/^@keyframes /)?(c.push("}"),a(d,c,"",h),c.push(p+"{"),c.push("}"),a(d,c,"",["webkit"]),c.push("@-webkit-"+p.slice(1)+"{")):p.match(/^@font-face/)?a(d,c,p,[]):i.call(d)==o?c.push(p+" "+d+";"):(c.push("}"),a(d,c,u,h),c.push(p+"{")):p.match(/^[-\w$]+$/)?v[p]=d:a(d,c,u.indexOf(",")+p.indexOf(",")+2?n(u.split(","),p.split(","),1).join(","):e(u,p,1),h);case o:for(p in v)if(s.call(v,p)){c.push("}"),r(v,c,"",h),c.push(u+"{");break}}}var i={}.toString,s={}.hasOwnProperty,l=i.call({}),f=i.call([]),o=i.call(""),u=".j2c_"+(1e9*Math.random()|0)+"_"+1*new Date+"_",h=0;return c.sheet=function(n,e){return e=[],a(n,e,"",c.vendors),t(e)},c.scoped=function(n,e){var r={},i=[];for(e in n)s.call(n,e)&&(r[e]=u+h++,a(n[e],i,r[e],c.vendors));return i=new String(t(i)),i.classes=r,i},c.prefix=function(e,r){return n(e.map(function(n){return"-"+n+"-"}).concat([""]),[r])},c.vendors=[],c}();
var j2c=function(){function n(n,r,t,c,i,a){c=[];for(a in r)if(l.call(r,a))for(i in n)l.call(n,i)&&c.push(e(n[i],r[a],t));return c}function e(n,e,r){return r&&e.indexOf("&")+1?e.replace("&",n):n+e}function r(n,e,t,c,i,s,u){switch(a.call(n)){case o:for(i=n.length;i--;)r(n[i],e,t,c);break;case f:t=t&&t+"-";for(i in n)if(s=n[i],i.indexOf("$")+1)for(u in i=i.split("$"))l.call(i,u)&&r(s,e,t+i[u],c);else r(s,e,t+i,c);break;default:for(e.push(n=(t&&t.replace(/_/g,"-")+":")+n+";"),i=c.length;i--;)e.push("-"+c[i]+"-"+n)}}function t(n){return n.reverse().join("\n")}function c(n,e){return r(n,e=[],"",c.vendors),t(e)}function i(t,c,u,h,p,d,v){switch(v=t,a.call(t)){case o:for(p=t.length;p--;)i(t[p],c,u,h);break;case f:v={};for(p in t)d=t[p],"@"==p[0]?p.match(/^@keyframes /)?(c.push("}"),i(d,c,"",h),c.push(p+"{"),c.push("}"),i(d,c,"",["webkit"]),c.push("@-webkit-"+p.slice(1)+"{")):p.match(/^@font-face/)?i(d,c,p,[]):a.call(d)==s?c.push(p+" "+d+";"):(c.push("}"),i(d,c,u,h),c.push(p+"{")):p.match(/^[-\w$]+$/)?v[p]=d:i(d,c,u.indexOf(",")+p.indexOf(",")+2?n(u.split(","),p.split(","),1).join(","):e(u,p,1),h);case s:for(p in v)if(l.call(v,p)){c.push("}"),r(v,c,"",h),c.push(u+"{");break}}}var a={}.toString,l={}.hasOwnProperty,f=a.call({}),o=a.call([]),s=a.call(""),u=".j2c_"+(1e9*Math.random()|0)+"_"+1*new Date+"_",h=0;return c.sheet=function(n,e){return e=[],i(n,e,"",c.vendors),t(e)},c.scoped=function(n,e){var r={},a=[];for(e in n)l.call(n,e)&&(r[e]=u+h++,i(n[e],a,r[e],c.vendors));a=new String(t(a));for(e in n)l.call(n,e)&&(a[e]=r[e]);return a},c.prefix=function(e,r){return n(e.map(function(n){return"-"+n+"-"}).concat([""]),[r])},c.vendors=[],c}();

@@ -6,3 +6,4 @@ /*/-notice-/*//*

The -statements- section is discarded in the `inline` builds.
The -inline- and -statements- sections are mutually exclusive, and are only
included in the inline and main builds, respectively.

@@ -69,2 +70,10 @@ See the 'dist' directory for usable files.

/*/-inline-/*/
function j2c(o, buf) {
_declarations(o, buf = [], "", j2c.vendors);
return buf.reverse().join("\n");
}
/*/-inline-/*/
/*/-statements-/*/
function finalize(buf) {return buf.reverse().join("\n");}

@@ -78,4 +87,2 @@

/*/-statements-/*/
// Add rulesets and other CSS statements to the sheet.

@@ -171,3 +178,3 @@ function _add(statements, buf, prefix, vendors, /*var*/ k, v, decl) {

buf = new String(finalize(buf));
buf.classes = classes
for (k in statements) if (own.call(statements, k)) buf[k] = classes[k]
return buf

@@ -174,0 +181,0 @@ }

{
"name": "j2c",
"version": "0.5.0",
"version": "0.6.0",
"description": "A JavaScript object to CSS compiler.",

@@ -5,0 +5,0 @@ "main": "dist/j2c.commonjs.js",

@@ -16,3 +16,3 @@ # j2c

- [Usage](#usage)
- [For inline decalrations](#for-inline-decalrations)
- [For inline decalrations: `j2c(declarations)`](#for-inline-decalrations-j2cdeclarations)
- [Arrays](#arrays)

@@ -22,3 +22,3 @@ - [Overloading properties](#overloading-properties)

- [Vendor prefixes:](#vendor-prefixes)
- [For building a style sheet](#for-building-a-style-sheet)
- [For building a style sheet: `j2c.sheet(rules)`](#for-building-a-style-sheet-j2csheetrules)
- [Telling selectors and properties apart](#telling-selectors-and-properties-apart)

@@ -29,3 +29,3 @@ - [Combining multiple selectors](#combining-multiple-selectors)

- [Mixins redux](#mixins-redux)
- [Scoped sheet](#scoped-sheet)
- [Scoped sheet for components: `j2c.scoped(...)`](#scoped-sheet-for-components-j2cscoped)
- [Limitations](#limitations)

@@ -243,3 +243,3 @@ - [Selectors and properties order](#selectors-and-properties-order)

There's no support for prefixing a list multiple values (e.g. `"linear-gradient(90deg, #f00, #ff0),linear-gradient(90deg, #f00, #ff0)"`.
There's no support for prefixing a list multiple values (e.g. `"linear-gradient(90deg, #f00, #ff0),linear-gradient(90deg, #f00, #ff0)"`).

@@ -415,5 +415,6 @@ ### For building a style sheet: `j2c.sheet(rules)`

console.log(sheet.classes);
// { bit: '.j2c_371971407_1431849941805_0',
// bat: '.j2c_371971407_1431849941805_1' }
console.log(sheet.bit);
// '.j2c_371971407_1431849941805_0'
console.log(sheet.bat);
// '.j2c_371971407_1431849941805_1'

@@ -420,0 +421,0 @@ // `sheet` is actually a String object, which can be used as a normal string.

@@ -576,6 +576,6 @@ var j2c,

var css = j2c.scoped({bit:{foo:5},bat:{bar:6}});
expect(css.classes).not.to.be(null);
expect(css.classes.bit.slice(0,5)).to.be(".j2c_");
expect(css.indexOf(css.classes.bit+"{\nfoo:5;\n}")).not.to.be(-1);
expect(css.indexOf(css.classes.bat+"{\nbar:6;\n}")).not.to.be(-1);
expect(css.bit.slice(0,5)).to.be(".j2c_");
expect(css.bit).not.to.be(css.bat);
expect(css.indexOf(css.bit+"{\nfoo:5;\n}")).not.to.be(-1);
expect(css.indexOf(css.bat+"{\nbar:6;\n}")).not.to.be(-1);
});

@@ -582,0 +582,0 @@

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