summaryrefslogtreecommitdiff
path: root/source/helpers/loose-parse-int.ts
blob: 081d519c076c4d278f17d680560d82e1a5afeb88 (plain) (blame)
1
2
3
4
5
6
7
export default function looseParseInt(text: Node | string): number {
	if (typeof text !== 'string') {
		text = text.textContent!;
	}

	return Number(text.replace(/\D+/g, ''));
}