@abaplint/runtime 2.1.44 → 2.1.47

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.
@@ -0,0 +1,2 @@
1
+ import { Table } from "./types";
2
+ export declare function expandIN(fieldName: string, table: Table): string;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.expandIN = void 0;
4
+ // note: must always return an expression, never return empty string
5
+ function expandIN(fieldName, table) {
6
+ var _a, _b, _c;
7
+ let ret = "";
8
+ if (table.array().length === 0) {
9
+ ret = fieldName + " NOT IN ()";
10
+ }
11
+ else {
12
+ ret = fieldName + " IN (";
13
+ const values = [];
14
+ for (const row of table.array()) {
15
+ if (((_a = row.get().sign) === null || _a === void 0 ? void 0 : _a.get()) !== "I" || ((_b = row.get().option) === null || _b === void 0 ? void 0 : _b.get()) !== "EQ") {
16
+ throw "Error: IN, only I EQ supported for now";
17
+ }
18
+ values.push("'" + ((_c = row.get().low) === null || _c === void 0 ? void 0 : _c.get().replace(/'/g, "''")) + "'");
19
+ }
20
+ ret += values.join(",") + ")";
21
+ }
22
+ return ret;
23
+ }
24
+ exports.expandIN = expandIN;
25
+ //# sourceMappingURL=expand_in.js.map
@@ -10,6 +10,7 @@ import * as DB from "./db/db";
10
10
  import * as operators from "./operators";
11
11
  import * as RFC from "./rfc";
12
12
  import * as types from "./types";
13
+ import { expandIN } from "./expand_in";
13
14
  export { UnitTestResult, RFC, types, DB };
14
15
  export declare class ABAP {
15
16
  FunctionModules: {
@@ -32,6 +33,7 @@ export declare class ABAP {
32
33
  readonly console: Console;
33
34
  OffsetLength: typeof OffsetLength;
34
35
  templateFormatting: typeof templateFormatting;
36
+ expandIN: typeof expandIN;
35
37
  readonly context: Context;
36
38
  constructor();
37
39
  }
@@ -17,6 +17,7 @@ const RFC = require("./rfc");
17
17
  exports.RFC = RFC;
18
18
  const types = require("./types");
19
19
  exports.types = types;
20
+ const expand_in_1 = require("./expand_in");
20
21
  class ABAP {
21
22
  constructor() {
22
23
  // global objects
@@ -30,6 +31,7 @@ class ABAP {
30
31
  this.compare = compare;
31
32
  this.OffsetLength = offset_length_1.OffsetLength;
32
33
  this.templateFormatting = template_formatting_1.templateFormatting;
34
+ this.expandIN = expand_in_1.expandIN;
33
35
  this.context = new context_1.Context();
34
36
  this.console = new console_1.Console();
35
37
  this.context.console = this.console;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.1.44",
3
+ "version": "2.1.47",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",