1 2 3 4 5 6 7 8 9 10 11
export default function looseParseInt(text: ChildNode | string | undefined): number { if (!text) { return 0; } if (typeof text !== 'string') { text = text.textContent; } return Number(text.replaceAll(/\D+/g, '')); }