@abaplint/runtime 2.0.66 → 2.0.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/operators/_parse.js +9 -1
- package/build/src/operators/add.d.ts +1 -1
- package/build/src/operators/div.js +4 -1
- package/build/src/operators/minus.d.ts +1 -1
- package/build/src/operators/multiply.d.ts +1 -1
- package/build/src/statements/create_data.d.ts +1 -0
- package/build/src/statements/create_data.js +6 -0
- package/build/src/types/_character.d.ts +4 -2
- package/build/src/types/character.d.ts +4 -2
- package/build/src/types/character.js +9 -0
- package/build/src/types/data_reference.d.ts +4 -3
- package/build/src/types/data_reference.js +7 -0
- package/build/src/types/date.d.ts +2 -2
- package/build/src/types/date.js +9 -0
- package/build/src/types/field_symbol.d.ts +3 -2
- package/build/src/types/field_symbol.js +7 -0
- package/build/src/types/hex.d.ts +2 -2
- package/build/src/types/hex.js +16 -12
- package/build/src/types/integer.js +9 -1
- package/build/src/types/string.d.ts +4 -2
- package/build/src/types/string.js +9 -0
- package/build/src/types/time.d.ts +2 -2
- package/build/src/types/time.js +9 -0
- package/build/src/types/utc_long.js +1 -1
- package/build/src/types/xstring.d.ts +3 -2
- package/build/src/types/xstring.js +9 -0
- package/package.json +1 -1
|
@@ -17,7 +17,15 @@ function parse(val) {
|
|
|
17
17
|
if (val.get() === "") {
|
|
18
18
|
return 0;
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
let num = parseInt(val.get(), 16);
|
|
21
|
+
// handle two complement,
|
|
22
|
+
if (val instanceof types_1.Hex && val.getLength() >= 4) {
|
|
23
|
+
const maxVal = Math.pow(2, val.get().length / 2 * 8);
|
|
24
|
+
if (num > maxVal / 2 - 1) {
|
|
25
|
+
num = num - maxVal;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return num;
|
|
21
29
|
}
|
|
22
30
|
else if (val instanceof types_1.Time || val instanceof types_1.Date) {
|
|
23
31
|
return val.getNumeric();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Float, Hex, Integer } from "../types";
|
|
2
2
|
import { ICharacter } from "../types/_character";
|
|
3
3
|
import { INumeric } from "../types/_numeric";
|
|
4
|
-
export declare function add(left: INumeric | ICharacter | string | number | Float | Integer | Hex, right: INumeric | ICharacter | string | number | Float | Integer | Hex):
|
|
4
|
+
export declare function add(left: INumeric | ICharacter | string | number | Float | Integer | Hex, right: INumeric | ICharacter | string | number | Float | Integer | Hex): Float | Integer;
|
|
@@ -4,7 +4,10 @@ exports.div = void 0;
|
|
|
4
4
|
const types_1 = require("../types");
|
|
5
5
|
const _parse_1 = require("./_parse");
|
|
6
6
|
function div(left, right) {
|
|
7
|
-
|
|
7
|
+
const l = (0, _parse_1.parse)(left);
|
|
8
|
+
const r = (0, _parse_1.parse)(right);
|
|
9
|
+
const ret = new types_1.Integer().set(Math.floor(l / r));
|
|
10
|
+
return ret;
|
|
8
11
|
}
|
|
9
12
|
exports.div = div;
|
|
10
13
|
//# sourceMappingURL=div.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Float, Integer } from "../types";
|
|
2
2
|
import { ICharacter } from "../types/_character";
|
|
3
3
|
import { INumeric } from "../types/_numeric";
|
|
4
|
-
export declare function minus(left: INumeric | ICharacter | string | number | Integer | Float, right: INumeric | ICharacter | string | number | Integer | Float):
|
|
4
|
+
export declare function minus(left: INumeric | ICharacter | string | number | Integer | Float, right: INumeric | ICharacter | string | number | Integer | Float): Float | Integer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Float, Integer } from "../types";
|
|
2
2
|
import { ICharacter } from "../types/_character";
|
|
3
3
|
import { INumeric } from "../types/_numeric";
|
|
4
|
-
export declare function multiply(left: INumeric | ICharacter | string | number, right: INumeric | ICharacter | string | number):
|
|
4
|
+
export declare function multiply(left: INumeric | ICharacter | string | number, right: INumeric | ICharacter | string | number): Float | Integer;
|
|
@@ -56,6 +56,12 @@ function createData(target, options) {
|
|
|
56
56
|
}
|
|
57
57
|
target.assign((0, clone_1.clone)(options.likeLineOf.getRowType()));
|
|
58
58
|
}
|
|
59
|
+
else if (options === null || options === void 0 ? void 0 : options.like) {
|
|
60
|
+
if (options.like instanceof types_1.FieldSymbol) {
|
|
61
|
+
options.like = options.like.getPointer();
|
|
62
|
+
}
|
|
63
|
+
target.assign((0, clone_1.clone)(options.like));
|
|
64
|
+
}
|
|
59
65
|
else {
|
|
60
66
|
target.assign((0, clone_1.clone)(target.getType()));
|
|
61
67
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { Hex } from "./hex";
|
|
2
|
+
import { INumeric } from "./_numeric";
|
|
1
3
|
export interface ICharacter {
|
|
2
4
|
set(value: ICharacter | string): void;
|
|
3
5
|
get(): string;
|
|
4
6
|
clear(): void;
|
|
5
7
|
getOffset(input: {
|
|
6
|
-
offset?: number;
|
|
7
|
-
length?: number;
|
|
8
|
+
offset?: number | INumeric | Hex;
|
|
9
|
+
length?: number | INumeric | Hex;
|
|
8
10
|
}): ICharacter;
|
|
9
11
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { Hex } from "./hex";
|
|
1
2
|
import { ICharacter } from "./_character";
|
|
3
|
+
import { INumeric } from "./_numeric";
|
|
2
4
|
export declare class Character implements ICharacter {
|
|
3
5
|
private value;
|
|
4
6
|
private readonly length;
|
|
@@ -13,7 +15,7 @@ export declare class Character implements ICharacter {
|
|
|
13
15
|
clear(): void;
|
|
14
16
|
get(): string;
|
|
15
17
|
getOffset(input: {
|
|
16
|
-
offset?: number;
|
|
17
|
-
length?: number;
|
|
18
|
+
offset?: number | INumeric | Hex;
|
|
19
|
+
length?: number | INumeric | Hex;
|
|
18
20
|
}): Character;
|
|
19
21
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Character = void 0;
|
|
4
|
+
const _parse_1 = require("../operators/_parse");
|
|
4
5
|
class Character {
|
|
5
6
|
constructor(input) {
|
|
6
7
|
this.length = (input === null || input === void 0 ? void 0 : input.length) ? input === null || input === void 0 ? void 0 : input.length : 1;
|
|
@@ -40,6 +41,12 @@ class Character {
|
|
|
40
41
|
return this.value;
|
|
41
42
|
}
|
|
42
43
|
getOffset(input) {
|
|
44
|
+
if (input === null || input === void 0 ? void 0 : input.offset) {
|
|
45
|
+
input.offset = (0, _parse_1.parse)(input.offset);
|
|
46
|
+
}
|
|
47
|
+
if (input === null || input === void 0 ? void 0 : input.length) {
|
|
48
|
+
input.length = (0, _parse_1.parse)(input.length);
|
|
49
|
+
}
|
|
43
50
|
if ((input.offset && input.offset >= this.length)
|
|
44
51
|
|| (input.offset && input.offset < 0)
|
|
45
52
|
|| (input.length && input.length < 0)) {
|
|
@@ -54,9 +61,11 @@ class Character {
|
|
|
54
61
|
}
|
|
55
62
|
let ret = this.value;
|
|
56
63
|
if (input === null || input === void 0 ? void 0 : input.offset) {
|
|
64
|
+
// @ts-ignore
|
|
57
65
|
ret = ret.substr(input.offset);
|
|
58
66
|
}
|
|
59
67
|
if ((input === null || input === void 0 ? void 0 : input.length) !== undefined) {
|
|
68
|
+
// @ts-ignore
|
|
60
69
|
ret = ret.substr(0, input.length);
|
|
61
70
|
}
|
|
62
71
|
const r = new Character({ length: ret.length });
|
|
@@ -5,6 +5,7 @@ import { Table } from "./table";
|
|
|
5
5
|
import { String } from "./string";
|
|
6
6
|
import { Structure } from "./structure";
|
|
7
7
|
import { Float } from "./float";
|
|
8
|
+
import { Hex } from "./hex";
|
|
8
9
|
declare type PointerType = INumeric | Table | ICharacter | ABAPObject | undefined | Structure | Float;
|
|
9
10
|
export declare class DataReference {
|
|
10
11
|
private pointer;
|
|
@@ -17,10 +18,10 @@ export declare class DataReference {
|
|
|
17
18
|
clear(): void;
|
|
18
19
|
get(): any;
|
|
19
20
|
array(): any;
|
|
20
|
-
set(value: any): void | ABAPObject |
|
|
21
|
+
set(value: any): void | ABAPObject | INumeric | ICharacter | Float | Table | Structure;
|
|
21
22
|
getOffset(input: {
|
|
22
|
-
offset
|
|
23
|
-
length
|
|
23
|
+
offset?: number | INumeric | Hex;
|
|
24
|
+
length?: number | INumeric | Hex;
|
|
24
25
|
}): String;
|
|
25
26
|
}
|
|
26
27
|
export {};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DataReference = void 0;
|
|
4
4
|
const string_1 = require("./string");
|
|
5
|
+
const _parse_1 = require("../operators/_parse");
|
|
5
6
|
class DataReference {
|
|
6
7
|
constructor(type) {
|
|
7
8
|
this.pointer = undefined;
|
|
@@ -47,6 +48,12 @@ class DataReference {
|
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
getOffset(input) {
|
|
51
|
+
if (input === null || input === void 0 ? void 0 : input.offset) {
|
|
52
|
+
input.offset = (0, _parse_1.parse)(input.offset);
|
|
53
|
+
}
|
|
54
|
+
if (input === null || input === void 0 ? void 0 : input.length) {
|
|
55
|
+
input.length = (0, _parse_1.parse)(input.length);
|
|
56
|
+
}
|
|
50
57
|
// Assuming we're interested in Strings here, for now...
|
|
51
58
|
let ret = this.get();
|
|
52
59
|
if (input === null || input === void 0 ? void 0 : input.offset) {
|
package/build/src/types/date.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.Date = void 0;
|
|
|
4
4
|
const string_1 = require("./string");
|
|
5
5
|
const _javascript_date_1 = require("./_javascript_date");
|
|
6
6
|
const float_1 = require("./float");
|
|
7
|
+
const _parse_1 = require("../operators/_parse");
|
|
7
8
|
class Date {
|
|
8
9
|
constructor() {
|
|
9
10
|
this.clear();
|
|
@@ -38,11 +39,19 @@ class Date {
|
|
|
38
39
|
return (0, _javascript_date_1.getNumberFromDate)(this.value);
|
|
39
40
|
}
|
|
40
41
|
getOffset(input) {
|
|
42
|
+
if (input === null || input === void 0 ? void 0 : input.offset) {
|
|
43
|
+
input.offset = (0, _parse_1.parse)(input.offset);
|
|
44
|
+
}
|
|
45
|
+
if (input === null || input === void 0 ? void 0 : input.length) {
|
|
46
|
+
input.length = (0, _parse_1.parse)(input.length);
|
|
47
|
+
}
|
|
41
48
|
let ret = this.value;
|
|
42
49
|
if (input === null || input === void 0 ? void 0 : input.offset) {
|
|
50
|
+
// @ts-ignore
|
|
43
51
|
ret = ret.substr(input.offset);
|
|
44
52
|
}
|
|
45
53
|
if ((input === null || input === void 0 ? void 0 : input.length) !== undefined) {
|
|
54
|
+
// @ts-ignore
|
|
46
55
|
ret = ret.substr(0, input.length);
|
|
47
56
|
}
|
|
48
57
|
const r = new string_1.String();
|
|
@@ -4,6 +4,7 @@ import { ABAPObject } from "./abap_object";
|
|
|
4
4
|
import { Table } from "./table";
|
|
5
5
|
import { String } from "./string";
|
|
6
6
|
import { Structure } from "./structure";
|
|
7
|
+
import { Hex } from "./hex";
|
|
7
8
|
declare type PointerType = INumeric | Table | ICharacter | ABAPObject | undefined | Structure;
|
|
8
9
|
export declare class FieldSymbol {
|
|
9
10
|
private pointer;
|
|
@@ -21,8 +22,8 @@ export declare class FieldSymbol {
|
|
|
21
22
|
array(): any;
|
|
22
23
|
set(value: any): this;
|
|
23
24
|
getOffset(input: {
|
|
24
|
-
offset
|
|
25
|
-
length
|
|
25
|
+
offset?: number | INumeric | Hex;
|
|
26
|
+
length?: number | INumeric | Hex;
|
|
26
27
|
}): String;
|
|
27
28
|
}
|
|
28
29
|
export {};
|
|
@@ -4,6 +4,7 @@ exports.FieldSymbol = void 0;
|
|
|
4
4
|
const table_1 = require("./table");
|
|
5
5
|
const string_1 = require("./string");
|
|
6
6
|
const hex_1 = require("./hex");
|
|
7
|
+
const _parse_1 = require("../operators/_parse");
|
|
7
8
|
class FieldSymbol {
|
|
8
9
|
constructor(type) {
|
|
9
10
|
this.pointer = undefined;
|
|
@@ -70,6 +71,12 @@ class FieldSymbol {
|
|
|
70
71
|
return this;
|
|
71
72
|
}
|
|
72
73
|
getOffset(input) {
|
|
74
|
+
if (input === null || input === void 0 ? void 0 : input.offset) {
|
|
75
|
+
input.offset = (0, _parse_1.parse)(input.offset);
|
|
76
|
+
}
|
|
77
|
+
if (input === null || input === void 0 ? void 0 : input.length) {
|
|
78
|
+
input.length = (0, _parse_1.parse)(input.length);
|
|
79
|
+
}
|
|
73
80
|
// Assuming we're interested in Strings here, for now...
|
|
74
81
|
let ret = this.get();
|
|
75
82
|
if (input === null || input === void 0 ? void 0 : input.offset) {
|
package/build/src/types/hex.d.ts
CHANGED
package/build/src/types/hex.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Hex = void 0;
|
|
4
|
-
const
|
|
4
|
+
const _parse_1 = require("../operators/_parse");
|
|
5
5
|
const float_1 = require("./float");
|
|
6
6
|
const xstring_1 = require("./xstring");
|
|
7
7
|
class Hex {
|
|
@@ -15,26 +15,22 @@ class Hex {
|
|
|
15
15
|
}
|
|
16
16
|
else if (typeof value === "number") {
|
|
17
17
|
if (value < 0) {
|
|
18
|
-
|
|
19
|
-
this.
|
|
20
|
-
|
|
18
|
+
const maxVal = Math.pow(2, this.length * 8);
|
|
19
|
+
this.value = Math.round(value + maxVal).toString(16);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
this.value = Math.round(value).toString(16);
|
|
21
23
|
}
|
|
22
|
-
this.value = Math.round(value).toString(16);
|
|
23
24
|
this.value = this.value.padStart(this.length * 2, "0");
|
|
24
25
|
}
|
|
25
26
|
else {
|
|
26
27
|
let v = value.get();
|
|
27
28
|
if (value instanceof float_1.Float) {
|
|
28
29
|
v = value.getRaw();
|
|
29
|
-
|
|
30
|
-
this.value = "F".repeat(this.length * 2);
|
|
31
|
-
this.set((0, operators_1.minus)(this, Math.abs(v) - 1));
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
30
|
+
this.set(v);
|
|
34
31
|
}
|
|
35
32
|
if (typeof v === "number") {
|
|
36
|
-
this.
|
|
37
|
-
this.value = this.value.padStart(this.length * 2, "0");
|
|
33
|
+
this.set(v);
|
|
38
34
|
}
|
|
39
35
|
else {
|
|
40
36
|
this.value = v;
|
|
@@ -61,11 +57,19 @@ class Hex {
|
|
|
61
57
|
return this.value;
|
|
62
58
|
}
|
|
63
59
|
getOffset(input) {
|
|
60
|
+
if (input === null || input === void 0 ? void 0 : input.offset) {
|
|
61
|
+
input.offset = (0, _parse_1.parse)(input.offset);
|
|
62
|
+
}
|
|
63
|
+
if (input === null || input === void 0 ? void 0 : input.length) {
|
|
64
|
+
input.length = (0, _parse_1.parse)(input.length);
|
|
65
|
+
}
|
|
64
66
|
let ret = this.value;
|
|
65
67
|
if (input === null || input === void 0 ? void 0 : input.offset) {
|
|
68
|
+
// @ts-ignore
|
|
66
69
|
ret = ret.substr(input.offset * 2);
|
|
67
70
|
}
|
|
68
71
|
if ((input === null || input === void 0 ? void 0 : input.length) !== undefined) {
|
|
72
|
+
// @ts-ignore
|
|
69
73
|
ret = ret.substr(0, input.length * 2);
|
|
70
74
|
}
|
|
71
75
|
const r = new xstring_1.XString();
|
|
@@ -32,7 +32,15 @@ class Integer {
|
|
|
32
32
|
this.set(Math.round(value.getRaw()));
|
|
33
33
|
}
|
|
34
34
|
else if (value instanceof hex_1.Hex || value instanceof xstring_1.XString) {
|
|
35
|
-
|
|
35
|
+
let num = parseInt(value.get(), 16);
|
|
36
|
+
// handle two complement,
|
|
37
|
+
if (value instanceof hex_1.Hex && value.getLength() >= 4) {
|
|
38
|
+
const maxVal = Math.pow(2, value.get().length / 2 * 8);
|
|
39
|
+
if (num > maxVal / 2 - 1) {
|
|
40
|
+
num = num - maxVal;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
this.set(num);
|
|
36
44
|
}
|
|
37
45
|
else {
|
|
38
46
|
this.set(value.get());
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { Hex } from "./hex";
|
|
1
2
|
import { ICharacter } from "./_character";
|
|
3
|
+
import { INumeric } from "./_numeric";
|
|
2
4
|
export declare class String implements ICharacter {
|
|
3
5
|
private value;
|
|
4
6
|
constructor();
|
|
@@ -6,7 +8,7 @@ export declare class String implements ICharacter {
|
|
|
6
8
|
clear(): void;
|
|
7
9
|
get(): string;
|
|
8
10
|
getOffset(input: {
|
|
9
|
-
offset
|
|
10
|
-
length
|
|
11
|
+
offset?: number | INumeric | Hex;
|
|
12
|
+
length?: number | INumeric | Hex;
|
|
11
13
|
}): String;
|
|
12
14
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.String = void 0;
|
|
4
|
+
const _parse_1 = require("../operators/_parse");
|
|
4
5
|
const character_1 = require("./character");
|
|
5
6
|
const integer_1 = require("./integer");
|
|
6
7
|
class String {
|
|
@@ -34,6 +35,12 @@ class String {
|
|
|
34
35
|
return this.value;
|
|
35
36
|
}
|
|
36
37
|
getOffset(input) {
|
|
38
|
+
if (input === null || input === void 0 ? void 0 : input.offset) {
|
|
39
|
+
input.offset = (0, _parse_1.parse)(input.offset);
|
|
40
|
+
}
|
|
41
|
+
if (input === null || input === void 0 ? void 0 : input.length) {
|
|
42
|
+
input.length = (0, _parse_1.parse)(input.length);
|
|
43
|
+
}
|
|
37
44
|
if ((input.offset && input.offset > this.value.length)
|
|
38
45
|
|| (input.offset && input.offset < 0)
|
|
39
46
|
|| (input.length && input.length < 0)) {
|
|
@@ -48,9 +55,11 @@ class String {
|
|
|
48
55
|
}
|
|
49
56
|
let ret = this.value;
|
|
50
57
|
if (input === null || input === void 0 ? void 0 : input.offset) {
|
|
58
|
+
// @ts-ignore
|
|
51
59
|
ret = ret.substr(input.offset);
|
|
52
60
|
}
|
|
53
61
|
if ((input === null || input === void 0 ? void 0 : input.length) !== undefined) {
|
|
62
|
+
// @ts-ignore
|
|
54
63
|
ret = ret.substr(0, input.length);
|
|
55
64
|
}
|
|
56
65
|
const r = new String();
|
package/build/src/types/time.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Time = void 0;
|
|
4
4
|
const string_1 = require("./string");
|
|
5
5
|
const _1 = require(".");
|
|
6
|
+
const _parse_1 = require("../operators/_parse");
|
|
6
7
|
class Time {
|
|
7
8
|
constructor() {
|
|
8
9
|
this.clear();
|
|
@@ -39,11 +40,19 @@ class Time {
|
|
|
39
40
|
return hours * 3600 + minutes * 60 + seconds;
|
|
40
41
|
}
|
|
41
42
|
getOffset(input) {
|
|
43
|
+
if (input === null || input === void 0 ? void 0 : input.offset) {
|
|
44
|
+
input.offset = (0, _parse_1.parse)(input.offset);
|
|
45
|
+
}
|
|
46
|
+
if (input === null || input === void 0 ? void 0 : input.length) {
|
|
47
|
+
input.length = (0, _parse_1.parse)(input.length);
|
|
48
|
+
}
|
|
42
49
|
let ret = this.value;
|
|
43
50
|
if (input === null || input === void 0 ? void 0 : input.offset) {
|
|
51
|
+
// @ts-ignore
|
|
44
52
|
ret = ret.substr(input.offset);
|
|
45
53
|
}
|
|
46
54
|
if ((input === null || input === void 0 ? void 0 : input.length) !== undefined) {
|
|
55
|
+
// @ts-ignore
|
|
47
56
|
ret = ret.substr(0, input.length);
|
|
48
57
|
}
|
|
49
58
|
const r = new string_1.String();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Hex } from "./hex";
|
|
1
2
|
import { ICharacter } from "./_character";
|
|
2
3
|
import { INumeric } from "./_numeric";
|
|
3
4
|
export declare class XString implements ICharacter {
|
|
@@ -7,7 +8,7 @@ export declare class XString implements ICharacter {
|
|
|
7
8
|
clear(): void;
|
|
8
9
|
get(): string;
|
|
9
10
|
getOffset(input: {
|
|
10
|
-
offset
|
|
11
|
-
length
|
|
11
|
+
offset?: number | INumeric | Hex;
|
|
12
|
+
length?: number | INumeric | Hex;
|
|
12
13
|
}): XString;
|
|
13
14
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.XString = void 0;
|
|
4
|
+
const _parse_1 = require("../operators/_parse");
|
|
4
5
|
class XString {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.value = "";
|
|
@@ -30,11 +31,19 @@ class XString {
|
|
|
30
31
|
return this.value;
|
|
31
32
|
}
|
|
32
33
|
getOffset(input) {
|
|
34
|
+
if (input === null || input === void 0 ? void 0 : input.offset) {
|
|
35
|
+
input.offset = (0, _parse_1.parse)(input.offset);
|
|
36
|
+
}
|
|
37
|
+
if (input === null || input === void 0 ? void 0 : input.length) {
|
|
38
|
+
input.length = (0, _parse_1.parse)(input.length);
|
|
39
|
+
}
|
|
33
40
|
let ret = this.value;
|
|
34
41
|
if (input === null || input === void 0 ? void 0 : input.offset) {
|
|
42
|
+
// @ts-ignore
|
|
35
43
|
ret = ret.substr(input.offset * 2);
|
|
36
44
|
}
|
|
37
45
|
if ((input === null || input === void 0 ? void 0 : input.length) !== undefined) {
|
|
46
|
+
// @ts-ignore
|
|
38
47
|
ret = ret.substr(0, input.length * 2);
|
|
39
48
|
}
|
|
40
49
|
const r = new XString();
|