Skip to content
Snippets Groups Projects
Commit 3d613661 authored by michael.minelli's avatar michael.minelli
Browse files

Toolbox => Add urlToPath function

parent 4b6eec92
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,10 @@ class Toolbox { ...@@ -16,6 +16,10 @@ class Toolbox {
return str === 'true' || str === '1'; return str === 'true' || str === '1';
} }
public urlToPath(url: string): string {
return url.replace(/^([a-z]{3,5}:\/{2})?[a-z.@]+(:[0-9]{1,5})?.(.*)/, '$3').replace('.git', '');
}
public randomString(length: number) { public randomString(length: number) {
let result = ''; let result = '';
let characters = 'abcdefghjklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789'; let characters = 'abcdefghjklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment