Favor FlowRouter.url over Meteor.absoluteUrl

It hides the leading slash treatment as an hidden implementation
detail.
This commit is contained in:
Maxime Quandalle 2016-01-05 13:37:15 +01:00
parent 9ef8ebaf09
commit 701262a439
3 changed files with 17 additions and 34 deletions

View file

@ -5,24 +5,3 @@ 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;
},
};