build system
This commit is contained in:
parent
33a13cb1cc
commit
5730c94552
10 changed files with 32023 additions and 19272 deletions
|
|
@ -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",
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue