Huge News!Announcing our $40M Series B led by Abstract Ventures.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.37 to 0.0.38

1

client-side/build/absurd.js

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

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

@@ -2,0 +3,0 @@ var lib = {

var fs = require('fs');
var path = require("path");

@@ -31,2 +32,43 @@ module.exports = function() {

// Handling CSS
_api.handlecss = function(parsed, path) {
var plugins = _api.getPlugins();
if(parsed && parsed.type === 'stylesheet' && parsed.stylesheet && parsed.stylesheet.rules) {
var rules = parsed.stylesheet.rules;
for(var i=0; rule=rules[i]; i++) {
switch(rule.type) {
case "rule": _api.handlecssrule(rule); break;
case "import": _api.handlecssimport(rule, path); break;
default:
if(plugins[rule.type]) {
plugins[rule.type](_api, rule);
}
break;
}
}
}
return _api;
}
_api.handlecssimport = function(rule, cssPath) {
_api.import(path.dirname(cssPath) + "/" + rule.import.replace(/"/g, ''));
return _api;
}
_api.handlecssrule = function(rule, stylesheet) {
var absurdObj = {}, absurdProps = {};
if(rule.declarations && rule.declarations.length > 0) {
for(var i=0; decl=rule.declarations[i]; i++) {
if(decl.type === "declaration") {
absurdProps[decl.property] = decl.value;
}
}
if(rule.selectors && rule.selectors.length > 0) {
for(var i=0; selector=rule.selectors[i]; i++) {
absurdObj[selector] = absurdProps;
}
}
_api.add(absurdObj, stylesheet);
}
return _api;
}
// internal variables

@@ -33,0 +75,0 @@ _api.numOfAddedRules = 0;

@@ -34,2 +34,3 @@ var requireUncached = require('../helpers/RequireUncached.js'),

}
return function(path) {

@@ -36,0 +37,0 @@ if(typeof path == 'string') {

2

package.json
{
"name": "absurd",
"version": "0.0.37",
"version": "0.0.38",
"homepage": "https://github.com/krasimir/absurd",

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

@@ -5,7 +5,13 @@ 'use strict';

var getVersion = function(callback) {
var p = require(__dirname + "/../package.json");
callback(p.version)
}
module.exports = function(grunt) {
grunt.registerMultiTask('client-side', 'generate client-side version of the library', function() {
var tmp = grunt.file.read(this.data.src, {});
var content = '';
var tmp = grunt.file.read(this.data.src, {}),
content = '',
self = this;

@@ -26,5 +32,7 @@ content = "var Absurd = (function(w) {\n";

grunt.file.write(this.data.dest, content, {});
getVersion(function(version) {
grunt.file.write(self.data.dest, "/* version: " + version + " */\n" + content, {});
});
});
};
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