diff options
| author | julie lala <jules@okfoc.us> | 2015-04-11 11:42:27 -0400 |
|---|---|---|
| committer | julie lala <jules@okfoc.us> | 2015-04-11 11:42:27 -0400 |
| commit | 65c1c6541f98eb863f9a19533f4bdb4bd9e38514 (patch) | |
| tree | 84cbe0902cc355b9e1556c346f217d1a4cafd552 /app/node_modules/oktemplate/index.js | |
| parent | 0b6afc1d5aa8a2f33b1c21e04a10c3eaa43870c1 (diff) | |
| parent | 2b95bcf414f02551a384ef2020958e90431814dd (diff) | |
merge
Diffstat (limited to 'app/node_modules/oktemplate/index.js')
| -rw-r--r-- | app/node_modules/oktemplate/index.js | 15 |
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'; } - } + }, }; |
