summaryrefslogtreecommitdiff
path: root/app/node_modules/oktemplate/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/node_modules/oktemplate/index.js')
-rw-r--r--app/node_modules/oktemplate/index.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/app/node_modules/oktemplate/index.js b/app/node_modules/oktemplate/index.js
index a37f78e..f2c2e07 100644
--- a/app/node_modules/oktemplate/index.js
+++ b/app/node_modules/oktemplate/index.js
@@ -14,13 +14,24 @@ var filters = {
* Return a string formatted version of a JSON object.
* Useful for quick debugging of template data.
*/
- stringify: function(obj) {
+ prettify: function(obj) {
try {
return '<pre>' + stringify(obj) + '</pre>';
} catch (e) {
+ return 'Error prettifying';
+ }
+ },
+
+ /**
+ * Serialize Javascript objects into a JSON string
+ */
+ stringify: function(obj) {
+ try {
+ return JSON.stringify(obj);
+ } catch (e) {
return 'Error stringifying';
}
- }
+ },
};