Socket
Socket
Sign inDemoInstall

accord

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

accord - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

docs/haml.md

19

lib/adapters/coco.js

@@ -12,2 +12,4 @@ // Generated by CoffeeScript 1.7.0

Coco = (function(_super) {
var compile;
__extends(Coco, _super);

@@ -23,5 +25,20 @@

Coco.prototype._render = function(str, options) {
return W.resolve(this.compiler.compile(str, options));
return compile((function(_this) {
return function() {
return _this.compiler.compile(str, options);
};
})(this));
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (_error) {
err = _error;
return W.reject(err);
}
return W.resolve(res);
};
return Coco;

@@ -28,0 +45,0 @@

@@ -12,2 +12,4 @@ // Generated by CoffeeScript 1.7.0

CoffeeScript = (function(_super) {
var compile;
__extends(CoffeeScript, _super);

@@ -23,5 +25,20 @@

CoffeeScript.prototype._render = function(str, options) {
return W.resolve(this.compiler.compile(str, options));
return compile((function(_this) {
return function() {
return _this.compiler.compile(str, options);
};
})(this));
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (_error) {
err = _error;
return W.reject(err);
}
return W.resolve(res);
};
return CoffeeScript;

@@ -28,0 +45,0 @@

@@ -12,2 +12,4 @@ // Generated by CoffeeScript 1.7.0

CSSO = (function(_super) {
var compile;
__extends(CSSO, _super);

@@ -26,5 +28,20 @@

}
return W.resolve(this.compiler.justDoIt(str, options.noRestructure));
return compile((function(_this) {
return function() {
return _this.compiler.justDoIt(str, options.noRestructure);
};
})(this));
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (_error) {
err = _error;
return W.reject(err);
}
return W.resolve(res);
};
return CSSO;

@@ -31,0 +48,0 @@

@@ -9,4 +9,2 @@ // Generated by CoffeeScript 1.7.0

W = require('when');
path = require('path');

@@ -16,3 +14,7 @@

W = require('when');
EJS = (function(_super) {
var compile;
__extends(EJS, _super);

@@ -28,7 +30,15 @@

EJS.prototype._render = function(str, options) {
return W.resolve(this.compiler.render(str, options));
return compile((function(_this) {
return function() {
return _this.compiler.render(str, options);
};
})(this));
};
EJS.prototype._compile = function(str, options) {
return W.resolve(this.compiler.compile(str, options));
return compile((function(_this) {
return function() {
return _this.compiler.compile(str, options);
};
})(this));
};

@@ -38,3 +48,7 @@

options.client = true;
return W.resolve(this.compiler.compile(str, options).toString());
return compile((function(_this) {
return function() {
return _this.compiler.compile(str, options).toString();
};
})(this));
};

@@ -48,2 +62,13 @@

compile = function(fn) {
var err, res;
try {
res = fn();
} catch (_error) {
err = _error;
return W.reject(err);
}
return W.resolve(res);
};
return EJS;

@@ -50,0 +75,0 @@

@@ -18,3 +18,3 @@ // Generated by CoffeeScript 1.7.0

Handlebars = (function(_super) {
var register_helpers;
var compile, register_helpers;

@@ -34,3 +34,7 @@ __extends(Handlebars, _super);

register_helpers(compiler, options);
return W.resolve(compiler.compile(str)(options));
return compile((function(_this) {
return function() {
return compiler.compile(str)(options);
};
})(this));
};

@@ -42,3 +46,7 @@

register_helpers(compiler, options);
return W.resolve(compiler.compile(str));
return compile((function(_this) {
return function() {
return compiler.compile(str);
};
})(this));
};

@@ -50,3 +58,7 @@

register_helpers(compiler, options);
return W.resolve("Handlebars.template(" + (compiler.precompile(str)) + ");");
return compile((function(_this) {
return function() {
return "Handlebars.template(" + (compiler.precompile(str)) + ");";
};
})(this));
};

@@ -69,2 +81,13 @@

compile = function(fn) {
var err, res;
try {
res = fn();
} catch (_error) {
err = _error;
return W.reject(err);
}
return W.resolve(res);
};
return Handlebars;

@@ -71,0 +94,0 @@

@@ -18,2 +18,4 @@ // Generated by CoffeeScript 1.7.0

Jade = (function(_super) {
var compile;
__extends(Jade, _super);

@@ -29,11 +31,23 @@

Jade.prototype._render = function(str, options) {
return W.resolve(this.compiler.render(str, options));
return compile((function(_this) {
return function() {
return _this.compiler.render(str, options);
};
})(this));
};
Jade.prototype._compile = function(str, options) {
return W.resolve(this.compiler.compile(str, options));
return compile((function(_this) {
return function() {
return _this.compiler.compile(str, options);
};
})(this));
};
Jade.prototype._compileClient = function(str, options) {
return W.resolve(this.compiler.compileClient(str, options));
return compile((function(_this) {
return function() {
return _this.compiler.compileClient(str, options);
};
})(this));
};

@@ -50,2 +64,13 @@

compile = function(fn) {
var err, res;
try {
res = fn();
} catch (_error) {
err = _error;
return W.reject(err);
}
return W.resolve(res);
};
return Jade;

@@ -52,0 +77,0 @@

@@ -12,2 +12,4 @@ // Generated by CoffeeScript 1.7.0

LiveScript = (function(_super) {
var compile;
__extends(LiveScript, _super);

@@ -23,5 +25,20 @@

LiveScript.prototype._render = function(str, options) {
return W.resolve(this.compiler.compile(str, options));
return compile((function(_this) {
return function() {
return _this.compiler.compile(str, options);
};
})(this));
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (_error) {
err = _error;
return W.reject(err);
}
return W.resolve(res);
};
return LiveScript;

@@ -28,0 +45,0 @@

@@ -12,2 +12,4 @@ // Generated by CoffeeScript 1.7.0

MinifyCSS = (function(_super) {
var compile;
__extends(MinifyCSS, _super);

@@ -23,5 +25,20 @@

MinifyCSS.prototype._render = function(str, options) {
return W.resolve((new this.compiler(options)).minify(str));
return compile((function(_this) {
return function() {
return (new _this.compiler(options)).minify(str);
};
})(this));
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (_error) {
err = _error;
return W.reject(err);
}
return W.resolve(res);
};
return MinifyCSS;

@@ -28,0 +45,0 @@

@@ -14,2 +14,4 @@ // Generated by CoffeeScript 1.7.0

MinifyHTML = (function(_super) {
var compile;
__extends(MinifyHTML, _super);

@@ -30,5 +32,20 @@

});
return W.resolve(this.compiler.minify(str, options));
return compile((function(_this) {
return function() {
return _this.compiler.minify(str, options);
};
})(this));
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (_error) {
err = _error;
return W.reject(err);
}
return W.resolve(res);
};
return MinifyHTML;

@@ -35,0 +52,0 @@

@@ -14,2 +14,4 @@ // Generated by CoffeeScript 1.7.0

MinifyJS = (function(_super) {
var compile;
__extends(MinifyJS, _super);

@@ -25,7 +27,22 @@

MinifyJS.prototype._render = function(str, options) {
return W.resolve(this.compiler.minify(str, _.extend(options, {
fromString: true
})).code);
return compile((function(_this) {
return function() {
return _this.compiler.minify(str, _.extend(options, {
fromString: true
})).code;
};
})(this));
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (_error) {
err = _error;
return W.reject(err);
}
return W.resolve(res);
};
return MinifyJS;

@@ -32,0 +49,0 @@

@@ -18,2 +18,4 @@ // Generated by CoffeeScript 1.7.0

Mustache = (function(_super) {
var compile;
__extends(Mustache, _super);

@@ -29,7 +31,15 @@

Mustache.prototype._render = function(str, options) {
return W.resolve(this.compiler.compile(str, options).render(options, options.partials));
return compile((function(_this) {
return function() {
return _this.compiler.compile(str, options).render(options, options.partials);
};
})(this));
};
Mustache.prototype._compile = function(str, options) {
return W.resolve(this.compiler.compile(str, options));
return compile((function(_this) {
return function() {
return _this.compiler.compile(str, options);
};
})(this));
};

@@ -50,2 +60,13 @@

compile = function(fn) {
var err, res;
try {
res = fn();
} catch (_error) {
err = _error;
return W.reject(err);
}
return W.resolve(res);
};
return Mustache;

@@ -52,0 +73,0 @@

@@ -12,2 +12,4 @@ // Generated by CoffeeScript 1.7.0

Myth = (function(_super) {
var compile;
__extends(Myth, _super);

@@ -23,5 +25,20 @@

Myth.prototype._render = function(str, options) {
return W.resolve(this.compiler(str));
return compile((function(_this) {
return function() {
return _this.compiler(str);
};
})(this));
};
compile = function(fn) {
var err, res;
try {
res = fn();
} catch (_error) {
err = _error;
return W.reject(err);
}
return W.resolve(res);
};
return Myth;

@@ -28,0 +45,0 @@

45

lib/index.js
// Generated by CoffeeScript 1.7.0
(function() {
var W, glob, path, resolve_path, _;
var W, abstract_mapper, adapter_to_name, glob, name_to_adapter, path, resolve_path, _;

@@ -16,20 +16,3 @@ W = require('when');

cpath = path.join(__dirname, 'adapters', name);
lib_name = (function() {
switch (name) {
case 'markdown':
return 'marked';
case 'minify-js':
return 'uglify-js';
case 'minify-css':
return 'clean-css';
case 'minify-html':
return 'html-minifier';
case 'mustache':
return 'hogan.js';
case 'scss':
return 'node-sass';
default:
return name;
}
})();
lib_name = name_to_adapter(name);
if (!glob.sync("" + cpath + ".*").length) {

@@ -55,2 +38,3 @@ throw new Error('compiler not supported');

exports.supports = function(name) {
name = adapter_to_name(name);
return !!glob.sync("" + (path.join(__dirname, 'adapters', name)) + ".*").length;

@@ -71,2 +55,25 @@ };

abstract_mapper = function(name, direction) {
var name_maps, res;
name_maps = [['markdown', 'marked'], ['minify-js', 'uglify-js'], ['minify-css', 'clean-css'], ['minify-html', 'html-minifier'], ['mustache', 'hogan.js'], ['scss', 'node-sass'], ['haml', 'hamljs']];
res = null;
name_maps.forEach(function(n) {
if (direction === 'left' && n[0] === name) {
res = n[1];
}
if (direction === 'right' && n[1] === name) {
return res = n[0];
}
});
return res || name;
};
name_to_adapter = function(name) {
return abstract_mapper(name, 'left');
};
adapter_to_name = function(name) {
return abstract_mapper(name, 'right');
};
}).call(this);
{
"name": "accord",
"version": "0.0.6",
"version": "0.0.7",
"author": "Jeff Escalante <hello@jenius.me>",

@@ -28,2 +28,3 @@ "description": "A unified interface for compiled languages and templates in javascript",

"handlebars": "*",
"hamljs": "*",
"stylus": "*",

@@ -30,0 +31,0 @@ "node-sass": "*",

@@ -69,3 +69,3 @@ accord

- `accord.supports(string)` - quick test to see if accord supports a certain compiler. accepts a string (name of compiler), returns a boolean.
- `accord.supports(string)` - quick test to see if accord supports a certain compiler. accepts a string, which is the name of language (like markdown) or a compiler (like marked), returns a boolean.

@@ -93,2 +93,3 @@ ##### Accord Adapter Methods

- [handlebars](https://github.com/wycats/handlebars.js)
- [haml](https://github.com/visionmedia/haml.js)
- haml-coffee _(pending)_

@@ -95,0 +96,0 @@ - dust _(pending)_

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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