chore: 控制臺不解析 buffer

* 額外作用: 加快傳輸效率
This commit is contained in:
CrescentLeaf
2025-09-24 21:19:42 +08:00
parent 0a10009613
commit 3a9312654e

View File

@@ -8,6 +8,19 @@ import BaseApi from "./BaseApi.ts"
import DataWrongError from "./DataWrongError.ts"
import chalk from "chalk"
function stringifyNotIncludeArrayBuffer(value: any) {
return JSON.stringify(value, (_k, v) => {
if (v instanceof ArrayBuffer) {
return {
type: 'ArrayBuffer',
byteLength: value.byteLength,
data: '[...binary data omitted...]'
}
}
return v
})
}
export default class ApiManager {
static httpServer: HttpServerLike
static socketIoServer: SocketIo.Server