From 8bc2d973527f2eaa252e0cca28770f612e3bb5ab Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 29 Jan 2015 10:08:48 -0500 Subject: [PATCH] stringify helper for t.js --- public/src/modules/helpers.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/public/src/modules/helpers.js b/public/src/modules/helpers.js index bc40bde658..e8f77a5614 100644 --- a/public/src/modules/helpers.js +++ b/public/src/modules/helpers.js @@ -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 ''; }; + helpers.stringify = function(obj) { + // Turns the incoming object into a JSON string + return JSON.stringify(obj).replace(/&/gm,"&").replace(//gm,">").replace(/"/g, '"'); + }; + // Groups helpers helpers.membershipBtn = function(groupObj) { if (groupObj.isMember) {