From 2653a2293e4f9352b4b875eb7d7ebd1029dbfdff Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 13 Mar 2015 05:52:41 -0400 Subject: [PATCH] refactor(util) render --- lib/util.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/util.js b/lib/util.js index a2210a4c..8d668f6a 100644 --- a/lib/util.js +++ b/lib/util.js @@ -257,14 +257,14 @@ * @param view */ this.render = function(templ, view) { - var str, regExp, - result = templ; + var result = templ; Object .keys(view) .forEach(function(param) { - str = view[param]; - regExp = RegExp('{{\\s' + param + '\\s}}', 'g'); + var str = view[param], + regExp = RegExp('{{\\s' + param + '\\s}}', 'g'); + result = result.replace(regExp, str); });