Comparing version 1.1.0 to 1.1.1
{ | ||
"name": "rendy", | ||
"version": "1.1.0", | ||
"homepage": "https://github.com/coderaiser/rendy", | ||
@@ -5,0 +4,0 @@ "authors": [ |
@@ -5,6 +5,11 @@ (function(global) { | ||
if (typeof module === 'object' && module.exports) | ||
module.exports = rendy; | ||
module.exports = rendy; | ||
else | ||
global.rendy = rendy; | ||
global.rendy = rendy; | ||
var constant = function(a) { | ||
return function() { | ||
return a; | ||
}; | ||
} | ||
/** | ||
@@ -24,6 +29,6 @@ * render template with data | ||
.forEach(function(param) { | ||
var name = '{{ ' + param + ' }}', | ||
str = data[param]; | ||
var name = '{{ ' + param + ' }}'; | ||
var str = constant(data[param]); | ||
while(~result.indexOf(name)) | ||
while (~result.indexOf(name)) | ||
result = result.replace(name, str); | ||
@@ -30,0 +35,0 @@ }); |
{ | ||
"name": "rendy", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "simplest template engine", | ||
"main": "lib/rendy.js", | ||
"scripts": { | ||
"test": "gulp test" | ||
"test": "mocha", | ||
"coverage": "nyc npm test", | ||
"report": "nyc report --reporter=text-lcov | coveralls" | ||
}, | ||
@@ -24,6 +26,8 @@ "repository": { | ||
"devDependencies": { | ||
"gulp": "~3.8.10", | ||
"gulp-mocha": "~2.0.0", | ||
"should": "~6.0.1" | ||
"coveralls": "^3.0.0", | ||
"eslint": "^4.0.0", | ||
"mocha": "^5.0.0", | ||
"nyc": "^11.0.2", | ||
"should": "^13.0.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
10056
8
63
5