Comparing version 0.1.1 to 0.1.2
# Artist changes | ||
* 0.1.2 | ||
1. Fixed issue with options | ||
* 0.1.1 | ||
@@ -4,0 +6,0 @@ 1. The MIT License |
27
index.js
@@ -7,2 +7,11 @@ var defaults = { | ||
function extend(dest) { | ||
Array.prototype.slice.call(arguments, 1).forEach(function (src) { | ||
for (var i in src) { | ||
dest[i] = src[i]; | ||
} | ||
}); | ||
return dest; | ||
} | ||
/** | ||
@@ -20,13 +29,12 @@ * Returns a render function. | ||
* | ||
* @param {Options} opts | ||
* @param {Options} options | ||
* @return {Function} | ||
*/ | ||
exports.render = function (opts) { | ||
exports.render = function (options) { | ||
var fs = require('fs'), | ||
fest = require('fest'), | ||
cache = {}, | ||
options = defaults; | ||
cache = {}; | ||
for (var i in opts) options[i] = opts[i]; | ||
options = extend({}, defaults, options); | ||
@@ -79,13 +87,12 @@ function verifyCache(ts, path, data, fn) { | ||
* | ||
* @param {Options} opts | ||
* @param {Options} options | ||
* @return {Function} | ||
*/ | ||
exports.renderSync = function (opts) { | ||
exports.renderSync = function (options) { | ||
var fs = require('fs'), | ||
fest = require('fest'), | ||
cache = {}, | ||
options = defaults; | ||
cache = {}; | ||
for (var i in opts) options[i] = opts[i]; | ||
options = extend({}, defaults, options); | ||
@@ -92,0 +99,0 @@ function verifyCache(ts, path, data, fn) { |
{ | ||
"name": "artist", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Template engine for node.js built on Fest", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -68,5 +68,5 @@ var assert = require('assert'), | ||
assert.equal(str, ''); | ||
assert.deepEqual(errors, [ | ||
"Cannot read property 'bar' of undefined2\nin block \"fest:value\" at line: 2\nfile: /Users/eprev/projects/WGD/artist/test/error-runtime.xml" | ||
]); | ||
// runtime errors | ||
assert.equal(errors.length, 1); | ||
assert(errors[0].match(/Cannot read property 'bar' of undefined/)); | ||
}); | ||
@@ -127,7 +127,7 @@ }); | ||
render(__dirname + '/error-runtime.xml', {}); | ||
assert.deepEqual(errors, [ | ||
"Cannot read property 'bar' of undefined2\nin block \"fest:value\" at line: 2\nfile: /Users/eprev/projects/WGD/artist/test/error-runtime.xml" | ||
]); | ||
// runtime errors | ||
assert.equal(errors.length, 1); | ||
assert(errors[0].match(/Cannot read property 'bar' of undefined/)); | ||
}); | ||
}); | ||
}); |
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
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
11055
229