New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

absurd

Package Overview
Dependencies
Maintainers
1
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

absurd - npm Package Compare versions

Comparing version 0.0.46 to 0.0.47

5

client-side/build/absurd.js

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

/* version: 0.0.45 */
/* version: 0.0.46 */
var Absurd = (function(w) {

@@ -172,2 +172,5 @@ var lib = {

props[prop] = false;
} else if(typeof props[prop] === 'function') {
props[prop] = props[prop]();
checkForNesting(selector, props, stylesheet);
} else {

@@ -174,0 +177,0 @@ if(checkAndExecutePlugin(selector, prop, props[prop], stylesheet)) {

2

client-side/build/absurd.min.js

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

var Absurd=function(){var a={api:{},helpers:{},plugins:{},processors:{css:{plugins:{}}}},b=function(){return function(){}},d="",e=function(){return function(b){var d=function(a,b){for(var c in b)hasOwnProperty.call(b,c)&&(a[c]=b[c]);return a},e={},f={},g={},h={},i={},j={combineSelectors:!0,minify:!1,processor:a.processors.css.CSS()};e.getRules=function(a){return"undefined"==typeof a?f:("undefined"==typeof f[a]&&(f[a]=[]),f[a])},e.getPlugins=function(){return h},e.getStorage=function(){return g},e.flush=function(){f={},g=[]},e.import=function(){return e.callHooks("import",arguments)?e:e},e.addHook=function(a,b){i[a]||(i[a]=[]);for(var d=!1,e=0;c=i[a][e];e++)c===b&&(d=!0);d===!1?i[a].push(b):null},e.callHooks=function(a,b){if(i[a])for(var d=0;c=i[a][d];d++)if(c.apply(e,b)===!0)return!0;return!1},e.numOfAddedRules=0,e.compile=function(a,b){return e.callHooks("compile",arguments)?e:(b=d(j,b||{}),b.processor(e.getRules(),a||function(){},{combineSelectors:!0}),void 0)};for(var k in a.api)"compile"!==k&&(e[k]=a.api[k](e),e[k]=function(b){return function(){var c=a.api[b](e);return e.callHooks(b,arguments)?e:c.apply(e,arguments)}}(k));for(var l in a.plugins)e.plugin(l,a.plugins[l]());return"function"==typeof b&&b(e),e}};a.api.add=function(a){var b=function(b,c,d,f){var g=a.getPlugins()[c];if("undefined"!=typeof g){var h=g(a,d);return h&&e(b,h,f),!0}return!1},c=function(b){var c=a.getPlugins();for(var d in b)"undefined"!=typeof c[d]&&(b[d]=!1);for(var d in b)":"===d.charAt(0)&&(b[d]=!1)},d=function(a,c,d){for(var f in c)"object"==typeof c[f]?(":"===f.charAt(0)?e(a+f,c[f],d):0===f.indexOf("@media")||0===f.indexOf("@supports")?e(a,c[f],f):b(a,f,c[f],d)===!1&&e(a+" "+f,c[f],d),c[f]=!1):b(a,f,c[f],d)&&(c[f]=!1)},e=function(f,g,h){if("undefined"==typeof g.length||"object"!=typeof g){if(!b(null,f,g,h)){if("object"==typeof a.getRules(h||"mainstream")[f]){var i=a.getRules(h||"mainstream")[f];for(var j in g)i[j]=g[j]}else a.getRules(h||"mainstream")[f]=g;d(f,g,h||"mainstream"),c(g)}}else for(var k=0;prop=g[k];k++)e(f,prop,h)},f=function(b,c){a.numOfAddedRules+=1;for(var d in b)if("undefined"!=typeof b[d].length&&"object"==typeof b[d])for(var f=0;r=b[d][f];f++)e(d,r,c||"mainstream");else e(d,b[d],c||"mainstream");return a};return f};var f=function(a,b){for(var c in b)hasOwnProperty.call(b,c)&&(a[c]=b[c]);return a};a.api.compile=function(a){return function(){for(var c=null,d=null,e=null,g=0;g<arguments.length;g++)switch(typeof arguments[g]){case"function":d=arguments[g];break;case"string":c=arguments[g];break;case"object":e=arguments[g]}var h={combineSelectors:!0,minify:!1,processor:b("../processors/CSS/CSS.js")()};e=f(h,e||{}),e.processor(a.getRules(),function(a,b){if(null!=c)try{fs.writeFile(c,b,function(a){d(a,b)})}catch(a){d(a)}else d(a,b)},e)}},a.api.compileFile=function(a){return a.compile};var g=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,""),a.length<6&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),b=b||0;var c,d,e="#";for(d=0;3>d;d++)c=parseInt(a.substr(2*d,2),16),c=Math.round(Math.min(Math.max(0,c+c*b),255)).toString(16),e+=("00"+c).substr(c.length);return e};a.api.darken=function(){return function(a,b){return g(a,-(b/100))}},a.api.hook=function(a){return function(b,c){return a.addHook(b,c),a}};var g=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,""),a.length<6&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),b=b||0;var c,d,e="#";for(d=0;3>d;d++)c=parseInt(a.substr(2*d,2),16),c=Math.round(Math.min(Math.max(0,c+c*b),255)).toString(16),e+=("00"+c).substr(c.length);return e};a.api.lighten=function(){return function(a,b){return g(a,b/100)}},a.api.plugin=function(a){var b=function(b,c){return a.getPlugins()[b]=c,a};return b},a.api.raw=function(a){return function(b){var c={},d={},e="____raw_"+a.numOfAddedRules;return d[e]=b,c[e]=d,a.add(c),a}},a.api.register=function(a){return function(b,c){return a[b]=c,a}},a.api.storage=function(a){var b=a.getStorage(),c=function(c,d){if("undefined"==typeof d){if(b[c])return b[c];throw new Error("There is no data in the storage associated with '"+c+"'")}return b[c]=d,a};return c},a.helpers.ColorLuminance=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,""),a.length<6&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),b=b||0;var c,d,e="#";for(d=0;3>d;d++)c=parseInt(a.substr(2*d,2),16),c=Math.round(Math.min(Math.max(0,c+c*b),255)).toString(16),e+=("00"+c).substr(c.length);return e},a.helpers.RequireUncached=function(a){return delete b.cache[b.resolve(a)],b(a)};var h=b("clean-css"),i="\n",j={combineSelectors:!0,minify:!1},k=function(a){var b="";for(var c in a)if(0===c.indexOf("____raw"))b+=a[c][c]+i;else{var d=c+" {"+i;for(var e in a[c]){var f=a[c][e];""===f&&(f='""'),d+=" "+n(e)+": "+f+";"+i}d+="}"+i,b+=d}return b},l=function(a){var b={};for(var c in a){var d=!1,e={};for(var f in a[c]){var g=a[c][f];g!==!1&&(d=!0,e[f]=g)}d&&(b[c]=e)}return b},m=function(a){var b={},c={};for(var d in a){var e=a[d];for(var f in e){var g=e[f];b[f]||(b[f]={}),b[f][g]||(b[f][g]=[]),b[f][g].push(d)}}for(var f in b){var h=b[f];for(var g in h){var i=h[g];c[i.join(", ")]||(c[i.join(", ")]={});var d=c[i.join(", ")];d[f]=g}}return c},n=function(a){for(var b="",d=0;c=a.charAt(d);d++)b+=c===c.toUpperCase()&&c.toLowerCase()!==c.toUpperCase()?"-"+c.toLowerCase():c;return b};return a.processors.css.CSS=function(){return function(a,b,c){c=c||j;var d="";for(var e in a){var f=l(a[e]);f=c.combineSelectors?m(f):f,d+="mainstream"===e?k(f):e+" {"+i+k(f)+"}"+i}return c.minify?(d=h.process(d),b&&b(null,d)):b&&b(null,d),d}},a.processors.css.plugins.charset=function(){return function(a,b){"string"==typeof b?a.raw('@charset: "'+b+'";'):"object"==typeof b&&(b=b.charset.replace(/:/g,"").replace(/'/g,"").replace(/"/g,"").replace(/ /g,""),a.raw('@charset: "'+b+'";'))}},a.processors.css.plugins.document=function(){return function(a,b){if("object"==typeof b){var c="";if(c+="@"+b.vendor+"document",c+=" "+b.document,b.rules&&b.rules.length)for(var d=0;rule=b.rules[d];d++)a.handlecssrule(rule,c);else"undefined"!=typeof b.styles&&a.add(b.styles,c)}}},a.processors.css.plugins.keyframes=function(){return function(a,c){var e=b(d+"/../CSS.js")();if("object"==typeof c)if("undefined"!=typeof c.frames){var f="@keyframes "+c.name+" {\n";f+=e({mainstream:c.frames}),f+="}",a.raw(f+"\n"+f.replace("@keyframes","@-webkit-keyframes"))}else if("undefined"!=typeof c.keyframes){for(var f="@keyframes "+c.name+" {\n",g={},h=0;rule=c.keyframes[h];h++)if("keyframe"===rule.type)for(var i=g[rule.values]={},j=0;declaration=rule.declarations[j];j++)"declaration"===declaration.type&&(i[declaration.property]=declaration.value);f+=e({mainstream:g}),f+="}",a.raw(f+"\n"+f.replace("@keyframes","@-webkit-keyframes"))}}},a.processors.css.plugins.media=function(){return function(a,c){var e=b(d+"/../CSS.js")();if("object"==typeof c){for(var f="@media "+c.media+" {\n",g={},h=0;rule=c.rules[h];h++){var i=g[rule.selectors.toString()]={};if("rule"===rule.type)for(var j=0;declaration=rule.declarations[j];j++)"declaration"===declaration.type&&(i[declaration.property]=declaration.value)}f+=e({mainstream:g}),f+="}",a.raw(f)}}},a.processors.css.plugins.namespace=function(){return function(a,b){"string"==typeof b?a.raw('@namespace: "'+b+'";'):"object"==typeof b&&(b=b.namespace.replace(/: /g,"").replace(/'/g,"").replace(/"/g,"").replace(/ /g,"").replace(/:h/g,"h"),a.raw('@namespace: "'+b+'";'))}},a.processors.css.plugins.page=function(){return function(a,b){if("object"==typeof b){var c="";c+=b.selectors.length>0?"@page "+b.selectors.join(", ")+" {\n":"@page {\n";for(var d=0;declaration=b.declarations[d];d++)"declaration"==declaration.type&&(c+=" "+declaration.property+": "+declaration.value+";\n");c+="}",a.raw(c)}}},a.processors.css.plugins.supports=function(){return function(a,c){var e=b(d+"/../CSS.js")();if("object"==typeof c){for(var f="@supports "+c.supports+" {\n",g={},h=0;rule=c.rules[h];h++){var i=g[rule.selectors.toString()]={};if("rule"===rule.type)for(var j=0;declaration=rule.declarations[j];j++)"declaration"===declaration.type&&(i[declaration.property]=declaration.value)}f+=e({mainstream:g}),f+="}",a.raw(f)}}},e()}(window);
var Absurd=function(){var a={api:{},helpers:{},plugins:{},processors:{css:{plugins:{}}}},b=function(){return function(){}},d="",e=function(){return function(b){var d=function(a,b){for(var c in b)hasOwnProperty.call(b,c)&&(a[c]=b[c]);return a},e={},f={},g={},h={},i={},j={combineSelectors:!0,minify:!1,processor:a.processors.css.CSS()};e.getRules=function(a){return"undefined"==typeof a?f:("undefined"==typeof f[a]&&(f[a]=[]),f[a])},e.getPlugins=function(){return h},e.getStorage=function(){return g},e.flush=function(){f={},g=[]},e.import=function(){return e.callHooks("import",arguments)?e:e},e.addHook=function(a,b){i[a]||(i[a]=[]);for(var d=!1,e=0;c=i[a][e];e++)c===b&&(d=!0);d===!1?i[a].push(b):null},e.callHooks=function(a,b){if(i[a])for(var d=0;c=i[a][d];d++)if(c.apply(e,b)===!0)return!0;return!1},e.numOfAddedRules=0,e.compile=function(a,b){return e.callHooks("compile",arguments)?e:(b=d(j,b||{}),b.processor(e.getRules(),a||function(){},{combineSelectors:!0}),void 0)};for(var k in a.api)"compile"!==k&&(e[k]=a.api[k](e),e[k]=function(b){return function(){var c=a.api[b](e);return e.callHooks(b,arguments)?e:c.apply(e,arguments)}}(k));for(var l in a.plugins)e.plugin(l,a.plugins[l]());return"function"==typeof b&&b(e),e}};a.api.add=function(a){var b=function(b,c,d,f){var g=a.getPlugins()[c];if("undefined"!=typeof g){var h=g(a,d);return h&&e(b,h,f),!0}return!1},c=function(b){var c=a.getPlugins();for(var d in b)"undefined"!=typeof c[d]&&(b[d]=!1);for(var d in b)":"===d.charAt(0)&&(b[d]=!1)},d=function(a,c,f){for(var g in c)"object"==typeof c[g]?(":"===g.charAt(0)?e(a+g,c[g],f):0===g.indexOf("@media")||0===g.indexOf("@supports")?e(a,c[g],g):b(a,g,c[g],f)===!1&&e(a+" "+g,c[g],f),c[g]=!1):"function"==typeof c[g]?(c[g]=c[g](),d(a,c,f)):b(a,g,c[g],f)&&(c[g]=!1)},e=function(f,g,h){if("undefined"==typeof g.length||"object"!=typeof g){if(!b(null,f,g,h)){if("object"==typeof a.getRules(h||"mainstream")[f]){var i=a.getRules(h||"mainstream")[f];for(var j in g)i[j]=g[j]}else a.getRules(h||"mainstream")[f]=g;d(f,g,h||"mainstream"),c(g)}}else for(var k=0;prop=g[k];k++)e(f,prop,h)},f=function(b,c){a.numOfAddedRules+=1;for(var d in b)if("undefined"!=typeof b[d].length&&"object"==typeof b[d])for(var f=0;r=b[d][f];f++)e(d,r,c||"mainstream");else e(d,b[d],c||"mainstream");return a};return f};var f=function(a,b){for(var c in b)hasOwnProperty.call(b,c)&&(a[c]=b[c]);return a};a.api.compile=function(a){return function(){for(var c=null,d=null,e=null,g=0;g<arguments.length;g++)switch(typeof arguments[g]){case"function":d=arguments[g];break;case"string":c=arguments[g];break;case"object":e=arguments[g]}var h={combineSelectors:!0,minify:!1,processor:b("../processors/CSS/CSS.js")()};e=f(h,e||{}),e.processor(a.getRules(),function(a,b){if(null!=c)try{fs.writeFile(c,b,function(a){d(a,b)})}catch(a){d(a)}else d(a,b)},e)}},a.api.compileFile=function(a){return a.compile};var g=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,""),a.length<6&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),b=b||0;var c,d,e="#";for(d=0;3>d;d++)c=parseInt(a.substr(2*d,2),16),c=Math.round(Math.min(Math.max(0,c+c*b),255)).toString(16),e+=("00"+c).substr(c.length);return e};a.api.darken=function(){return function(a,b){return g(a,-(b/100))}},a.api.hook=function(a){return function(b,c){return a.addHook(b,c),a}};var g=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,""),a.length<6&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),b=b||0;var c,d,e="#";for(d=0;3>d;d++)c=parseInt(a.substr(2*d,2),16),c=Math.round(Math.min(Math.max(0,c+c*b),255)).toString(16),e+=("00"+c).substr(c.length);return e};a.api.lighten=function(){return function(a,b){return g(a,b/100)}},a.api.plugin=function(a){var b=function(b,c){return a.getPlugins()[b]=c,a};return b},a.api.raw=function(a){return function(b){var c={},d={},e="____raw_"+a.numOfAddedRules;return d[e]=b,c[e]=d,a.add(c),a}},a.api.register=function(a){return function(b,c){return a[b]=c,a}},a.api.storage=function(a){var b=a.getStorage(),c=function(c,d){if("undefined"==typeof d){if(b[c])return b[c];throw new Error("There is no data in the storage associated with '"+c+"'")}return b[c]=d,a};return c},a.helpers.ColorLuminance=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,""),a.length<6&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),b=b||0;var c,d,e="#";for(d=0;3>d;d++)c=parseInt(a.substr(2*d,2),16),c=Math.round(Math.min(Math.max(0,c+c*b),255)).toString(16),e+=("00"+c).substr(c.length);return e},a.helpers.RequireUncached=function(a){return delete b.cache[b.resolve(a)],b(a)};var h=b("clean-css"),i="\n",j={combineSelectors:!0,minify:!1},k=function(a){var b="";for(var c in a)if(0===c.indexOf("____raw"))b+=a[c][c]+i;else{var d=c+" {"+i;for(var e in a[c]){var f=a[c][e];""===f&&(f='""'),d+=" "+n(e)+": "+f+";"+i}d+="}"+i,b+=d}return b},l=function(a){var b={};for(var c in a){var d=!1,e={};for(var f in a[c]){var g=a[c][f];g!==!1&&(d=!0,e[f]=g)}d&&(b[c]=e)}return b},m=function(a){var b={},c={};for(var d in a){var e=a[d];for(var f in e){var g=e[f];b[f]||(b[f]={}),b[f][g]||(b[f][g]=[]),b[f][g].push(d)}}for(var f in b){var h=b[f];for(var g in h){var i=h[g];c[i.join(", ")]||(c[i.join(", ")]={});var d=c[i.join(", ")];d[f]=g}}return c},n=function(a){for(var b="",d=0;c=a.charAt(d);d++)b+=c===c.toUpperCase()&&c.toLowerCase()!==c.toUpperCase()?"-"+c.toLowerCase():c;return b};return a.processors.css.CSS=function(){return function(a,b,c){c=c||j;var d="";for(var e in a){var f=l(a[e]);f=c.combineSelectors?m(f):f,d+="mainstream"===e?k(f):e+" {"+i+k(f)+"}"+i}return c.minify?(d=h.process(d),b&&b(null,d)):b&&b(null,d),d}},a.processors.css.plugins.charset=function(){return function(a,b){"string"==typeof b?a.raw('@charset: "'+b+'";'):"object"==typeof b&&(b=b.charset.replace(/:/g,"").replace(/'/g,"").replace(/"/g,"").replace(/ /g,""),a.raw('@charset: "'+b+'";'))}},a.processors.css.plugins.document=function(){return function(a,b){if("object"==typeof b){var c="";if(c+="@"+b.vendor+"document",c+=" "+b.document,b.rules&&b.rules.length)for(var d=0;rule=b.rules[d];d++)a.handlecssrule(rule,c);else"undefined"!=typeof b.styles&&a.add(b.styles,c)}}},a.processors.css.plugins.keyframes=function(){return function(a,c){var e=b(d+"/../CSS.js")();if("object"==typeof c)if("undefined"!=typeof c.frames){var f="@keyframes "+c.name+" {\n";f+=e({mainstream:c.frames}),f+="}",a.raw(f+"\n"+f.replace("@keyframes","@-webkit-keyframes"))}else if("undefined"!=typeof c.keyframes){for(var f="@keyframes "+c.name+" {\n",g={},h=0;rule=c.keyframes[h];h++)if("keyframe"===rule.type)for(var i=g[rule.values]={},j=0;declaration=rule.declarations[j];j++)"declaration"===declaration.type&&(i[declaration.property]=declaration.value);f+=e({mainstream:g}),f+="}",a.raw(f+"\n"+f.replace("@keyframes","@-webkit-keyframes"))}}},a.processors.css.plugins.media=function(){return function(a,c){var e=b(d+"/../CSS.js")();if("object"==typeof c){for(var f="@media "+c.media+" {\n",g={},h=0;rule=c.rules[h];h++){var i=g[rule.selectors.toString()]={};if("rule"===rule.type)for(var j=0;declaration=rule.declarations[j];j++)"declaration"===declaration.type&&(i[declaration.property]=declaration.value)}f+=e({mainstream:g}),f+="}",a.raw(f)}}},a.processors.css.plugins.namespace=function(){return function(a,b){"string"==typeof b?a.raw('@namespace: "'+b+'";'):"object"==typeof b&&(b=b.namespace.replace(/: /g,"").replace(/'/g,"").replace(/"/g,"").replace(/ /g,"").replace(/:h/g,"h"),a.raw('@namespace: "'+b+'";'))}},a.processors.css.plugins.page=function(){return function(a,b){if("object"==typeof b){var c="";c+=b.selectors.length>0?"@page "+b.selectors.join(", ")+" {\n":"@page {\n";for(var d=0;declaration=b.declarations[d];d++)"declaration"==declaration.type&&(c+=" "+declaration.property+": "+declaration.value+";\n");c+="}",a.raw(c)}}},a.processors.css.plugins.supports=function(){return function(a,c){var e=b(d+"/../CSS.js")();if("object"==typeof c){for(var f="@supports "+c.supports+" {\n",g={},h=0;rule=c.rules[h];h++){var i=g[rule.selectors.toString()]={};if("rule"===rule.type)for(var j=0;declaration=rule.declarations[j];j++)"declaration"===declaration.type&&(i[declaration.property]=declaration.value)}f+=e({mainstream:g}),f+="}",a.raw(f)}}},e()}(window);

@@ -529,3 +529,2 @@ describe("Adding raw data", function() {

p: {
margin: 0,
fontSize: function() {

@@ -538,6 +537,5 @@ return "10px"

}).compile(function(err, css) {
// console.log(css);
expect(err).toBe(null);
expect(css).toBeDefined();
// expect(css).toBe("body p {\n font-size: 10px;\n}\n")
expect(css).toBe("body p {\n font-size: 10px;\n}\n")
done();

@@ -544,0 +542,0 @@ });

@@ -46,2 +46,5 @@ lib.api.add = function(API) {

props[prop] = false;
} else if(typeof props[prop] === 'function') {
props[prop] = props[prop]();
checkForNesting(selector, props, stylesheet);
} else {

@@ -48,0 +51,0 @@ if(checkAndExecutePlugin(selector, prop, props[prop], stylesheet)) {

@@ -24,3 +24,3 @@ var extend = function(destination, source) {

minify: false,
processor: require("../processors/CSS/CSS.js")()
processor: require(__dirname + "/../processors/CSS/CSS.js")()
};

@@ -27,0 +27,0 @@ options = extend(_defaultOptions, options || {});

{
"name": "absurd",
"version": "0.0.46",
"version": "0.0.47",
"homepage": "https://github.com/krasimir/absurd",

@@ -5,0 +5,0 @@ "description": "CSS preprocessor",

@@ -15,2 +15,2 @@ # AbsurdJS

- Article about AbsurdJS - [link](http://davidwalsh.name/write-css-javascript)
- Writing your CSS with JavaScript - [link](http://davidwalsh.name/write-css-javascript)
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