address rabbit's comments.

This commit is contained in:
Darshan
2025-09-29 11:58:50 +05:30
parent 10df6aee3e
commit 65dca243a5
2 changed files with 9 additions and 3 deletions
+8 -2
View File
@@ -199,14 +199,20 @@ function generateSingleValue(
case 'integer': {
const intAttr = column as Models.ColumnInteger;
const min = isWithinSafeRange(intAttr.min) ? intAttr.min : 0;
const max = isWithinSafeRange(intAttr.max) ? intAttr.max : Math.max(min + 100, 100);
const fallbackMax = Math.max(min + 100, 100);
const max = isWithinSafeRange(intAttr.max)
? intAttr.max
: Math.min(fallbackMax, Number.MAX_SAFE_INTEGER);
return faker.number.int({ min, max });
}
case 'double': {
const floatAttr = column as Models.ColumnFloat;
const min = isWithinSafeRange(floatAttr.min) ? floatAttr.min : 0;
const max = isWithinSafeRange(floatAttr.max) ? floatAttr.max : Math.max(min + 100, 100);
const fallbackMax = Math.max(min + 100, 100);
const max = isWithinSafeRange(floatAttr.max)
? floatAttr.max
: Math.min(fallbackMax, Number.MAX_SAFE_INTEGER);
const precision = 4;
return faker.number.float({ min, max, fractionDigits: precision });
@@ -52,7 +52,7 @@
let showDelete = $state(false);
let showOverview = $state(false);
let columns = $state([
let columns = $derived([
{ id: 'key', width: { min: $isSmallViewport ? 250 : 200 }, resizable: false },
{ id: 'type', width: 120, resizable: false },
{ id: 'columns', width: { min: 200 }, resizable: false },