15 lines
479 B
TypeScript
15 lines
479 B
TypeScript
|
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())}`;
|
||
|
}
|
||
|
}
|
||
|
}
|