1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/common/Utils.ts

23 lines
525 B
TypeScript
Raw Normal View History

2016-03-13 05:19:24 +08:00
export class Utils {
static clone<T>(object:T):T {
return JSON.parse(JSON.stringify(object));
}
2016-03-26 23:25:48 +08: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-13 05:19:24 +08:00
}