1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2025-01-14 14:43:17 +08:00
pigallery2/common/Utils.ts

23 lines
525 B
TypeScript
Raw Normal View History

2016-03-12 22:19:24 +01:00
export class Utils {
static clone<T>(object:T):T {
return JSON.parse(JSON.stringify(object));
}
2016-03-26 16:25:48 +01:00
static concatUrls(...args:Array<string>){
let url = "";
for(let i = 0 ; i < args.length; i++){
if(args[i] === "" || typeof args[i] === "undefined") continue;
let part = args[i].replace("\\","/");
if(part === "/" || part === "./") continue;
url += part + "/";
}
return url.substring(0, url.length - 1);
}
2016-03-12 22:19:24 +01:00
}