mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-02 12:50:00 +01:00
stringify helper for t.js
This commit is contained in:
@@ -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,"&").replace(/</gm,"<").replace(/>/gm,">").replace(/"/g, '"');
|
||||
};
|
||||
|
||||
// Groups helpers
|
||||
helpers.membershipBtn = function(groupObj) {
|
||||
if (groupObj.isMember) {
|
||||
|
||||
Reference in New Issue
Block a user