diff options
author | Xavier Priour <xavier.priour@bubblyware.com> | 2015-12-17 11:58:55 +0100 |
---|---|---|
committer | Xavier Priour <xavier.priour@bubblyware.com> | 2015-12-17 11:58:55 +0100 |
commit | 4cea6fca908b4f9acd8687293041ebee86284883 (patch) | |
tree | 10ee89e85ed938238b0b79dba5a726f8fa567042 /server/lib | |
parent | 3a52d7d7af838037b6e933203ffb661ff2e13b5e (diff) | |
download | wekan-4cea6fca908b4f9acd8687293041ebee86284883.tar.gz wekan-4cea6fca908b4f9acd8687293041ebee86284883.tar.bz2 wekan-4cea6fca908b4f9acd8687293041ebee86284883.zip |
Export: include attachments
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/utils.js | 21 |
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; + }, +}; |