summaryrefslogtreecommitdiffstats
path: root/server/lib
diff options
context:
space:
mode:
authorXavier Priour <xavier.priour@bubblyware.com>2015-12-17 11:58:55 +0100
committerXavier Priour <xavier.priour@bubblyware.com>2015-12-17 11:58:55 +0100
commit4cea6fca908b4f9acd8687293041ebee86284883 (patch)
tree10ee89e85ed938238b0b79dba5a726f8fa567042 /server/lib
parent3a52d7d7af838037b6e933203ffb661ff2e13b5e (diff)
downloadwekan-4cea6fca908b4f9acd8687293041ebee86284883.tar.gz
wekan-4cea6fca908b4f9acd8687293041ebee86284883.tar.bz2
wekan-4cea6fca908b4f9acd8687293041ebee86284883.zip
Export: include attachments
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/utils.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/server/lib/utils.js b/server/lib/utils.js
index b59671fb..a6a84f90 100644
--- a/server/lib/utils.js
+++ b/server/lib/utils.js
@@ -5,3 +5,24 @@ allowIsBoardAdmin = function(userId, board) {
allowIsBoardMember = function(userId, board) {
return board && board.hasMember(userId);
};
+
+// todo XXX not really server-specific,
+// so move it to a common (client+server) lib?
+Utils = {
+ /**
+ * If text starts with a / will remove it.
+ * @param text
+ */
+ stripLeadingSlash(text) {
+ // we need an actual text string
+ if (!text) {
+ return text;
+ }
+ // if starting with slash
+ if (text[0] === '/') {
+ return text.slice(1);
+ }
+ // otherwise leave untouched
+ return text;
+ },
+};