@abaplint/runtime 2.8.26 → 2.8.27

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.
@@ -131,45 +131,43 @@ class HashedTable {
131
131
  }
132
132
  buildHashFromSimple(data) {
133
133
  let hash = "";
134
- const ttyp = this.getRowType();
134
+ const tableRowType = this.getRowType();
135
135
  for (const k of this.options.primaryKey.keyFields) {
136
136
  let val = data[k.toLowerCase()];
137
- if (val instanceof structure_1.Structure) {
138
- val = val.getCharacter();
137
+ // convert to correct type, eg Chars have specific length, or rounding,
138
+ if (k === "TABLE_LINE") {
139
+ const row = (0, clone_1.clone)(tableRowType);
140
+ row.set(val.get());
141
+ val = row.get();
139
142
  }
140
- else {
141
- // convert to correct type, eg Chars have specific length, or rounding,
142
- if (k === "TABLE_LINE") {
143
- const rowType = (0, clone_1.clone)(ttyp);
144
- rowType.set(val.get());
145
- val = rowType.get();
143
+ else if (tableRowType instanceof structure_1.Structure) {
144
+ const field = tableRowType.get()[k.toLowerCase()];
145
+ // if types match, there is no need to clone
146
+ if (field instanceof string_1.String && val instanceof string_1.String) {
147
+ val = val.get();
148
+ }
149
+ else if (field instanceof character_1.Character && val instanceof character_1.Character && field.getLength() === val.getLength()) {
150
+ val = val.get();
151
+ }
152
+ else if (field instanceof hex_1.Hex && val instanceof hex_1.Hex && field.getLength() === val.getLength()) {
153
+ val = val.get();
154
+ }
155
+ else if (field instanceof hex_uint8_1.HexUInt8 && val instanceof hex_uint8_1.HexUInt8 && field.getLength() === val.getLength()) {
156
+ val = val.get();
146
157
  }
147
- else if (ttyp instanceof structure_1.Structure) {
148
- const field = ttyp.get()[k.toLowerCase()];
149
- // if types match, there is no need to clone
150
- if (field instanceof string_1.String && val instanceof string_1.String) {
151
- val = val.get();
152
- }
153
- else if (field instanceof character_1.Character && val instanceof character_1.Character && field.getLength() === val.getLength()) {
154
- val = val.get();
155
- }
156
- else if (field instanceof hex_1.Hex && val instanceof hex_1.Hex && field.getLength() === val.getLength()) {
157
- val = val.get();
158
- }
159
- else if (field instanceof hex_uint8_1.HexUInt8 && val instanceof hex_uint8_1.HexUInt8 && field.getLength() === val.getLength()) {
160
- val = val.get();
161
- }
162
- else {
163
- // convert
164
- const rowType = (0, clone_1.clone)(field);
165
- rowType.set(val.get());
166
- val = rowType.get();
167
- }
158
+ else if (val instanceof structure_1.Structure) {
159
+ val = val.getCharacter();
168
160
  }
169
161
  else {
170
- throw new Error("HashedTable, buildHashFromSimple, unexpected type");
162
+ // convert
163
+ const row = (0, clone_1.clone)(field);
164
+ row.set(val.get());
165
+ val = row.get();
171
166
  }
172
167
  }
168
+ else {
169
+ throw new Error("HashedTable, buildHashFromSimple, unexpected type");
170
+ }
173
171
  hash += k + ":" + val + "|";
174
172
  }
175
173
  return hash;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.8.26",
3
+ "version": "2.8.27",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",