MCPcopy Create free account
hub / github.com/Fiddle-Digital/string-scroll / parseOffset

Method parseOffset

src/StringParse.ts:13–27  ·  view source on GitHub ↗
(e: any, o: any = "0,0", wH: any, baseRem: number = 16)

Source from the content-addressed store, hash-verified

11 }
12
13 public parseOffset(e: any, o: any = "0,0", wH: any, baseRem: number = 16) {
14 let ofs = o.split(',');
15 if (ofs.length === 1) {
16 ofs = [ofs[0], ofs[0]];
17 }
18 let oV = ofs.map((os: any) => {
19 os = os.trim();
20 if (os.startsWith('calc')) {
21 return this.parseCalc(os, e, wH, baseRem);
22 } else {
23 return this.parseSingle(os, e, wH, baseRem);
24 }
25 });
26 return oV;
27 }
28 public parseSingle(v: string, element: any, wH: any, baseRem: number): number {
29 let isNegative = v.startsWith('-');
30 if (isNegative) {

Callers 1

constructorMethod · 0.80

Calls 2

parseCalcMethod · 0.95
parseSingleMethod · 0.95

Tested by

no test coverage detected