feat(JSON tools): handle big float

Fix #254
This commit is contained in:
ShareVB committed 2026-01-01 16:52:04 +01:00
1 parent 93b688a1b9
commit 0c334e9560
20 files changed
+31 -27

No files matched your search

@@ -9,10 +9,10 @@ const { t } = useI18n();
function parseJSON(value: string) {
try {
return JSON.parseBigInt(value);
return JSON.parseBigNum(value);
}
catch {
return JSON.parseBigInt(value.replace(/`((?:[^`]|\\`)*)`/g, (_m, s) => `"${s.replace(/"/g, '\\""').replace(/\r/g, '\\r').replace(/\n/g, '\\n')}"`));
return JSON.parseBigNum(value.replace(/`((?:[^`]|\\`)*)`/g, (_m, s) => `"${s.replace(/"/g, '\\""').replace(/\r/g, '\\r').replace(/\n/g, '\\n')}"`));
}
}