@abaplint/runtime 2.6.5 → 2.6.7

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;
@@ -5,7 +5,7 @@ const throw_error_1 = require("../throw_error");
5
5
  const float_1 = require("./float");
6
6
  const hex_1 = require("./hex");
7
7
  const xstring_1 = require("./xstring");
8
- const digits = new RegExp(/^\s*-?\+?\d+\.?\d*$/i);
8
+ const digits = new RegExp(/^\s*-?\+?\d+\.?\d* *$/i);
9
9
  class Integer {
10
10
  constructor(input) {
11
11
  this.value = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.6.5",
3
+ "version": "2.6.7",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",