| 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 | } |