line height fix
deploy to danak / build_and_deploy (push) Has been cancelled

This commit is contained in:
hamid zarghami
2026-06-13 10:31:53 +03:30
parent 5174d0371d
commit 879bc0ae49
@@ -24,8 +24,13 @@ type ObjectSettingsProps = {
onDelete: (id: string) => void;
};
const roundNumbersDeep = <T,>(value: T): T => {
const DECIMAL_KEYS = new Set(["lineHeight"]);
const roundNumbersDeep = <T,>(value: T, parentKey?: string): T => {
if (typeof value === "number") {
if (parentKey && DECIMAL_KEYS.has(parentKey)) {
return value as T;
}
return Math.round(value) as T;
}
@@ -35,7 +40,7 @@ const roundNumbersDeep = <T,>(value: T): T => {
if (value && typeof value === "object") {
const roundedObject = Object.entries(value).reduce<Record<string, unknown>>((acc, [key, nestedValue]) => {
acc[key] = roundNumbersDeep(nestedValue);
acc[key] = roundNumbersDeep(nestedValue, key);
return acc;
}, {});