@abaplint/runtime 2.5.58 → 2.5.59
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.
|
@@ -31,7 +31,7 @@ interface ITable {
|
|
|
31
31
|
getRowType(): TableRowType;
|
|
32
32
|
getLength(): number;
|
|
33
33
|
clear(): void;
|
|
34
|
-
set(tab: Table | TableRowType): ITable;
|
|
34
|
+
set(tab: Table | HashedTable | TableRowType): ITable;
|
|
35
35
|
getHeader(): TableRowType;
|
|
36
36
|
}
|
|
37
37
|
export declare class TableFactory {
|
|
@@ -64,7 +64,7 @@ export declare class HashedTable implements ITable {
|
|
|
64
64
|
getOptions(): ITableOptions;
|
|
65
65
|
getRowType(): TableRowType;
|
|
66
66
|
clear(): void;
|
|
67
|
-
set(
|
|
67
|
+
set(tab: TableRowType): ITable;
|
|
68
68
|
getHeader(): TableRowType;
|
|
69
69
|
private getValue;
|
|
70
70
|
}
|
package/build/src/types/table.js
CHANGED
|
@@ -91,8 +91,19 @@ class HashedTable {
|
|
|
91
91
|
}
|
|
92
92
|
let hash = "";
|
|
93
93
|
for (const k of this.options.primaryKey.keyFields) {
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
if (k === "TABLE_LINE") {
|
|
95
|
+
if (data instanceof structure_1.Structure) {
|
|
96
|
+
hash += k + ":" + data.getCharacter();
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
// @ts-ignore
|
|
100
|
+
hash += k + ":" + data.get();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
// @ts-ignore
|
|
105
|
+
hash += k + ":" + data.get()[k.toLowerCase()].get();
|
|
106
|
+
}
|
|
96
107
|
}
|
|
97
108
|
if (this.value[hash] !== undefined) {
|
|
98
109
|
return { value: undefined, subrc: 4 };
|
|
@@ -137,8 +148,17 @@ class HashedTable {
|
|
|
137
148
|
clear() {
|
|
138
149
|
this.value = {};
|
|
139
150
|
}
|
|
140
|
-
set(
|
|
141
|
-
|
|
151
|
+
set(tab) {
|
|
152
|
+
this.clear();
|
|
153
|
+
if (tab instanceof Table || tab instanceof HashedTable) {
|
|
154
|
+
for (const a of tab.array()) {
|
|
155
|
+
this.insert(a);
|
|
156
|
+
}
|
|
157
|
+
return this;
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
throw new Error("Method not implemented, set hashed table");
|
|
161
|
+
}
|
|
142
162
|
}
|
|
143
163
|
getHeader() {
|
|
144
164
|
if (this.header === undefined) {
|