(text: ChildNode | string | undefined | null)
| 1 | // eslint-disable-next-line @typescript-eslint/no-restricted-types -- Simplify passing random nodes |
| 2 | export default function looseParseInt(text: ChildNode | string | undefined | null): number { |
| 3 | if (!text) { |
| 4 | return 0; |
| 5 | } |
| 6 | |
| 7 | if (typeof text !== 'string') { |
| 8 | text = text.textContent; |
| 9 | } |
| 10 | |
| 11 | return Number(text.replaceAll(/\D+/g, '')); |
| 12 | } |
no outgoing calls
no test coverage detected