Made pad function a little easier to use
Some checks failed
Build / Tag Version (push) Blocked by required conditions
Build / Publish (push) Blocked by required conditions
Build / Build NPM Project (push) Has been cancelled

This commit is contained in:
Zakary Timson 2024-02-29 10:26:49 -05:00
parent 061e27d92a
commit 0e2d720fdf

View File

@ -62,11 +62,12 @@ export class Logger extends TypedEmitter<LoggerEvents> {
super();
}
private pad(text: string, length: number, char: string, end = false) {
const l = length - text.length;
if(l <= 0) return text;
private pad(text: any, length: number, char: string, end = false) {
const t = text.toString();
const l = length - t.length;
if(l <= 0) return t;
const padding = Array(~~(l / char.length)).fill(char).join('');
return !end ? padding + text : text + padding;
return !end ? padding + t : t + padding;
}