fix: make sure when using pxValueToNumber we pass valid numbers

pull/3137/head
yougotwill 8 months ago
parent be7425278c
commit 935175120a

@ -8,7 +8,11 @@ function setDuration(duration: number | string) {
}
export function pxValueToNumber(value: string) {
return Number(value.replace('px', ''));
const numberValue = Number(value.replace('px', ''));
if (Number.isNaN(numberValue)) {
throw new Error('Invalid number value');
}
return numberValue;
}
// These variables are independent of the current theme

Loading…
Cancel
Save