summaryrefslogtreecommitdiff
path: root/app/node_modules/oktemplate/index.js
diff options
context:
space:
mode:
authorSean Fridman <fridman@mail.sfsu.edu>2015-04-08 02:30:15 -0400
committerSean Fridman <fridman@mail.sfsu.edu>2015-04-08 02:30:17 -0400
commitb91c88be52170a7c9a8b133ef72052bec8caccba (patch)
tree50ea72111dc5c749955265ae8efbea947b078ca2 /app/node_modules/oktemplate/index.js
parentb465e560052689cd33b9723a6840e3688a015cb6 (diff)
Wrapping liquid lib's bluebird promises with Q promises
Can consider porting the whole thing to bluebird promises later
Diffstat (limited to 'app/node_modules/oktemplate/index.js')
-rw-r--r--app/node_modules/oktemplate/index.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/node_modules/oktemplate/index.js b/app/node_modules/oktemplate/index.js
index 700020c..dafe5e6 100644
--- a/app/node_modules/oktemplate/index.js
+++ b/app/node_modules/oktemplate/index.js
@@ -1,3 +1,4 @@
+var Q = require('q');
var fs = require('fs');
var path = require('path');
var glob = require('glob');
@@ -56,8 +57,12 @@ OKTemplateRepo.prototype._populateCache = function _populateCache(engine, cache,
name: name,
templateString: templateString,
render: function(data) {
+ return Q.promise(function(resolve, reject) {
// TODO Not sure if this caches parsed templates behind the scenes?
- return engine.parseAndRender(templateString, data);
+ engine.parseAndRender(templateString, data)
+ .then(resolve)
+ .catch(reject);
+ });
}
}
});