@abaplint/runtime 2.7.165 → 2.8.1

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.
Files changed (74) hide show
  1. package/build/src/binary_search.js +2 -2
  2. package/build/src/builtin/count_any_of.js +1 -1
  3. package/build/src/builtin/find.js +5 -6
  4. package/build/src/builtin/round.js +1 -1
  5. package/build/src/builtin/substring.js +2 -3
  6. package/build/src/builtin/substring_after.js +3 -3
  7. package/build/src/builtin/substring_before.js +2 -2
  8. package/build/src/compare/eq.d.ts +2 -2
  9. package/build/src/compare/eq.js +10 -0
  10. package/build/src/compare/gt.js +6 -0
  11. package/build/src/compare/initial.d.ts +2 -2
  12. package/build/src/compare/initial.js +3 -0
  13. package/build/src/expand_in.js +2 -3
  14. package/build/src/index.js +2 -2
  15. package/build/src/operators/add.d.ts +2 -2
  16. package/build/src/operators/add.js +11 -0
  17. package/build/src/operators/div.d.ts +1 -1
  18. package/build/src/operators/div.js +13 -3
  19. package/build/src/operators/divide.d.ts +2 -2
  20. package/build/src/operators/divide.js +13 -0
  21. package/build/src/operators/minus.d.ts +2 -2
  22. package/build/src/operators/minus.js +6 -1
  23. package/build/src/operators/mod.d.ts +1 -1
  24. package/build/src/operators/mod.js +6 -0
  25. package/build/src/operators/multiply.d.ts +2 -2
  26. package/build/src/operators/multiply.js +6 -1
  27. package/build/src/operators/power.d.ts +2 -2
  28. package/build/src/operators/power.js +5 -0
  29. package/build/src/statements/assign.js +1 -2
  30. package/build/src/statements/cast.js +3 -4
  31. package/build/src/statements/convert.js +3 -4
  32. package/build/src/statements/create_data.js +6 -6
  33. package/build/src/statements/delete_internal.js +36 -56
  34. package/build/src/statements/describe.js +1 -2
  35. package/build/src/statements/find.js +10 -11
  36. package/build/src/statements/get_time.js +3 -3
  37. package/build/src/statements/index.js +1 -1
  38. package/build/src/statements/insert_internal.js +7 -9
  39. package/build/src/statements/loop.js +56 -83
  40. package/build/src/statements/message.js +5 -6
  41. package/build/src/statements/move_corresponding.js +1 -2
  42. package/build/src/statements/open_cursor.js +1 -1
  43. package/build/src/statements/read_table.d.ts +2 -2
  44. package/build/src/statements/read_table.js +23 -21
  45. package/build/src/statements/replace.js +1 -1
  46. package/build/src/statements/select.js +4 -5
  47. package/build/src/statements/set_bit.js +1 -1
  48. package/build/src/statements/shift.js +10 -10
  49. package/build/src/statements/sort.js +4 -5
  50. package/build/src/statements/write.js +7 -8
  51. package/build/src/template_formatting.js +2 -2
  52. package/build/src/types/abap_object.js +2 -2
  53. package/build/src/types/character.js +5 -8
  54. package/build/src/types/data_reference.d.ts +3 -2
  55. package/build/src/types/data_reference.js +8 -12
  56. package/build/src/types/date.js +5 -5
  57. package/build/src/types/field_symbol.d.ts +1 -1
  58. package/build/src/types/field_symbol.js +7 -12
  59. package/build/src/types/float.js +5 -1
  60. package/build/src/types/hex.d.ts +4 -3
  61. package/build/src/types/hex.js +20 -6
  62. package/build/src/types/integer.js +5 -1
  63. package/build/src/types/integer8.d.ts +3 -3
  64. package/build/src/types/integer8.js +8 -5
  65. package/build/src/types/numc.js +4 -4
  66. package/build/src/types/packed.js +3 -3
  67. package/build/src/types/string.js +3 -3
  68. package/build/src/types/structure.js +4 -4
  69. package/build/src/types/table.js +9 -13
  70. package/build/src/types/time.js +5 -5
  71. package/build/src/types/utc_long.js +1 -1
  72. package/build/src/types/xstring.d.ts +3 -2
  73. package/build/src/types/xstring.js +16 -5
  74. package/package.json +1 -1
@@ -14,7 +14,7 @@ function searchWithKeyEarlyExit(arr, withKey, startIndex = 0, usesTableLine, fir
14
14
  row = a.get();
15
15
  }
16
16
  else {
17
- row = isStructured ? Object.assign({ table_line: a }, a.get()) : { table_line: a };
17
+ row = isStructured ? { table_line: a, ...a.get() } : { table_line: a };
18
18
  }
19
19
  if (withKey(row) === true) {
20
20
  return {
@@ -49,7 +49,7 @@ function searchWithKey(arr, withKey, startIndex = 0, usesTableLine) {
49
49
  row = a.get();
50
50
  }
51
51
  else {
52
- row = isStructured ? Object.assign({ table_line: a }, a.get()) : { table_line: a };
52
+ row = isStructured ? { table_line: a, ...a.get() } : { table_line: a };
53
53
  }
54
54
  if (withKey(row) === true) {
55
55
  return {
@@ -65,7 +65,6 @@ function searchWithKey(arr, withKey, startIndex = 0, usesTableLine) {
65
65
  }
66
66
  /////////////////
67
67
  function readTable(table, options) {
68
- var _a, _b, _c, _d, _e;
69
68
  let found = undefined;
70
69
  let foundIndex = 0;
71
70
  let binarySubrc = undefined;
@@ -77,9 +76,9 @@ function readTable(table, options) {
77
76
  return readTable(table.getPointer(), options);
78
77
  }
79
78
  // check if it is a primary index read specified with WITH KEY instead of WITH TABLE KEY
80
- if ((options === null || options === void 0 ? void 0 : options.withTableKey) === undefined
81
- && (options === null || options === void 0 ? void 0 : options.withKeySimple)
82
- && (((_a = table.getOptions().primaryKey) === null || _a === void 0 ? void 0 : _a.keyFields) || []).length > 0) {
79
+ if (options?.withTableKey === undefined
80
+ && options?.withKeySimple
81
+ && (table.getOptions().primaryKey?.keyFields || []).length > 0) {
83
82
  if (table instanceof types_1.HashedTable) {
84
83
  // hashed tables requires all fields for fast lookup
85
84
  const fields = new Set(table.getOptions().primaryKey.keyFields);
@@ -104,7 +103,7 @@ function readTable(table, options) {
104
103
  }
105
104
  }
106
105
  }
107
- if (options === null || options === void 0 ? void 0 : options.index) {
106
+ if (options?.index) {
108
107
  if (table instanceof types_1.HashedTable) {
109
108
  throw new Error("Hashed table, READ INDEX not possible");
110
109
  }
@@ -120,6 +119,9 @@ function readTable(table, options) {
120
119
  if (index instanceof types_1.Float || index instanceof types_1.DecFloat34) {
121
120
  index = index.getRaw();
122
121
  }
122
+ else if (index instanceof types_1.Integer8) {
123
+ index = Number(index.get());
124
+ }
123
125
  else {
124
126
  index = index.get();
125
127
  }
@@ -129,21 +131,21 @@ function readTable(table, options) {
129
131
  foundIndex = index;
130
132
  }
131
133
  }
132
- else if (table instanceof types_1.HashedTable && (options === null || options === void 0 ? void 0 : options.withTableKey) === true && options.withKeySimple) {
134
+ else if (table instanceof types_1.HashedTable && options?.withTableKey === true && options.withKeySimple) {
133
135
  const hash = table.buildHashFromSimple(options.withKeySimple);
134
136
  found = table.read(hash);
135
137
  foundIndex = 0;
136
138
  }
137
- else if (table instanceof types_1.HashedTable && (options === null || options === void 0 ? void 0 : options.withKey)) {
139
+ else if (table instanceof types_1.HashedTable && options?.withKey) {
138
140
  // this is slow..
139
- const searchResult = searchWithKey(table.array(), options.withKey, 0, options === null || options === void 0 ? void 0 : options.usesTableLine);
141
+ const searchResult = searchWithKey(table.array(), options.withKey, 0, options?.usesTableLine);
140
142
  found = searchResult.found;
141
143
  foundIndex = 0;
142
144
  }
143
- else if ((options === null || options === void 0 ? void 0 : options.keyName) && options.withKey && options.withKeySimple) {
145
+ else if (options?.keyName && options.withKey && options.withKeySimple) {
144
146
  const arr = table.getSecondaryIndex(options.keyName);
145
147
  const keyInformation = table.getKeyByName(options.keyName);
146
- const firstKeyName = keyInformation === null || keyInformation === void 0 ? void 0 : keyInformation.keyFields[0];
148
+ const firstKeyName = keyInformation?.keyFields[0];
147
149
  if (firstKeyName === undefined) {
148
150
  throw new Error("readTable, first key name not found");
149
151
  }
@@ -151,7 +153,7 @@ function readTable(table, options) {
151
153
  const firstValue = options.withKeySimple[firstKeyName.toLowerCase()];
152
154
  if (firstValue === undefined) {
153
155
  // fallback
154
- return readTable(table, Object.assign(Object.assign({}, options), { withKeySimple: undefined }));
156
+ return readTable(table, { ...options, withKeySimple: undefined });
155
157
  }
156
158
  const startIndex = (0, binary_search_1.binarySearchFrom)(arr, 0, arr.length, firstKeyName.toLowerCase(), firstValue) - 1;
157
159
  // console.dir("startindex: " + startIndex);
@@ -162,9 +164,9 @@ function readTable(table, options) {
162
164
  foundIndex = searchResult.foundIndex;
163
165
  }
164
166
  }
165
- else if (((options === null || options === void 0 ? void 0 : options.binarySearch) === true || (options === null || options === void 0 ? void 0 : options.withTableKey) === true)
167
+ else if ((options?.binarySearch === true || options?.withTableKey === true)
166
168
  && options.withKeyValue
167
- && ((options === null || options === void 0 ? void 0 : options.binarySearch) === true || ((_b = table.getOptions().primaryKey) === null || _b === void 0 ? void 0 : _b.type) !== types_1.TableAccessType.standard)
169
+ && (options?.binarySearch === true || table.getOptions().primaryKey?.type !== types_1.TableAccessType.standard)
168
170
  && options.withKey) {
169
171
  // note: it currently only uses the first key field for binary search, todo
170
172
  const first = options.withKeyValue[0];
@@ -190,7 +192,7 @@ function readTable(table, options) {
190
192
  row = last.get();
191
193
  }
192
194
  else {
193
- row = isStructured ? Object.assign({ table_line: last }, last.get()) : { table_line: last };
195
+ row = isStructured ? { table_line: last, ...last.get() } : { table_line: last };
194
196
  }
195
197
  if ((0, compare_1.ge)(first.value, first.key(row))) {
196
198
  binarySubrc = 8;
@@ -198,20 +200,20 @@ function readTable(table, options) {
198
200
  }
199
201
  }
200
202
  }
201
- else if (options === null || options === void 0 ? void 0 : options.withKey) {
203
+ else if (options?.withKey) {
202
204
  const arr = table.array();
203
205
  const searchResult = searchWithKey(arr, options.withKey, 0, options.usesTableLine);
204
206
  found = searchResult.found;
205
207
  foundIndex = searchResult.foundIndex;
206
208
  }
207
- else if (options === null || options === void 0 ? void 0 : options.from) {
209
+ else if (options?.from) {
208
210
  if (options.from instanceof types_1.FieldSymbol) {
209
211
  options.from = options.from.getPointer();
210
212
  }
211
213
  if (table instanceof types_1.Table && options.from instanceof types_1.Structure) {
212
214
  // todo: optimize if the primary key is sorted
213
215
  const arr = table.array();
214
- const keys = (_d = (_c = table.getOptions()) === null || _c === void 0 ? void 0 : _c.primaryKey) === null || _d === void 0 ? void 0 : _d.keyFields;
216
+ const keys = table.getOptions()?.primaryKey?.keyFields;
215
217
  const isStructured = arr[0] instanceof types_1.Structure;
216
218
  if (keys !== undefined && isStructured === true) {
217
219
  // console.dir(keys);
@@ -239,7 +241,7 @@ function readTable(table, options) {
239
241
  if (found === undefined) {
240
242
  foundIndex = 0;
241
243
  }
242
- if (found === undefined && ((_e = table.getOptions().primaryKey) === null || _e === void 0 ? void 0 : _e.type) === types_1.TableAccessType.sorted) {
244
+ if (found === undefined && table.getOptions().primaryKey?.type === types_1.TableAccessType.sorted) {
243
245
  binarySubrc = 8;
244
246
  }
245
247
  }
@@ -250,7 +252,7 @@ function readTable(table, options) {
250
252
  if (binarySubrc) {
251
253
  subrc = binarySubrc;
252
254
  }
253
- else if (((options === null || options === void 0 ? void 0 : options.binarySearch) === true || (options === null || options === void 0 ? void 0 : options.keyName) !== undefined)
255
+ else if ((options?.binarySearch === true || options?.keyName !== undefined)
254
256
  && subrc === 4) {
255
257
  subrc = 8;
256
258
  }
@@ -7,7 +7,7 @@ const concatenate_1 = require("./concatenate");
7
7
  function replace(input) {
8
8
  if (input.target instanceof types_1.Table) {
9
9
  for (const row of input.target.array()) {
10
- replace(Object.assign(Object.assign({}, input), { target: row }));
10
+ replace({ ...input, target: row });
11
11
  }
12
12
  return;
13
13
  }
@@ -12,12 +12,12 @@ async function select(target, input, runtimeOptions, context) {
12
12
  // @ts-ignore
13
13
  target = target.getPointer();
14
14
  }
15
- if ((runtimeOptions === null || runtimeOptions === void 0 ? void 0 : runtimeOptions.appending) !== true) {
15
+ if (runtimeOptions?.appending !== true) {
16
16
  if (Array.isArray(target)) {
17
17
  target.forEach(f => f.clear());
18
18
  }
19
19
  else {
20
- target === null || target === void 0 ? void 0 : target.clear();
20
+ target?.clear();
21
21
  }
22
22
  }
23
23
  if (rows.length === 0) {
@@ -41,7 +41,6 @@ async function select(target, input, runtimeOptions, context) {
41
41
  }
42
42
  exports.select = select;
43
43
  function rowsToTarget(target, rows) {
44
- var _a, _b;
45
44
  if (target instanceof types_1.Structure) {
46
45
  const result = {};
47
46
  for (const column in rows[0]) {
@@ -60,11 +59,11 @@ function rowsToTarget(target, rows) {
60
59
  for (let columnName in row) {
61
60
  columnName = columnName.toLowerCase();
62
61
  if (row[columnName] === null) {
63
- (_a = targetRow.get()[columnName]) === null || _a === void 0 ? void 0 : _a.clear();
62
+ targetRow.get()[columnName]?.clear();
64
63
  continue;
65
64
  }
66
65
  // @ts-ignore
67
- (_b = targetRow.get()[columnName]) === null || _b === void 0 ? void 0 : _b.set(row[columnName]);
66
+ targetRow.get()[columnName]?.set(row[columnName]);
68
67
  }
69
68
  }
70
69
  else {
@@ -29,7 +29,7 @@ function setBit(number, hex, val) {
29
29
  }
30
30
  let bits = parseInt(byte, 16);
31
31
  const bitMask = 1 << 8 - (number.get() - (byteNum - 1) * 8);
32
- if ((val === null || val === void 0 ? void 0 : val.get()) === 0 || (val === null || val === void 0 ? void 0 : val.get()) === "0") {
32
+ if (val?.get() === 0 || val?.get() === "0") {
33
33
  bits = bits &= ~bitMask;
34
34
  }
35
35
  else {
@@ -4,7 +4,7 @@ exports.shift = void 0;
4
4
  const compare_1 = require("../compare");
5
5
  const types_1 = require("../types");
6
6
  function shift(target, options) {
7
- if ((options === null || options === void 0 ? void 0 : options.mode) === "BYTE") {
7
+ if (options?.mode === "BYTE") {
8
8
  shift_byte_mode(target, options);
9
9
  }
10
10
  else {
@@ -14,7 +14,7 @@ function shift(target, options) {
14
14
  exports.shift = shift;
15
15
  function shift_character_mode(target, options) {
16
16
  let value = target.get();
17
- if (options === null || options === void 0 ? void 0 : options.deletingLeading) {
17
+ if (options?.deletingLeading) {
18
18
  let leading = options.deletingLeading;
19
19
  if (typeof leading !== "string") {
20
20
  leading = leading.get();
@@ -24,7 +24,7 @@ function shift_character_mode(target, options) {
24
24
  value = value.substr(1);
25
25
  }
26
26
  }
27
- else if (options === null || options === void 0 ? void 0 : options.deletingTrailing) {
27
+ else if (options?.deletingTrailing) {
28
28
  let trailing = options.deletingTrailing;
29
29
  if (typeof trailing !== "string") {
30
30
  trailing = trailing.get();
@@ -35,7 +35,7 @@ function shift_character_mode(target, options) {
35
35
  }
36
36
  }
37
37
  }
38
- else if (options === null || options === void 0 ? void 0 : options.places) {
38
+ else if (options?.places) {
39
39
  const p = options.places.get();
40
40
  if (options.circular) {
41
41
  value = value.substr(p) + value.substr(0, p);
@@ -49,7 +49,7 @@ function shift_character_mode(target, options) {
49
49
  }
50
50
  }
51
51
  }
52
- else if (options === null || options === void 0 ? void 0 : options.to) {
52
+ else if (options?.to) {
53
53
  let to = "";
54
54
  if (typeof options.to === "string") {
55
55
  to = options.to;
@@ -62,7 +62,7 @@ function shift_character_mode(target, options) {
62
62
  value = value.substr(index);
63
63
  }
64
64
  }
65
- else if (options === null || options === void 0 ? void 0 : options.circular) {
65
+ else if (options?.circular) {
66
66
  if (options.direction === "RIGHT") {
67
67
  value = value.substring(value.length - 1, value.length) + value.substring(0, value.length - 1);
68
68
  }
@@ -82,7 +82,7 @@ function shift_character_mode(target, options) {
82
82
  }
83
83
  function shift_byte_mode(target, options) {
84
84
  let value = target.get();
85
- if (options === null || options === void 0 ? void 0 : options.deletingLeading) {
85
+ if (options?.deletingLeading) {
86
86
  let leading = options.deletingLeading;
87
87
  if (typeof leading !== "string") {
88
88
  leading = leading.get();
@@ -92,7 +92,7 @@ function shift_byte_mode(target, options) {
92
92
  value = value.substr(2);
93
93
  }
94
94
  }
95
- else if (options === null || options === void 0 ? void 0 : options.places) {
95
+ else if (options?.places) {
96
96
  const p = options.places.get() * 2;
97
97
  if (options.circular) {
98
98
  value = value.substr(p) + value.substr(0, p);
@@ -101,7 +101,7 @@ function shift_byte_mode(target, options) {
101
101
  value = value.substr(p);
102
102
  }
103
103
  }
104
- else if (options === null || options === void 0 ? void 0 : options.to) {
104
+ else if (options?.to) {
105
105
  let to = "";
106
106
  if (typeof options.to === "string") {
107
107
  to = options.to;
@@ -114,7 +114,7 @@ function shift_byte_mode(target, options) {
114
114
  value = value.substr(index);
115
115
  }
116
116
  }
117
- else if (options === null || options === void 0 ? void 0 : options.circular) {
117
+ else if (options?.circular) {
118
118
  value = value.substr(2) + value.substr(0, 2);
119
119
  }
120
120
  else {
@@ -43,7 +43,6 @@ function compare(a, b, input) {
43
43
  }
44
44
  function sort(input, options) {
45
45
  // console.dir(input);
46
- var _a, _b;
47
46
  if (input instanceof types_1.FieldSymbol) {
48
47
  const pnt = input.getPointer();
49
48
  if (pnt === undefined) {
@@ -52,15 +51,15 @@ function sort(input, options) {
52
51
  sort(pnt, options);
53
52
  return;
54
53
  }
55
- else if ((options === null || options === void 0 ? void 0 : options.skipSortedCheck) !== true
54
+ else if (options?.skipSortedCheck !== true
56
55
  && input instanceof types_1.Table
57
- && ((_b = (_a = input.getOptions()) === null || _a === void 0 ? void 0 : _a.primaryKey) === null || _b === void 0 ? void 0 : _b.type) === types_1.TableAccessType.sorted) {
56
+ && input.getOptions()?.primaryKey?.type === types_1.TableAccessType.sorted) {
58
57
  throw new Error("SORT called on sorted table");
59
58
  }
60
59
  if (input instanceof types_1.HashedTable) {
61
60
  throw new Error("Sort hashed table, ugh?");
62
61
  }
63
- if (options === null || options === void 0 ? void 0 : options.by) {
62
+ if (options?.by) {
64
63
  if (options.by.length === 0) {
65
64
  throw "SortByLengthZero";
66
65
  }
@@ -75,7 +74,7 @@ function sort(input, options) {
75
74
  });
76
75
  }
77
76
  else {
78
- const descending = (options === null || options === void 0 ? void 0 : options.descending) === true;
77
+ const descending = options?.descending === true;
79
78
  input.sort((a, b) => {
80
79
  if ((0, compare_1.eq)(a, b)) {
81
80
  return 0;
@@ -8,13 +8,12 @@ class WriteStatement {
8
8
  this.context = context;
9
9
  }
10
10
  write(source, options) {
11
- var _a, _b;
12
11
  let right = false;
13
- if ((options === null || options === void 0 ? void 0 : options.skipLine) === true) {
12
+ if (options?.skipLine === true) {
14
13
  this.context.console.add("\n");
15
14
  }
16
15
  else {
17
- if ((options === null || options === void 0 ? void 0 : options.newLine) === true && this.context.console.isEmpty() === false) {
16
+ if (options?.newLine === true && this.context.console.isEmpty() === false) {
18
17
  this.context.console.add("\n");
19
18
  }
20
19
  let result = "";
@@ -23,10 +22,10 @@ class WriteStatement {
23
22
  }
24
23
  else if (source instanceof types_1.Structure) {
25
24
  const obj = source.getCharacter();
26
- this.write(obj, Object.assign({}, options));
25
+ this.write(obj, { ...options });
27
26
  }
28
27
  else if (source instanceof types_1.Float) {
29
- if (((_a = options === null || options === void 0 ? void 0 : options.exponent) === null || _a === void 0 ? void 0 : _a.get()) === 0) {
28
+ if (options?.exponent?.get() === 0) {
30
29
  const tens = source.getRaw().toFixed(0).length - 1;
31
30
  if (options.noSign === true && source.getRaw() < 0) {
32
31
  result = source.getRaw().toFixed(17 - tens).replace(".", ",");
@@ -43,7 +42,7 @@ class WriteStatement {
43
42
  else if (source instanceof types_1.Packed) {
44
43
  let num = source.get();
45
44
  let decimals = source.getDecimals();
46
- if (NO_DEICMAL_CURRENCIES.includes(((_b = options === null || options === void 0 ? void 0 : options.currency) === null || _b === void 0 ? void 0 : _b.get().trimEnd()) || "")) {
45
+ if (NO_DEICMAL_CURRENCIES.includes(options?.currency?.get().trimEnd() || "")) {
47
46
  // todo, more work needed here,
48
47
  num = num * 100;
49
48
  decimals = 0;
@@ -54,10 +53,10 @@ class WriteStatement {
54
53
  else {
55
54
  result = source.get().toString();
56
55
  }
57
- if ((options === null || options === void 0 ? void 0 : options.noSign) === true) {
56
+ if (options?.noSign === true) {
58
57
  result = result.replace("-", "");
59
58
  }
60
- if (options === null || options === void 0 ? void 0 : options.target) {
59
+ if (options?.target) {
61
60
  if (right === true) {
62
61
  const len = options.target.get().length;
63
62
  options.target.set(" ".repeat(len - result.length) + result);
@@ -30,7 +30,7 @@ function templateFormatting(source, options) {
30
30
  }
31
31
  else if (source instanceof types_1.Float) {
32
32
  const raw = source.getRaw();
33
- if ((options === null || options === void 0 ? void 0 : options.style) === "scientific") {
33
+ if (options?.style === "scientific") {
34
34
  text = raw.toExponential().toUpperCase();
35
35
  text = text.replace(/([+-])(\d)$/, "$10$2");
36
36
  }
@@ -42,7 +42,7 @@ function templateFormatting(source, options) {
42
42
  }
43
43
  }
44
44
  else if (source instanceof types_1.Packed) {
45
- if (options === null || options === void 0 ? void 0 : options.decimals) {
45
+ if (options?.decimals) {
46
46
  text = source.get().toFixed(options.decimals);
47
47
  }
48
48
  else {
@@ -4,8 +4,8 @@ exports.ABAPObject = void 0;
4
4
  const field_symbol_1 = require("./field_symbol");
5
5
  class ABAPObject {
6
6
  constructor(input) {
7
- this.qualifiedName = input === null || input === void 0 ? void 0 : input.qualifiedName;
8
- this.RTTIName = input === null || input === void 0 ? void 0 : input.RTTIName;
7
+ this.qualifiedName = input?.qualifiedName;
8
+ this.RTTIName = input?.RTTIName;
9
9
  this.clear();
10
10
  }
11
11
  get() {
@@ -58,16 +58,13 @@ class Character {
58
58
  return this;
59
59
  }
60
60
  getQualifiedName() {
61
- var _a;
62
- return (_a = this.extra) === null || _a === void 0 ? void 0 : _a.qualifiedName;
61
+ return this.extra?.qualifiedName;
63
62
  }
64
63
  getConversionExit() {
65
- var _a;
66
- return (_a = this.extra) === null || _a === void 0 ? void 0 : _a.conversionExit;
64
+ return this.extra?.conversionExit;
67
65
  }
68
66
  getDDICName() {
69
- var _a;
70
- return (_a = this.extra) === null || _a === void 0 ? void 0 : _a.ddicName;
67
+ return this.extra?.ddicName;
71
68
  }
72
69
  getLength() {
73
70
  return this.length;
@@ -87,11 +84,11 @@ class Character {
87
84
  }
88
85
  }
89
86
  getOffset(input) {
90
- let offset = input === null || input === void 0 ? void 0 : input.offset;
87
+ let offset = input?.offset;
91
88
  if (offset) {
92
89
  offset = (0, _parse_1.parse)(offset);
93
90
  }
94
- let length = input === null || input === void 0 ? void 0 : input.length;
91
+ let length = input?.length;
95
92
  if (length) {
96
93
  length = (0, _parse_1.parse)(length);
97
94
  }
@@ -6,7 +6,8 @@ import { String } from "./string";
6
6
  import { Structure } from "./structure";
7
7
  import { Float } from "./float";
8
8
  import { Hex } from "./hex";
9
- type PointerType = INumeric | Table | ICharacter | ABAPObject | undefined | Structure | Float;
9
+ import { Integer8 } from "./integer8";
10
+ type PointerType = INumeric | Table | ICharacter | ABAPObject | Integer8 | undefined | Structure | Float;
10
11
  export declare class DataReference {
11
12
  private pointer;
12
13
  private readonly type;
@@ -20,7 +21,7 @@ export declare class DataReference {
20
21
  get(): any;
21
22
  array(): any;
22
23
  getArrayLength(): any;
23
- set(value: any): void | Float | ABAPObject | this | Table | Structure;
24
+ set(value: any): void | Float | Integer8 | ABAPObject | this | Table | Structure;
24
25
  getOffset(input: {
25
26
  offset?: number | INumeric | Hex;
26
27
  length?: number | INumeric | Hex;
@@ -30,25 +30,21 @@ class DataReference {
30
30
  // return this.pointer?.clear();
31
31
  }
32
32
  get() {
33
- var _a;
34
33
  if (this.pointer === this) {
35
34
  throw "Cyclic data reference";
36
35
  }
37
36
  // @ts-ignore
38
- return (_a = this.pointer) === null || _a === void 0 ? void 0 : _a.get();
37
+ return this.pointer?.get();
39
38
  }
40
39
  array() {
41
- var _a;
42
40
  // @ts-ignore
43
- return (_a = this.pointer) === null || _a === void 0 ? void 0 : _a.array();
41
+ return this.pointer?.array();
44
42
  }
45
43
  getArrayLength() {
46
- var _a;
47
44
  // @ts-ignore
48
- return (_a = this.pointer) === null || _a === void 0 ? void 0 : _a.getArrayLength();
45
+ return this.pointer?.getArrayLength();
49
46
  }
50
47
  set(value) {
51
- var _a;
52
48
  if (value instanceof DataReference) {
53
49
  this.pointer = value.getPointer();
54
50
  return this;
@@ -66,23 +62,23 @@ class DataReference {
66
62
  }
67
63
  }
68
64
  else {
69
- return (_a = this.pointer) === null || _a === void 0 ? void 0 : _a.set(value);
65
+ return this.pointer?.set(value);
70
66
  }
71
67
  return this;
72
68
  }
73
69
  getOffset(input) {
74
- if (input === null || input === void 0 ? void 0 : input.offset) {
70
+ if (input?.offset) {
75
71
  input.offset = (0, _parse_1.parse)(input.offset);
76
72
  }
77
- if (input === null || input === void 0 ? void 0 : input.length) {
73
+ if (input?.length) {
78
74
  input.length = (0, _parse_1.parse)(input.length);
79
75
  }
80
76
  // Assuming we're interested in Strings here, for now...
81
77
  let ret = this.get();
82
- if (input === null || input === void 0 ? void 0 : input.offset) {
78
+ if (input?.offset) {
83
79
  ret = ret.substr(input.offset);
84
80
  }
85
- if ((input === null || input === void 0 ? void 0 : input.length) !== undefined) {
81
+ if (input?.length !== undefined) {
86
82
  ret = ret.substr(0, input.length);
87
83
  }
88
84
  const r = new string_1.String();
@@ -8,7 +8,7 @@ const _parse_1 = require("../operators/_parse");
8
8
  class Date {
9
9
  constructor(input) {
10
10
  this.clear();
11
- this.qualifiedName = input === null || input === void 0 ? void 0 : input.qualifiedName;
11
+ this.qualifiedName = input?.qualifiedName;
12
12
  }
13
13
  getQualifiedName() {
14
14
  return this.qualifiedName;
@@ -49,18 +49,18 @@ class Date {
49
49
  return (0, _date_helper_1.getNumberFromDate)(this.value);
50
50
  }
51
51
  getOffset(input) {
52
- if (input === null || input === void 0 ? void 0 : input.offset) {
52
+ if (input?.offset) {
53
53
  input.offset = (0, _parse_1.parse)(input.offset);
54
54
  }
55
- if (input === null || input === void 0 ? void 0 : input.length) {
55
+ if (input?.length) {
56
56
  input.length = (0, _parse_1.parse)(input.length);
57
57
  }
58
58
  let ret = this.value;
59
- if (input === null || input === void 0 ? void 0 : input.offset) {
59
+ if (input?.offset) {
60
60
  // @ts-ignore
61
61
  ret = ret.substr(input.offset);
62
62
  }
63
- if ((input === null || input === void 0 ? void 0 : input.length) !== undefined) {
63
+ if (input?.length !== undefined) {
64
64
  // @ts-ignore
65
65
  ret = ret.substr(0, input.length);
66
66
  }
@@ -17,7 +17,7 @@ export declare class FieldSymbol {
17
17
  unassign(): void;
18
18
  isAssigned(): boolean;
19
19
  getPointer(): any;
20
- dereference(): INumeric | Float | ICharacter | ABAPObject | Table | Structure | undefined;
20
+ dereference(): INumeric | ICharacter | Float | import("./integer8").Integer8 | ABAPObject | Table | Structure | undefined;
21
21
  clear(): void | Structure | undefined;
22
22
  get(): any;
23
23
  appendInitial(): import("./table").TableRowType | undefined;
@@ -45,11 +45,9 @@ class FieldSymbol {
45
45
  }
46
46
  ///////////////
47
47
  clear() {
48
- var _a;
49
- return (_a = this.pointer) === null || _a === void 0 ? void 0 : _a.clear();
48
+ return this.pointer?.clear();
50
49
  }
51
50
  get() {
52
- var _a, _b, _c;
53
51
  if (this.casting) {
54
52
  if (this.type instanceof hex_1.Hex) {
55
53
  const pt = this.pointer;
@@ -61,19 +59,19 @@ class FieldSymbol {
61
59
  }
62
60
  else {
63
61
  // @ts-ignore
64
- const ret = new string_1.String().set(Buffer.from((_a = this.pointer) === null || _a === void 0 ? void 0 : _a.get(), "utf16le").toString("hex"));
62
+ const ret = new string_1.String().set(Buffer.from(this.pointer?.get(), "utf16le").toString("hex"));
65
63
  return ret.get();
66
64
  }
67
65
  }
68
66
  else {
69
67
  // @ts-ignore
70
- const ret = new string_1.String().set(Buffer.from((_b = this.pointer) === null || _b === void 0 ? void 0 : _b.get(), "hex").toString("utf16le"));
68
+ const ret = new string_1.String().set(Buffer.from(this.pointer?.get(), "hex").toString("utf16le"));
71
69
  return ret.get();
72
70
  }
73
71
  }
74
72
  else {
75
73
  // @ts-ignore
76
- return (_c = this.pointer) === null || _c === void 0 ? void 0 : _c.get();
74
+ return this.pointer?.get();
77
75
  }
78
76
  }
79
77
  appendInitial() {
@@ -83,18 +81,15 @@ class FieldSymbol {
83
81
  return undefined;
84
82
  }
85
83
  array() {
86
- var _a;
87
84
  // @ts-ignore
88
- return (_a = this.pointer) === null || _a === void 0 ? void 0 : _a.array();
85
+ return this.pointer?.array();
89
86
  }
90
87
  getArrayLength() {
91
- var _a;
92
88
  // @ts-ignore
93
- return (_a = this.pointer) === null || _a === void 0 ? void 0 : _a.getArrayLength();
89
+ return this.pointer?.getArrayLength();
94
90
  }
95
91
  set(value) {
96
- var _a;
97
- (_a = this.pointer) === null || _a === void 0 ? void 0 : _a.set(value);
92
+ this.pointer?.set(value);
98
93
  return this;
99
94
  }
100
95
  getOffset(input) {
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Float = void 0;
4
4
  const hex_1 = require("./hex");
5
5
  const xstring_1 = require("./xstring");
6
+ const integer8_1 = require("./integer8");
6
7
  /*
7
8
  function getNumberParts(x: number) {
8
9
  if(isNaN(x)) {
@@ -21,7 +22,7 @@ function getNumberParts(x: number) {
21
22
  class Float {
22
23
  constructor(input) {
23
24
  this.value = 0;
24
- this.qualifiedName = input === null || input === void 0 ? void 0 : input.qualifiedName;
25
+ this.qualifiedName = input?.qualifiedName;
25
26
  }
26
27
  getQualifiedName() {
27
28
  return this.qualifiedName;
@@ -36,6 +37,9 @@ class Float {
36
37
  else if (typeof value === "string") {
37
38
  this.value = parseFloat(value);
38
39
  }
40
+ else if (value instanceof integer8_1.Integer8) {
41
+ this.value = Number(value.get());
42
+ }
39
43
  else if (value instanceof Float) {
40
44
  this.value = value.getRaw();
41
45
  }