build system

This commit is contained in:
Asaki Yuki 2026-02-02 15:12:31 +07:00
parent 33a13cb1cc
commit 5730c94552
10 changed files with 32023 additions and 19272 deletions

View file

@ -17,3 +17,24 @@ Map.prototype.toJSON = function () {
Array.prototype.lastItem = function () {
return this[this.length - 1]
}
const now = performance.now()
type LogType = "INFO"
function TypeHighlight(type: LogType) {
switch (type) {
case "INFO":
return `\x1b[32mINFO\x1b[0m`
default:
return type satisfies never
}
}
export function Log(type: LogType, message: string) {
console.log(
`\x1b[90m[${(performance.now() - now).toFixed(2)}ms]\x1b[0m`,
`[${TypeHighlight(type)}]`,
message,
"\x1b[0m",
)
}