MCPcopy Create free account
hub / github.com/abaplint/transpiler / getOffset

Method getOffset

packages/runtime/src/types/data_reference.ts:94–112  ·  view source on GitHub ↗
(input: {offset?: number | INumeric | Hex, length?: number | INumeric | Hex})

Source from the content-addressed store, hash-verified

92 }
93
94 public getOffset(input: {offset?: number | INumeric | Hex, length?: number | INumeric | Hex}) {
95 if (input?.offset) {
96 input.offset = parse(input.offset);
97 }
98 if (input?.length) {
99 input.length = parse(input.length);
100 }
101 // Assuming we're interested in Strings here, for now...
102 let ret = this.get();
103 if (input?.offset) {
104 ret = ret.substr(input.offset);
105 }
106 if (input?.length !== undefined) {
107 ret = ret.substr(0, input.length);
108 }
109 const r = new String();
110 r.set(ret);
111 return r;
112 }
113}

Callers

nothing calls this directly

Calls 3

getMethod · 0.95
setMethod · 0.95
parseFunction · 0.90

Tested by

no test coverage detected