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

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58631 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2020-05-07 11:28:55 +00:00
parent 326a590743
commit 371945553b
1 changed files with 8 additions and 0 deletions

View File

@ -154,6 +154,14 @@ export class Identifier{
}
}
export class StringUtils{
public static urlPrefix(url: string): string {
if(url.startsWith("http://") || url.startsWith("https://") || url.startsWith("//")) {
return "";
} else {
return "//";
}
}
public static quote(params: string):string {
return '"'+params+'"';
}