chore: 控制臺不解析 buffer
* 額外作用: 加快傳輸效率
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user