@abaplint/runtime 2.7.157 → 2.7.159
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.
|
@@ -57,6 +57,9 @@ function replace(input) {
|
|
|
57
57
|
input.val.getOffset({ offset: offset + length }).get();
|
|
58
58
|
}
|
|
59
59
|
else if (input.occ === undefined && sub && wi !== undefined) {
|
|
60
|
+
if (typeof sub === "string") {
|
|
61
|
+
sub = new RegExp(sub);
|
|
62
|
+
}
|
|
60
63
|
val = val.replace(sub, wi);
|
|
61
64
|
}
|
|
62
65
|
else if (input.occ && input.occ.get() === 0 && sub && wi !== undefined) {
|
|
@@ -3,8 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.concatenate = void 0;
|
|
4
4
|
const types_1 = require("../types");
|
|
5
5
|
function concatenate(input) {
|
|
6
|
-
|
|
6
|
+
let sep = "";
|
|
7
|
+
if (input.separatedBy) {
|
|
8
|
+
if (typeof input.separatedBy === "string" || typeof input.separatedBy === "number") {
|
|
9
|
+
sep = input.separatedBy.toString();
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
sep = input.separatedBy.get().toString();
|
|
13
|
+
}
|
|
14
|
+
}
|
|
7
15
|
if (input.lines === true) {
|
|
16
|
+
const list = [];
|
|
8
17
|
const tab = input.source[0];
|
|
9
18
|
if (tab instanceof types_1.Table) {
|
|
10
19
|
for (const l of tab.array()) {
|
|
@@ -16,12 +25,14 @@ function concatenate(input) {
|
|
|
16
25
|
}
|
|
17
26
|
}
|
|
18
27
|
}
|
|
28
|
+
input.target.set(list.join(sep));
|
|
19
29
|
}
|
|
20
30
|
else {
|
|
31
|
+
let result = "";
|
|
21
32
|
for (const source of input.source) {
|
|
22
33
|
let val = "";
|
|
23
34
|
if (source instanceof types_1.Table) {
|
|
24
|
-
throw new Error("concatenate, error input is table");
|
|
35
|
+
throw new Error("concatenate, error: input is table");
|
|
25
36
|
}
|
|
26
37
|
else if (typeof source === "string" || typeof source === "number") {
|
|
27
38
|
val = source.toString();
|
|
@@ -37,19 +48,13 @@ function concatenate(input) {
|
|
|
37
48
|
else {
|
|
38
49
|
val = source.get().toString();
|
|
39
50
|
}
|
|
40
|
-
|
|
51
|
+
result += val + sep;
|
|
41
52
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (input.separatedBy) {
|
|
45
|
-
if (typeof input.separatedBy === "string" || typeof input.separatedBy === "number") {
|
|
46
|
-
sep = input.separatedBy.toString();
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
sep = input.separatedBy.get().toString();
|
|
53
|
+
if (result.length > 0) {
|
|
54
|
+
result = result.slice(0, result.length - sep.length);
|
|
50
55
|
}
|
|
56
|
+
input.target.set(result);
|
|
51
57
|
}
|
|
52
|
-
input.target.set(list.join(sep));
|
|
53
58
|
}
|
|
54
59
|
exports.concatenate = concatenate;
|
|
55
60
|
//# sourceMappingURL=concatenate.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/runtime",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.159",
|
|
4
4
|
"description": "Transpiler - Runtime",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/src/index.d.ts",
|
|
@@ -37,6 +37,6 @@
|
|
|
37
37
|
"typescript": "^5.3.3"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"temporal-polyfill": "^0.2.
|
|
40
|
+
"temporal-polyfill": "^0.2.2"
|
|
41
41
|
}
|
|
42
42
|
}
|