@abaplint/runtime 1.8.30 → 1.8.33

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.
@@ -47,15 +47,17 @@ function find(input, options) {
47
47
  }
48
48
  const matches = [];
49
49
  if (input instanceof types_1.Table) {
50
+ let line = 1;
50
51
  for (const blah of input.array()) {
51
52
  let temp;
52
53
  // eslint-disable-next-line no-cond-assign
53
54
  while (temp = s.exec(blah.get())) {
54
- matches.push(temp);
55
+ matches.push(Object.assign(Object.assign({}, temp), { line }));
55
56
  if (options.first === true) {
56
57
  break;
57
58
  }
58
59
  }
60
+ line++;
59
61
  }
60
62
  }
61
63
  else {
@@ -92,7 +94,7 @@ function find(input, options) {
92
94
  length: new types_1.Integer(),
93
95
  submatches: new types_1.Table(new types_1.Structure({ offset: new types_1.Integer(), length: new types_1.Integer() })),
94
96
  });
95
- match.get().line.set(0); // todo
97
+ match.get().line.set(m.line || 0);
96
98
  match.get().offset.set(m.index);
97
99
  match.get().length.set(m[0].length);
98
100
  const submatch = new types_1.Structure({ offset: new types_1.Integer(), length: new types_1.Integer() });
@@ -4,6 +4,7 @@ declare type options = {
4
4
  timestamp?: string;
5
5
  date?: string;
6
6
  time?: string;
7
+ pad?: string;
7
8
  width?: number;
8
9
  decimals?: number;
9
10
  };
@@ -13,7 +13,10 @@ function templateFormatting(source, options) {
13
13
  if (options.time === "iso") {
14
14
  text = text.substr(0, 2) + ":" + text.substr(2, 2) + ":" + text.substr(4, 2);
15
15
  }
16
- if (options.width) {
16
+ if (options.width && options.pad) {
17
+ text = text.trimEnd().padEnd(options.width, options.pad);
18
+ }
19
+ else if (options.width) {
17
20
  text = text.trimEnd().padEnd(options.width, " ");
18
21
  }
19
22
  else if (options.decimals && source instanceof types_1.Integer) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "1.8.30",
3
+ "version": "1.8.33",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",
@@ -27,7 +27,6 @@
27
27
  "author": "abaplint",
28
28
  "license": "MIT",
29
29
  "dependencies": {
30
- "hdb": "^0.19.1",
31
30
  "sql.js": "^1.6.2"
32
31
  },
33
32
  "devDependencies": {