MCPcopy Index your code
hub / github.com/JavaScriptRegenerated/yieldparser / ParseInt

Function ParseInt

src/math.test.ts:6–10  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4 const whitespaceMay = /^\s*/;
5
6 function* ParseInt() {
7 const isNegative: boolean = yield has('-');
8 const [stringValue]: [string] = yield /^\d+/;
9 return parseInt(stringValue, 10) * (isNegative ? -1 : 1);
10 }
11
12 type Operator = '+' | '-' | '*' | '/';
13

Callers

nothing calls this directly

Calls 1

hasFunction · 0.90

Tested by

no test coverage detected