* Convert a string value to a number, handling null and empty strings. * * @param value string or null value to convert * @returns number value, or undefined for null/empty strings * * @example * Utils.toNumber('42'); // 42 * Utils.toNumber(''); // undefined * Utils.toNum
(value: null | string)
| 370 | * Utils.toNumber(null); // undefined |
| 371 | */ |
| 372 | static toNumber(value: null | string): number { |
| 373 | return (value === null || value.length === 0) ? undefined : Number(value); |
| 374 | } |
| 375 | |
| 376 | /** |
| 377 | * Parse a height value with units into numeric value and unit string. |
no outgoing calls
no test coverage detected