tsrpc icon indicating copy to clipboard operation
tsrpc copied to clipboard

bigint不能解析的问题

Open xiaodi007 opened this issue 2 years ago • 1 comments

https://github.com/k8w/tsrpc/blob/a4f492c194e66a38612e14bc792c1efd04694f07/src/server/base/ApiCall.ts#L199 能否改为

return { isSucc: true, output: type === 'json' ? json : JSON.stringify(
    json,
    (key, value) => (typeof value === 'bigint' ? value.toString() : value) 
  )  }; 

不知道这样解决合不合理

xiaodi007 avatar Jul 16 '22 08:07 xiaodi007

感谢建议,JSON 确实还没有支持 bigint,可以考虑用二进制传输。 后续会优化支持~

k8w avatar Oct 08 '22 12:10 k8w