Comparing version 0.0.5 to 0.0.6
@@ -40,3 +40,3 @@ // Generated by CoffeeScript 1.7.0 | ||
var runtime_path; | ||
runtime_path = path.join(this.compiler.__accord_path, '../ejs.min.js'); | ||
runtime_path = path.join(this.compiler.__accord_path, 'ejs.min.js'); | ||
return fs.readFileSync(runtime_path, 'utf8'); | ||
@@ -43,0 +43,0 @@ }; |
@@ -52,3 +52,3 @@ // Generated by CoffeeScript 1.7.0 | ||
var runtime_path; | ||
runtime_path = path.join(this.compiler.__accord_path, '../dist/handlebars.runtime.min.js'); | ||
runtime_path = path.join(this.compiler.__accord_path, 'dist/handlebars.runtime.min.js'); | ||
return fs.readFileSync(runtime_path, 'utf8'); | ||
@@ -55,0 +55,0 @@ }; |
@@ -44,3 +44,3 @@ // Generated by CoffeeScript 1.7.0 | ||
var runtime_path; | ||
runtime_path = path.join(this.compiler.__accord_path, '../web/builds/2.0.0/hogan-2.0.0.min.js'); | ||
runtime_path = path.join(this.compiler.__accord_path, 'web/builds/2.0.0/hogan-2.0.0.min.js'); | ||
return fs.readFileSync(runtime_path, 'utf8'); | ||
@@ -47,0 +47,0 @@ }; |
// Generated by CoffeeScript 1.7.0 | ||
(function() { | ||
var W, glob, path; | ||
var W, glob, path, resolve_path, _; | ||
@@ -11,3 +11,5 @@ W = require('when'); | ||
exports.load = function(name, lib) { | ||
_ = require('lodash'); | ||
exports.load = function(name, custom_path) { | ||
var adapter, compiler, cpath, err, lib_name; | ||
@@ -36,7 +38,9 @@ cpath = path.join(__dirname, 'adapters', name); | ||
} | ||
if (lib) { | ||
compiler = lib; | ||
if (custom_path) { | ||
compiler = require(custom_path); | ||
compiler.__accord_path = custom_path; | ||
} else { | ||
try { | ||
compiler = require(lib_name); | ||
compiler.__accord_path = resolve_path(lib_name); | ||
} catch (_error) { | ||
@@ -47,3 +51,2 @@ err = _error; | ||
} | ||
compiler.__accord_path = path.dirname(require.resolve(lib_name)); | ||
adapter = new (require(cpath))(compiler); | ||
@@ -57,2 +60,14 @@ return adapter; | ||
resolve_path = function(name) { | ||
var i, p, _i, _len, _path; | ||
_path = require.resolve(name).split(path.sep).reverse(); | ||
for (i = _i = 0, _len = _path.length; _i < _len; i = ++_i) { | ||
p = _path[i]; | ||
if (_path[i - 1] === name && p === 'node_modules') { | ||
break; | ||
} | ||
} | ||
return _.first(_path.reverse(), _path.length - i + 1).join(path.sep); | ||
}; | ||
}).call(this); |
{ | ||
"name": "accord", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"author": "Jeff Escalante <hello@jenius.me>", | ||
@@ -5,0 +5,0 @@ "description": "A unified interface for compiled languages and templates in javascript", |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
98145
787
0
9