@abaplint/runtime 2.6.6 → 2.6.8

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.
@@ -1,9 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.substring_before = void 0;
4
+ const types_1 = require("../types");
4
5
  const string_1 = require("../types/string");
5
6
  function substring_before(input) {
6
- const val = typeof input.val === "string" ? input.val : input.val.get();
7
+ let val = "";
8
+ if (typeof input.val === "string") {
9
+ val = input.val;
10
+ }
11
+ else if (input.val instanceof types_1.Character) {
12
+ val = input.val.getTrimEnd();
13
+ }
14
+ else {
15
+ val = input.val.get();
16
+ }
7
17
  let reg = "";
8
18
  if (typeof input.regex === "string") {
9
19
  reg = input.regex;
@@ -24,7 +24,7 @@ function cp(left, right) {
24
24
  r = right.toString();
25
25
  }
26
26
  else {
27
- r = right.get().toString();
27
+ r = right.get().toString().trimEnd();
28
28
  }
29
29
  r = r.replace(/\\/g, "\\\\");
30
30
  r = r.replace(/\[/g, "\\[");
@@ -34,7 +34,7 @@ class String {
34
34
  this.value = value.getTrimEnd();
35
35
  }
36
36
  else if (value instanceof structure_1.Structure) {
37
- this.value = value.getCharacter();
37
+ this.value = value.getCharacter().trimEnd();
38
38
  }
39
39
  else if (value instanceof packed_1.Packed) {
40
40
  const lv_sign = value.get() >= 0 ? " " : "-";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.6.6",
3
+ "version": "2.6.8",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",