All files / src/utils UrlHelper.ts

50% Statements 2/4
100% Branches 0/0
33.33% Functions 1/3
50% Lines 2/4
1 2 3 4 5 6 7 8 9 10 11 12 13 141x   13x                      
export class UrlHelper {
  public static removeTrailingSlash(url: string): string {
    return url.replace(/(\/$)|(\\$)/, '');
  }
 
  public static removeLeadingSlash(url: string): string {
    return url.replace(/(^\/)|(^\\)/, '');
  }
 
  public static trimSlashes(url: string): string {
    return url.replace(/(^\/)|(^\\)|(\/$)|(\\$)/g, '');
  }
}