Files
UDN/utility.ts
T

18 lines
446 B
TypeScript
Raw Normal View History

2024-07-05 12:48:42 +02:00
import Colors from "colors";
2024-07-05 00:16:22 +02:00
export function guardStringNotEmpty(
data: any,
cb: (data: string) => void
): void {
if (typeof data != "string" || data == "") return;
2024-07-05 00:15:00 +02:00
cb(data);
}
2024-07-05 12:48:42 +02:00
2024-07-05 13:17:19 +02:00
export function writeInfo(label: string, value: string) {
console.log(label.padEnd(20, " "), Colors.bold.green(value));
}
2024-07-05 12:48:42 +02:00
export function writeStat(label: string, value: number) {
2024-07-05 13:17:19 +02:00
console.log(label.padEnd(20, " "), Colors.bold.blue(value.toString()));
2024-07-05 12:48:42 +02:00
}