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

Toolbox => Remove unused functions

parent 352adb78
No related branches found
No related tags found
No related merge requests found
......@@ -11,42 +11,9 @@ class Toolbox {
return Toolbox._instance;
}
public strToBool(str: string): boolean {
str = str.toLowerCase().trim();
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) {
let result = '';
let characters = 'abcdefghjklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789';
let charactersLength = characters.length;
for ( let i = 0 ; i < length ; i++ ) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
}
public capitalizingFirstLetter(word: string): string {
return word.charAt(0).toUpperCase() + word.slice(1);
}
public capitalizeName(name: string) {
return name.trim().replace(/(?:^|\s|-)\S/g, s => s.toUpperCase());
}
public formatHour(hour: string): string {
let hourElements = hour.split(':');
return hourElements[0] + 'h' + hourElements[1];
}
public async sleep(ms: number) {
await new Promise(r => setTimeout(r, ms));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment