@abaplint/runtime 2.6.18 → 2.6.20

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,7 +1,8 @@
1
+ import { Table } from "../types";
1
2
  import { ICharacter } from "../types/_character";
2
3
  import { INumeric } from "../types/_numeric";
3
4
  export type replaceInput = {
4
- target: ICharacter;
5
+ target: ICharacter | Table;
5
6
  sectionLength?: INumeric;
6
7
  sectionOffset?: INumeric;
7
8
  regex?: ICharacter;
@@ -5,6 +5,12 @@ const abap_regex_1 = require("../abap_regex");
5
5
  const offset_length_1 = require("../offset_length");
6
6
  const types_1 = require("../types");
7
7
  function replace(input) {
8
+ if (input.target instanceof types_1.Table) {
9
+ for (const row of input.target.array()) {
10
+ replace(Object.assign(Object.assign({}, input), { target: row }));
11
+ }
12
+ return;
13
+ }
8
14
  let temp = input.target.get();
9
15
  const ignoreCase = input.ignoringCase === true ? "i" : "";
10
16
  const allOccurrences = input.all === true ? "g" : "";
@@ -36,22 +42,22 @@ function replace(input) {
36
42
  else {
37
43
  throw "REPLACE, unexpected input";
38
44
  }
39
- let replace = "";
45
+ let rr = "";
40
46
  if (typeof input.with === "string") {
41
- replace = input.with;
47
+ rr = input.with;
42
48
  }
43
49
  else {
44
50
  if (input.with instanceof types_1.Character) {
45
- replace = input.with.getTrimEnd();
51
+ rr = input.with.getTrimEnd();
46
52
  }
47
53
  else {
48
- replace = input.with.get();
54
+ rr = input.with.get();
49
55
  }
50
- replace = replace.replace(/\\\$/g, "$");
51
- replace = replace.replace(/\\\{/g, "{");
52
- replace = replace.replace(/\\\}/g, "}");
56
+ rr = rr.replace(/\\\$/g, "$");
57
+ rr = rr.replace(/\\\{/g, "{");
58
+ rr = rr.replace(/\\\}/g, "}");
53
59
  }
54
- temp = temp.replace(search, replace);
60
+ temp = temp.replace(search, rr);
55
61
  const subrc = found ? 0 : 4;
56
62
  // @ts-ignore
57
63
  abap.builtin.sy.get().subrc.set(subrc);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.6.18",
3
+ "version": "2.6.20",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",