MCPcopy Create free account
hub / github.com/Marus/cortex-debug / parseInteger

Function parseInteger

src/frontend/utils.ts:37–51  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

35}
36
37export function parseInteger(value: string): number {
38 if ((/^0b([01]+)$/i).test(value)) {
39 return parseInt(value.substring(2), 2);
40 }
41 else if ((/^0x([0-9a-f]+)$/i).test(value)) {
42 return parseInt(value.substring(2), 16);
43 }
44 else if ((/^[0-9]+/i).test(value)) {
45 return parseInt(value, 10);
46 }
47 else if ((/^#[0-1]+/i).test(value)) {
48 return parseInt(value.substring(1), 2);
49 }
50 return undefined;
51}
52
53export function parseDimIndex(spec: string, count: number): string[] {
54 if (spec.indexOf(',') !== -1) {

Callers 1

parseDimIndexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected