EUS/utilities/ConsoleUtility.ts

15 lines
479 B
TypeScript
Raw Permalink Normal View History

2025-01-03 03:11:00 +00:00
import { green, yellow, red, gray } from "dyetty";
export default abstract class ConsoleUtility {
public static StatusColor(statusCode: number) {
if (statusCode < 300) {
return `${green(statusCode.toString())}`;
} else if (statusCode >= 300 && statusCode < 400) {
return `${yellow(statusCode.toString())}`;
} else if (statusCode >= 400 && statusCode < 600) {
return `${red(statusCode.toString())}`;
} else {
return `${gray(statusCode.toString())}`;
}
}
}