Greasy Fork

JSON formatter

Format JSON data in a beautiful way.

< 脚本 JSON formatter 的反馈

提问 / 留言

§
发布于:2019-03-29

大整数显示 bug

JSON.parse时,如果包含15位以上的大整数,会导致最后几位显示为0,要想正确显示只能先替换成字符串,再parse。

const raw = document.body.innerText.replace(/([[:])?(\d{15,})([,}]])/g, "$1{\"type\":\"bigint\",\"display\":\"$2\"}$3");

Gerald作者
§
发布于:2019-04-03

已添加支持

发布留言

登录以发布留言。