Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bigint不能解析的问题 #29

Open
xiaodi007 opened this issue Jul 16, 2022 · 1 comment
Open

bigint不能解析的问题 #29

xiaodi007 opened this issue Jul 16, 2022 · 1 comment

Comments

@xiaodi007
Copy link

return { isSucc: true, output: type === 'json' ? json : JSON.stringify(json) };

能否改为

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

不知道这样解决合不合理

@k8w
Copy link
Owner

k8w commented Oct 8, 2022

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

@k8w k8w added the enhancement label Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants