stringify helper for t.js

This commit is contained in:
Julian Lam
2015-01-29 10:08:48 -05:00
parent 60fecdbdf8
commit 8bc2d97352

View File

@@ -4,7 +4,7 @@
// export the class if we are in a Node-like system.
if (typeof module === 'object' && module.exports === exports) {
exports = module.exports/* = SemVer*/;
exports = module.exports/* = SemVer*/;
}
var helpers = {};
@@ -21,6 +21,11 @@
return '<meta ' + name + property + content + '/>';
};
helpers.stringify = function(obj) {
// Turns the incoming object into a JSON string
return JSON.stringify(obj).replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;").replace(/"/g, '&quot;');
};
// Groups helpers
helpers.membershipBtn = function(groupObj) {
if (groupObj.isMember) {