[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:
parent
326a590743
commit
371945553b
|
@ -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+'"';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue