MCPcopy Index your code
hub / github.com/refined-github/refined-github / looseParseInt

Function looseParseInt

source/helpers/loose-parse-int.ts:2–12  ·  view source on GitHub ↗
(text: ChildNode | string | undefined | null)

Source from the content-addressed store, hash-verified

1// eslint-disable-next-line @typescript-eslint/no-restricted-types -- Simplify passing random nodes
2export 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}

Callers 8

calculateCssCalcStringFunction · 0.85
useCommitTitleFunction · 0.85
selectSumFunction · 0.85
redirectToBlameCommitFunction · 0.85
linkifyFunction · 0.85
isPopularFunction · 0.85
updaterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected