fix: limit the number to safe integers

This commit is contained in:
Amit Joki
2025-02-24 05:36:56 +00:00
parent 6784daa7d7
commit 422150b4ee
4 changed files with 12 additions and 3 deletions

View File

@@ -808,3 +808,7 @@ export const parsePlainCellValue = (
return value as unknown as string
}
export function toSafeInteger(value: number) {
return Math.max(Number.MIN_SAFE_INTEGER, Math.min(value, Number.MAX_SAFE_INTEGER))
}