( value: CSSProperties["height"] )
| 1 | import type { CSSProperties } from "react"; |
| 2 | |
| 3 | export function parseNumericStyleValue( |
| 4 | value: CSSProperties["height"] |
| 5 | ): number | undefined { |
| 6 | if (value !== undefined) { |
| 7 | switch (typeof value) { |
| 8 | case "number": { |
| 9 | return value; |
| 10 | } |
| 11 | case "string": { |
| 12 | if (value.endsWith("px")) { |
| 13 | return parseFloat(value); |
| 14 | } |
| 15 | break; |
| 16 | } |
| 17 | } |
| 18 | } |
| 19 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…