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.3.0 to 0.4.0

2

dist/inline/j2c.amd.js

@@ -32,3 +32,3 @@ define('j2c', function(){return (function () {

v = o[k];
k.split("/").forEach(function(k){
k.split("$").forEach(function(k){
_declarations(v, buf, (pfx && pfx + "-") + k, vendors);

@@ -35,0 +35,0 @@ });

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

define("j2c",function(){return function(){function n(n){var r=[];return c(n,r,"",j2c.vendors,""),r.join("")}function c(n,t,i,a,f,u){switch(o.call(n)){case e:n.forEach(function(n){c(n,t,i,a)});break;case r:for(f in n)u=n[f],f.split("/").forEach(function(n){c(u,t,(i&&i+"-")+n,a)});break;default:n=(i&&i.replace(/_/g,"-")+":")+n+";",a.forEach(function(c){t.push("-"+c+"-"+n)}),t.push(n)}}{var r="[object Object]",e="[object Array]",o={}.toString;".j2c_"+(1e9*Math.random()|0)+"_"}return{inline:n,vendors:["o","ms","moz","webkit"]}}()});
define("j2c",function(){return function(){function n(n){var r=[];return c(n,r,"",j2c.vendors,""),r.join("")}function c(n,t,i,a,f,u){switch(o.call(n)){case e:n.forEach(function(n){c(n,t,i,a)});break;case r:for(f in n)u=n[f],f.split("$").forEach(function(n){c(u,t,(i&&i+"-")+n,a)});break;default:n=(i&&i.replace(/_/g,"-")+":")+n+";",a.forEach(function(c){t.push("-"+c+"-"+n)}),t.push(n)}}{var r="[object Object]",e="[object Array]",o={}.toString;".j2c_"+(1e9*Math.random()|0)+"_"}return{inline:n,vendors:["o","ms","moz","webkit"]}}()});

@@ -32,3 +32,3 @@ module.exports = (function () {

v = o[k];
k.split("/").forEach(function(k){
k.split("$").forEach(function(k){
_declarations(v, buf, (pfx && pfx + "-") + k, vendors);

@@ -35,0 +35,0 @@ });

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

module.exports=function(){function n(n){var r=[];return o(n,r,"",j2c.vendors,""),r.join("")}function o(n,t,a,i,u,f){switch(e.call(n)){case c:n.forEach(function(n){o(n,t,a,i)});break;case r:for(u in n)f=n[u],u.split("/").forEach(function(n){o(f,t,(a&&a+"-")+n,i)});break;default:n=(a&&a.replace(/_/g,"-")+":")+n+";",i.forEach(function(o){t.push("-"+o+"-"+n)}),t.push(n)}}{var r="[object Object]",c="[object Array]",e={}.toString;".j2c_"+(1e9*Math.random()|0)+"_"}return{inline:n,vendors:["o","ms","moz","webkit"]}}();
module.exports=function(){function n(n){var r=[];return o(n,r,"",j2c.vendors,""),r.join("")}function o(n,t,a,i,u,f){switch(e.call(n)){case c:n.forEach(function(n){o(n,t,a,i)});break;case r:for(u in n)f=n[u],u.split("$").forEach(function(n){o(f,t,(a&&a+"-")+n,i)});break;default:n=(a&&a.replace(/_/g,"-")+":")+n+";",i.forEach(function(o){t.push("-"+o+"-"+n)}),t.push(n)}}{var r="[object Object]",c="[object Array]",e={}.toString;".j2c_"+(1e9*Math.random()|0)+"_"}return{inline:n,vendors:["o","ms","moz","webkit"]}}();

@@ -32,3 +32,3 @@ export default (function () {

v = o[k];
k.split("/").forEach(function(k){
k.split("$").forEach(function(k){
_declarations(v, buf, (pfx && pfx + "-") + k, vendors);

@@ -35,0 +35,0 @@ });

@@ -32,3 +32,3 @@ ;var j2c = (function () {

v = o[k];
k.split("/").forEach(function(k){
k.split("$").forEach(function(k){
_declarations(v, buf, (pfx && pfx + "-") + k, vendors);

@@ -35,0 +35,0 @@ });

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

var j2c=function(){function n(n){var r=[];return c(n,r,"",j2c.vendors,""),r.join("")}function c(n,e,a,i,f,u){switch(t.call(n)){case o:n.forEach(function(n){c(n,e,a,i)});break;case r:for(f in n)u=n[f],f.split("/").forEach(function(n){c(u,e,(a&&a+"-")+n,i)});break;default:n=(a&&a.replace(/_/g,"-")+":")+n+";",i.forEach(function(c){e.push("-"+c+"-"+n)}),e.push(n)}}{var r="[object Object]",o="[object Array]",t={}.toString;".j2c_"+(1e9*Math.random()|0)+"_"}return{inline:n,vendors:["o","ms","moz","webkit"]}}();
var j2c=function(){function n(n){var r=[];return c(n,r,"",j2c.vendors,""),r.join("")}function c(n,e,a,i,f,u){switch(t.call(n)){case o:n.forEach(function(n){c(n,e,a,i)});break;case r:for(f in n)u=n[f],f.split("$").forEach(function(n){c(u,e,(a&&a+"-")+n,i)});break;default:n=(a&&a.replace(/_/g,"-")+":")+n+";",i.forEach(function(c){e.push("-"+c+"-"+n)}),e.push(n)}}{var r="[object Object]",o="[object Array]",t={}.toString;".j2c_"+(1e9*Math.random()|0)+"_"}return{inline:n,vendors:["o","ms","moz","webkit"]}}();

@@ -32,3 +32,3 @@ define('j2c', function(){return (function () {

v = o[k];
k.split("/").forEach(function(k){
k.split("$").forEach(function(k){
_declarations(v, buf, (pfx && pfx + "-") + k, vendors);

@@ -85,3 +85,3 @@ });

}
} else if (k.match(/^[-\w\/]+$/)) {
} else if (k.match(/^[-\w$]+$/)) {
props[k] = v;

@@ -88,0 +88,0 @@ } else {

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

define("j2c",function(){return function(){function n(n,t,r){return r={},r[n]=t,r}function t(n){var t=[];return r(n,t,"",o.vendors,""),t.join("")}function r(n,t,o,i,u,e){switch(h.call(n)){case c:n.forEach(function(n){r(n,t,o,i)});break;case f:for(u in n)e=n[u],u.split("/").forEach(function(n){r(e,t,(o&&o+"-")+n,i)});break;default:n=(o&&o.replace(/_/g,"-")+":")+n+";",i.forEach(function(r){t.push("-"+r+"-"+n)}),t.push(n)}}function o(n){return new i(n)}function i(n){this.root=null!=n?n:a+b++,this.buf=[]}function u(n,t){for(var r,o=[],i=0;i<t.length;i++)for(r=0;r<n.length;r++)o.push(n[r]+t[i]);return o}function e(n,t,o,i,a,b,p){switch(h.call(n)){case f:p={};for(a in n)b=n[a],"@"==a[0]?h.call(b)==f?(t.push(a+"{"),e(b,t,o,i),t.push("}")):t.push(a+" "+b+";"):a.match(/^[-\w\/]+$/)?p[a]=b:e(b,t,u(o,a.split(",")),i);for(a in p){t.push(o+"{"),r(p,t,"",i),t.push("}");break}break;case c:n.forEach(function(n){e(n,t,o,i)});break;case s:t.push(o.join(",")+"{"+n+"}")}}var f="[object Object]",s="[object String]",c="[object Array]",h={}.toString,a=".j2c_"+(1e9*Math.random()|0)+"_",b=0;return i.prototype=i,i.add=function(n){return e(n,this.buf,this.root.split(","),o.vendors),this},i.keyframes=function(t,r){return o.vendors.forEach(function(o){e(n("@-"+o+"-keyframes "+t,r),this.buf,[""],[o])},this),e(n("@keyframes "+t,r),this.buf,[""],o.vendors),this},i.font=function(n){return this.buf.push("@font-face{"),r(n,this.buf,"",[]),this.buf.push("}"),this},i.toString=function(){return this.buf.join("")},o.inline=t,o.vendors=["o","ms","moz","webkit"],o}()});
define("j2c",function(){return function(){function n(n,t,r){return r={},r[n]=t,r}function t(n){var t=[];return r(n,t,"",o.vendors,""),t.join("")}function r(n,t,o,i,u,e){switch(h.call(n)){case c:n.forEach(function(n){r(n,t,o,i)});break;case f:for(u in n)e=n[u],u.split("$").forEach(function(n){r(e,t,(o&&o+"-")+n,i)});break;default:n=(o&&o.replace(/_/g,"-")+":")+n+";",i.forEach(function(r){t.push("-"+r+"-"+n)}),t.push(n)}}function o(n){return new i(n)}function i(n){this.root=null!=n?n:a+b++,this.buf=[]}function u(n,t){for(var r,o=[],i=0;i<t.length;i++)for(r=0;r<n.length;r++)o.push(n[r]+t[i]);return o}function e(n,t,o,i,a,b,p){switch(h.call(n)){case f:p={};for(a in n)b=n[a],"@"==a[0]?h.call(b)==f?(t.push(a+"{"),e(b,t,o,i),t.push("}")):t.push(a+" "+b+";"):a.match(/^[-\w$]+$/)?p[a]=b:e(b,t,u(o,a.split(",")),i);for(a in p){t.push(o+"{"),r(p,t,"",i),t.push("}");break}break;case c:n.forEach(function(n){e(n,t,o,i)});break;case s:t.push(o.join(",")+"{"+n+"}")}}var f="[object Object]",s="[object String]",c="[object Array]",h={}.toString,a=".j2c_"+(1e9*Math.random()|0)+"_",b=0;return i.prototype=i,i.add=function(n){return e(n,this.buf,this.root.split(","),o.vendors),this},i.keyframes=function(t,r){return o.vendors.forEach(function(o){e(n("@-"+o+"-keyframes "+t,r),this.buf,[""],[o])},this),e(n("@keyframes "+t,r),this.buf,[""],o.vendors),this},i.font=function(n){return this.buf.push("@font-face{"),r(n,this.buf,"",[]),this.buf.push("}"),this},i.toString=function(){return this.buf.join("")},o.inline=t,o.vendors=["o","ms","moz","webkit"],o}()});

@@ -32,3 +32,3 @@ module.exports = (function () {

v = o[k];
k.split("/").forEach(function(k){
k.split("$").forEach(function(k){
_declarations(v, buf, (pfx && pfx + "-") + k, vendors);

@@ -85,3 +85,3 @@ });

}
} else if (k.match(/^[-\w\/]+$/)) {
} else if (k.match(/^[-\w$]+$/)) {
props[k] = v;

@@ -88,0 +88,0 @@ } else {

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

module.exports=function(){function t(t,n,r){return r={},r[t]=n,r}function n(t){var n=[];return r(t,n,"",o.vendors,""),n.join("")}function r(t,n,o,i,u,e){switch(h.call(t)){case c:t.forEach(function(t){r(t,n,o,i)});break;case s:for(u in t)e=t[u],u.split("/").forEach(function(t){r(e,n,(o&&o+"-")+t,i)});break;default:t=(o&&o.replace(/_/g,"-")+":")+t+";",i.forEach(function(r){n.push("-"+r+"-"+t)}),n.push(t)}}function o(t){return new i(t)}function i(t){this.root=null!=t?t:a+b++,this.buf=[]}function u(t,n){for(var r,o=[],i=0;i<n.length;i++)for(r=0;r<t.length;r++)o.push(t[r]+n[i]);return o}function e(t,n,o,i,a,b,p){switch(h.call(t)){case s:p={};for(a in t)b=t[a],"@"==a[0]?h.call(b)==s?(n.push(a+"{"),e(b,n,o,i),n.push("}")):n.push(a+" "+b+";"):a.match(/^[-\w\/]+$/)?p[a]=b:e(b,n,u(o,a.split(",")),i);for(a in p){n.push(o+"{"),r(p,n,"",i),n.push("}");break}break;case c:t.forEach(function(t){e(t,n,o,i)});break;case f:n.push(o.join(",")+"{"+t+"}")}}var s="[object Object]",f="[object String]",c="[object Array]",h={}.toString,a=".j2c_"+(1e9*Math.random()|0)+"_",b=0;return i.prototype=i,i.add=function(t){return e(t,this.buf,this.root.split(","),o.vendors),this},i.keyframes=function(n,r){return o.vendors.forEach(function(o){e(t("@-"+o+"-keyframes "+n,r),this.buf,[""],[o])},this),e(t("@keyframes "+n,r),this.buf,[""],o.vendors),this},i.font=function(t){return this.buf.push("@font-face{"),r(t,this.buf,"",[]),this.buf.push("}"),this},i.toString=function(){return this.buf.join("")},o.inline=n,o.vendors=["o","ms","moz","webkit"],o}();
module.exports=function(){function t(t,n,r){return r={},r[t]=n,r}function n(t){var n=[];return r(t,n,"",o.vendors,""),n.join("")}function r(t,n,o,i,u,e){switch(h.call(t)){case c:t.forEach(function(t){r(t,n,o,i)});break;case s:for(u in t)e=t[u],u.split("$").forEach(function(t){r(e,n,(o&&o+"-")+t,i)});break;default:t=(o&&o.replace(/_/g,"-")+":")+t+";",i.forEach(function(r){n.push("-"+r+"-"+t)}),n.push(t)}}function o(t){return new i(t)}function i(t){this.root=null!=t?t:a+b++,this.buf=[]}function u(t,n){for(var r,o=[],i=0;i<n.length;i++)for(r=0;r<t.length;r++)o.push(t[r]+n[i]);return o}function e(t,n,o,i,a,b,p){switch(h.call(t)){case s:p={};for(a in t)b=t[a],"@"==a[0]?h.call(b)==s?(n.push(a+"{"),e(b,n,o,i),n.push("}")):n.push(a+" "+b+";"):a.match(/^[-\w$]+$/)?p[a]=b:e(b,n,u(o,a.split(",")),i);for(a in p){n.push(o+"{"),r(p,n,"",i),n.push("}");break}break;case c:t.forEach(function(t){e(t,n,o,i)});break;case f:n.push(o.join(",")+"{"+t+"}")}}var s="[object Object]",f="[object String]",c="[object Array]",h={}.toString,a=".j2c_"+(1e9*Math.random()|0)+"_",b=0;return i.prototype=i,i.add=function(t){return e(t,this.buf,this.root.split(","),o.vendors),this},i.keyframes=function(n,r){return o.vendors.forEach(function(o){e(t("@-"+o+"-keyframes "+n,r),this.buf,[""],[o])},this),e(t("@keyframes "+n,r),this.buf,[""],o.vendors),this},i.font=function(t){return this.buf.push("@font-face{"),r(t,this.buf,"",[]),this.buf.push("}"),this},i.toString=function(){return this.buf.join("")},o.inline=n,o.vendors=["o","ms","moz","webkit"],o}();

@@ -32,3 +32,3 @@ export default (function () {

v = o[k];
k.split("/").forEach(function(k){
k.split("$").forEach(function(k){
_declarations(v, buf, (pfx && pfx + "-") + k, vendors);

@@ -85,3 +85,3 @@ });

}
} else if (k.match(/^[-\w\/]+$/)) {
} else if (k.match(/^[-\w$]+$/)) {
props[k] = v;

@@ -88,0 +88,0 @@ } else {

@@ -32,3 +32,3 @@ ;var j2c = (function () {

v = o[k];
k.split("/").forEach(function(k){
k.split("$").forEach(function(k){
_declarations(v, buf, (pfx && pfx + "-") + k, vendors);

@@ -85,3 +85,3 @@ });

}
} else if (k.match(/^[-\w\/]+$/)) {
} else if (k.match(/^[-\w$]+$/)) {
props[k] = v;

@@ -88,0 +88,0 @@ } else {

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

var j2c=function(){function n(n,t,r){return r={},r[n]=t,r}function t(n){var t=[];return r(n,t,"",o.vendors,""),t.join("")}function r(n,t,o,i,u,e){switch(h.call(n)){case c:n.forEach(function(n){r(n,t,o,i)});break;case s:for(u in n)e=n[u],u.split("/").forEach(function(n){r(e,t,(o&&o+"-")+n,i)});break;default:n=(o&&o.replace(/_/g,"-")+":")+n+";",i.forEach(function(r){t.push("-"+r+"-"+n)}),t.push(n)}}function o(n){return new i(n)}function i(n){this.root=null!=n?n:a+b++,this.buf=[]}function u(n,t){for(var r,o=[],i=0;i<t.length;i++)for(r=0;r<n.length;r++)o.push(n[r]+t[i]);return o}function e(n,t,o,i,a,b,p){switch(h.call(n)){case s:p={};for(a in n)b=n[a],"@"==a[0]?h.call(b)==s?(t.push(a+"{"),e(b,t,o,i),t.push("}")):t.push(a+" "+b+";"):a.match(/^[-\w\/]+$/)?p[a]=b:e(b,t,u(o,a.split(",")),i);for(a in p){t.push(o+"{"),r(p,t,"",i),t.push("}");break}break;case c:n.forEach(function(n){e(n,t,o,i)});break;case f:t.push(o.join(",")+"{"+n+"}")}}var s="[object Object]",f="[object String]",c="[object Array]",h={}.toString,a=".j2c_"+(1e9*Math.random()|0)+"_",b=0;return i.prototype=i,i.add=function(n){return e(n,this.buf,this.root.split(","),o.vendors),this},i.keyframes=function(t,r){return o.vendors.forEach(function(o){e(n("@-"+o+"-keyframes "+t,r),this.buf,[""],[o])},this),e(n("@keyframes "+t,r),this.buf,[""],o.vendors),this},i.font=function(n){return this.buf.push("@font-face{"),r(n,this.buf,"",[]),this.buf.push("}"),this},i.toString=function(){return this.buf.join("")},o.inline=t,o.vendors=["o","ms","moz","webkit"],o}();
var j2c=function(){function n(n,t,r){return r={},r[n]=t,r}function t(n){var t=[];return r(n,t,"",o.vendors,""),t.join("")}function r(n,t,o,i,u,e){switch(h.call(n)){case c:n.forEach(function(n){r(n,t,o,i)});break;case s:for(u in n)e=n[u],u.split("$").forEach(function(n){r(e,t,(o&&o+"-")+n,i)});break;default:n=(o&&o.replace(/_/g,"-")+":")+n+";",i.forEach(function(r){t.push("-"+r+"-"+n)}),t.push(n)}}function o(n){return new i(n)}function i(n){this.root=null!=n?n:a+b++,this.buf=[]}function u(n,t){for(var r,o=[],i=0;i<t.length;i++)for(r=0;r<n.length;r++)o.push(n[r]+t[i]);return o}function e(n,t,o,i,a,b,p){switch(h.call(n)){case s:p={};for(a in n)b=n[a],"@"==a[0]?h.call(b)==s?(t.push(a+"{"),e(b,t,o,i),t.push("}")):t.push(a+" "+b+";"):a.match(/^[-\w$]+$/)?p[a]=b:e(b,t,u(o,a.split(",")),i);for(a in p){t.push(o+"{"),r(p,t,"",i),t.push("}");break}break;case c:n.forEach(function(n){e(n,t,o,i)});break;case f:t.push(o.join(",")+"{"+n+"}")}}var s="[object Object]",f="[object String]",c="[object Array]",h={}.toString,a=".j2c_"+(1e9*Math.random()|0)+"_",b=0;return i.prototype=i,i.add=function(n){return e(n,this.buf,this.root.split(","),o.vendors),this},i.keyframes=function(t,r){return o.vendors.forEach(function(o){e(n("@-"+o+"-keyframes "+t,r),this.buf,[""],[o])},this),e(n("@keyframes "+t,r),this.buf,[""],o.vendors),this},i.font=function(n){return this.buf.push("@font-face{"),r(n,this.buf,"",[]),this.buf.push("}"),this},i.toString=function(){return this.buf.join("")},o.inline=t,o.vendors=["o","ms","moz","webkit"],o}();

@@ -1,5 +0,26 @@

/*! PocketGrid 1.1.0
* Copyright 2013 Arnaud Leray
* MIT License
/*
PocketGrid 1.1.0 Copyright (c) 2013 Arnaud Leray
j2c port Copyright (c) 2013 Pierre-Yves Gérardy
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
var j2c = require("../dist/j2c.commonjs");

@@ -9,4 +30,2 @@

// here's a straight port.
console.log(j2c.sheet("").add({

@@ -16,3 +35,3 @@ /* Border-box-sizing */

",:before,:after":{
"box-sizing":"border-box"
box_sizing:"border-box"
}

@@ -27,3 +46,3 @@ },

content: '""',
"line-heigth": 0
line_heigth: 0
},

@@ -33,5 +52,4 @@ ":after": {clear:"both"},

/* ul/li compatibility */
"list-style-type":"none",
padding:0,
margin:0,
list_style_type:"none",
margin$padding:0,

@@ -38,0 +56,0 @@ " > .blockgroup": {

@@ -9,3 +9,3 @@ // If you wanted to turn PockeGrid into a mixin, you could use this:

",:before,:after":{ //note the initial coma
"box-sizing":"border-box"
box_sizing:"border-box"
},

@@ -15,3 +15,3 @@ ":before,:after": {

content: '""',
"line-heigth": 0
line_heigth: 0
},

@@ -22,4 +22,3 @@ ":after": {clear:"both"},

"list-style-type":"none",
padding:0,
margin:0,
margin$padding:0,

@@ -42,1 +41,27 @@ " > .blockgroup": {

}
/*
PocketGrid 1.1.0 Copyright (c) 2013 Arnaud Leray
j2c port Copyright (c) 2013 Pierre-Yves Gérardy
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

@@ -35,3 +35,3 @@ /*/-notice-/*//*

v = o[k];
k.split("/").forEach(function(k){
k.split("$").forEach(function(k){
_declarations(v, buf, (pfx && pfx + "-") + k, vendors);

@@ -93,3 +93,3 @@ });

}
} else if (k.match(/^[-\w\/]+$/)) {
} else if (k.match(/^[-\w$]+$/)) {
props[k] = v;

@@ -96,0 +96,0 @@ } else {

{
"name": "j2c",
"version": "0.3.0",
"version": "0.4.0",
"description": "A JavaScript object to CSS compiler.",

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

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

- [But, seriously...](#but-seriously)
- [Installation](#installation)
- [Usage](#usage)

@@ -33,2 +34,3 @@ - [For building a style sheet](#for-building-a-style-sheet)

- [No input validation](#no-input-validation)
- [No pretty printing](#no-pretty-printing)
- [License: MIT](#license-mit)

@@ -52,3 +54,3 @@

This is mostly intended as a client-side helper to generate styles for Virtual DOM (React, Mithril, Mercury...) components.
This is mostly intended as a client-side helper to generate styles for Virtual DOM components (React, Mithril, Mercury...).

@@ -96,4 +98,4 @@ Whether or not this is useful as a general CSS replacement remains to be seen.

},
// convenient shortcut.
border: {"left/right": {width: 2px}}
// convenient $hortcut.
border: {left$right: {width: 2px}}
}

@@ -137,4 +139,4 @@ })

j2c("p").add({
// Notice the trailing slash, required for the unprefixed property.
"-o/-ms/-moz/-webkit/": {foo: "bar"},
// Notice the trailing dollar, required for the unprefixed property.
_o$_ms$_moz$_webkit$: {foo: "bar"},
hello: "world"

@@ -170,3 +172,3 @@ }).toString()

`j2c` considers that object keys matching `/^[-_0-9A-Za-z\/]+$/` as properties, and everything else as (sub-)selectors.
`j2c` considers that object keys matching `/^[-_0-9A-Za-z$]+$/` as properties, and everything else as (sub-)selectors. Since underscores are converted to dashes, it means that property names can be left unquoted, while (sub-)selectors have to be quoted.

@@ -414,4 +416,4 @@ Selectors are concatenated as is, while properties are concatenated with hyphens. `{" ul": {" li": {padding: {left:10}}}}` becomes ` ul li{padding-left:10px;}`. `{" p":{".foo":{color:"red"}}}`, is translated to ` p.foo:{color:red;}`.

For debugging purposes, I recommend that you pipe `j2c`'s output through a [be](https://github.com/mattbasta/crass)-[au](https://github.com/beautify-web/js-beautify)-[ti](https://github.com/senchalabs/cssbeautify)-[fier](http://csstidy.sourceforge.net/)
For debugging purposes, I recommend that you pipe `j2c`'s output through a [[be](https://github.com/mattbasta/crass) [au](https://github.com/beautify-web/js-beautify) [ti](https://github.com/senchalabs/cssbeautify) [fier](http://csstidy.sourceforge.net/)] of your choice.
## License: MIT

@@ -57,3 +57,3 @@ var j2c,

checkinline(
{foo:{"bar/qux":"baz"}},
{foo:{bar$qux:"baz"}},
"foo-bar:baz;foo-qux:baz;"

@@ -65,3 +65,3 @@ )

checkinline(
{foo:{"bar/baz":{qux:"quux"}}},
{foo:{bar$baz:{qux:"quux"}}},
"foo-bar-qux:quux;foo-baz-qux:quux;"

@@ -73,3 +73,3 @@ )

checkinline(
{foo:{"bar/baz":{"qux/quux":"fred"}}},
{foo:{bar$baz:{qux$quux:"fred"}}},
"foo-bar-qux:fred;foo-bar-quux:fred;foo-baz-qux:fred;foo-baz-quux:fred;"

@@ -109,3 +109,3 @@ )

checkinline(
{"-o/-p/":{foo:"bar"}},
{_o$_p$:{foo:"bar"}},
"-o-foo:bar;-p-foo:bar;foo:bar;"

@@ -265,3 +265,3 @@ )

add("p", {
"-o/-ms/-moz/-webkit/": {foo: "bar"}
_o$_ms$_moz$_webkit$: {foo: "bar"}
}),

@@ -268,0 +268,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