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

+4
View File
@@ -1,4 +1,5 @@
import _ from 'lodash';
import Decimal from 'decimal.js';
import type { Difference, DifferenceStatus } from './json-diff.types';
export { diff };
@@ -109,6 +110,9 @@ function getType(value: unknown): 'object' | 'array' | 'value' {
if (Array.isArray(value)) {
return 'array';
}
if (Decimal.isDecimal(value)) {
return 'value';
}
if (typeof value === 'object') {
return 'object';
}
+2 -2
View File
@@ -11,8 +11,8 @@ const { t } = useI18n();
const rawLeftJson = ref('');
const rawRightJson = ref('');
const leftJson = computed(() => withDefaultOnError(() => JSON.parseBigInt(rawLeftJson.value), undefined));
const rightJson = computed(() => withDefaultOnError(() => JSON.parseBigInt(rawRightJson.value), undefined));
const leftJson = computed(() => withDefaultOnError(() => JSON.parseBigNum(rawLeftJson.value), undefined));
const rightJson = computed(() => withDefaultOnError(() => JSON.parseBigNum(rawRightJson.value), undefined));
const jsonValidationRules = [
{