Prefer positive conditionals

This commit is contained in:
Lea Verou
2024-12-13 10:46:46 -05:00
parent a2ba049bbd
commit 4b584a2697

View File

@@ -59,5 +59,5 @@ export function toPx(value: string | number, element: HTMLElement | SVGElement =
}
export function toLength(px: number | string): string {
return !Number.isNaN(Number(px)) ? `${px}px` : (px as string);
return Number.isNaN(Number(px)) ? (px as string) : `${px}px`;
}