Project

General

Profile

« Previous | Next » 

Revision 58631

[Trunk | Library]: string-utils.class.ts: Method 'urlPrefix()' added to return "//" as prefix, when url does not start with protocol (http, https, //).

View differences:

modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/string-utils.class.ts
154 154
  }
155 155
}
156 156
export class StringUtils{
157
  public static urlPrefix(url: string): string {
158
    if(url.startsWith("http://") || url.startsWith("https://") || url.startsWith("//")) {
159
      return "";
160
    } else {
161
      return "//";
162
    }
163
  }
164

  
157 165
  public static quote(params: string):string {
158 166
      return '"'+params+'"';
159 167
  }

Also available in: Unified diff