@abaplint/runtime 1.8.20 → 1.8.23

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.
@@ -55,14 +55,20 @@ function eq(left, right) {
55
55
  return true;
56
56
  }
57
57
  let l = undefined;
58
- if (typeof left === "object") {
58
+ if (left instanceof types_1.Character) {
59
+ l = left.get().trimEnd();
60
+ }
61
+ else if (typeof left === "object") {
59
62
  l = left.get();
60
63
  }
61
64
  else {
62
65
  l = left;
63
66
  }
64
67
  let r = undefined;
65
- if (typeof right === "object") {
68
+ if (right instanceof types_1.Character) {
69
+ r = right.get().trimEnd();
70
+ }
71
+ else if (typeof right === "object") {
66
72
  r = right.get();
67
73
  }
68
74
  else {
@@ -3,4 +3,5 @@ export declare class Console {
3
3
  clear(): void;
4
4
  add(data: string): void;
5
5
  get(): string;
6
+ getTrimmed(): string;
6
7
  }
@@ -14,6 +14,9 @@ class Console {
14
14
  get() {
15
15
  return this.data;
16
16
  }
17
+ getTrimmed() {
18
+ return this.data.split("\n").map(a => a.trimEnd()).join("\n");
19
+ }
17
20
  }
18
21
  exports.Console = Console;
19
22
  //# sourceMappingURL=console.js.map
@@ -69,6 +69,9 @@ class OffsetLength {
69
69
  old = old.substr(0, this.offset) + val;
70
70
  }
71
71
  old = old.trimEnd();
72
+ if (this.obj instanceof types_1.Character) {
73
+ old = old.padEnd(this.obj.getLength(), " ");
74
+ }
72
75
  this.obj.set(old);
73
76
  }
74
77
  }
@@ -13,7 +13,7 @@ function templateFormatting(source, options) {
13
13
  text = text.substr(0, 2) + ":" + text.substr(2, 2) + ":" + text.substr(4, 2);
14
14
  }
15
15
  if (options.width) {
16
- text = text.padEnd(options.width, " ");
16
+ text = text.trimEnd().padEnd(options.width, " ");
17
17
  }
18
18
  return text;
19
19
  }
@@ -1,5 +1,4 @@
1
1
  import { ICharacter } from "./_character";
2
- import { String } from "./string";
3
2
  export declare class Character implements ICharacter {
4
3
  private value;
5
4
  private readonly length;
@@ -16,5 +15,5 @@ export declare class Character implements ICharacter {
16
15
  getOffset(input: {
17
16
  offset?: number;
18
17
  length?: number;
19
- }): String;
18
+ }): Character;
20
19
  }
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Character = void 0;
4
- const string_1 = require("./string");
5
4
  class Character {
6
5
  constructor(input) {
7
6
  this.value = "";
@@ -40,7 +39,7 @@ class Character {
40
39
  if ((input === null || input === void 0 ? void 0 : input.length) !== undefined) {
41
40
  ret = ret.substr(0, input.length);
42
41
  }
43
- const r = new string_1.String();
42
+ const r = new Character({ length: ret.length });
44
43
  r.set(ret);
45
44
  return r;
46
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "1.8.20",
3
+ "version": "1.8.23",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",