@abaplint/runtime 2.10.18 → 2.10.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.
@@ -0,0 +1,9 @@
1
+ import { String } from "../types";
2
+ import { ICharacter } from "../types/_character";
3
+ import { INumeric } from "../types/_numeric";
4
+ export declare function from_mixed(input: {
5
+ val: ICharacter | string;
6
+ sep?: ICharacter | string;
7
+ case?: ICharacter | string;
8
+ min?: INumeric | number;
9
+ }): String;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.from_mixed = from_mixed;
4
+ /* eslint-disable @typescript-eslint/ban-types */
5
+ const throw_error_1 = require("../throw_error");
6
+ const types_1 = require("../types");
7
+ function from_mixed(input) {
8
+ let sep = input.sep;
9
+ if (sep === undefined) {
10
+ sep = "_";
11
+ }
12
+ if (typeof sep !== "string") {
13
+ sep = sep.get();
14
+ }
15
+ if (sep.length === 0) {
16
+ (0, throw_error_1.throwError)("CX_SY_STRG_PAR_VAL");
17
+ }
18
+ const min = 1;
19
+ if (min < 0) {
20
+ (0, throw_error_1.throwError)("CX_SY_STRG_PAR_VAL");
21
+ }
22
+ let val = input.val;
23
+ if (typeof val !== "string") {
24
+ val = val.get();
25
+ }
26
+ // todo: handle "case" and "min" ?
27
+ const regex = new RegExp(/([A-Z])/, "g");
28
+ val = val.substring(0, 1) + val.substring(1).replace(regex, "_$1");
29
+ return new types_1.String().set(val.toUpperCase());
30
+ }
31
+ //# sourceMappingURL=from_mixed.js.map
@@ -12,6 +12,7 @@ export * from "./escape";
12
12
  export * from "./find";
13
13
  export * from "./floor";
14
14
  export * from "./frac";
15
+ export * from "./from_mixed";
15
16
  export * from "./insert";
16
17
  export * from "./ipow";
17
18
  export * from "./lines";
@@ -25,8 +26,8 @@ export * from "./replace";
25
26
  export * from "./reverse";
26
27
  export * from "./round";
27
28
  export * from "./segment";
28
- export * from "./shift_right";
29
29
  export * from "./shift_left";
30
+ export * from "./shift_right";
30
31
  export * from "./sign";
31
32
  export * from "./sin";
32
33
  export * from "./sqrt";
@@ -29,6 +29,7 @@ __exportStar(require("./escape"), exports);
29
29
  __exportStar(require("./find"), exports);
30
30
  __exportStar(require("./floor"), exports);
31
31
  __exportStar(require("./frac"), exports);
32
+ __exportStar(require("./from_mixed"), exports);
32
33
  __exportStar(require("./insert"), exports);
33
34
  __exportStar(require("./ipow"), exports);
34
35
  __exportStar(require("./lines"), exports);
@@ -42,8 +43,8 @@ __exportStar(require("./replace"), exports);
42
43
  __exportStar(require("./reverse"), exports);
43
44
  __exportStar(require("./round"), exports);
44
45
  __exportStar(require("./segment"), exports);
45
- __exportStar(require("./shift_right"), exports);
46
46
  __exportStar(require("./shift_left"), exports);
47
+ __exportStar(require("./shift_right"), exports);
47
48
  __exportStar(require("./sign"), exports);
48
49
  __exportStar(require("./sin"), exports);
49
50
  __exportStar(require("./sqrt"), exports);
@@ -36,18 +36,15 @@ async function deleteDatabase(table, options, context) {
36
36
  // @ts-ignore
37
37
  abap.builtin.sy.get().dbcnt.set(dbcnt);
38
38
  }
39
- else if (options.where) {
39
+ else {
40
40
  const { subrc, dbcnt } = await context.defaultDB().delete({
41
41
  table: (0, prefix_1.buildDbTableName)(table),
42
- where: options.where,
42
+ where: options.where || "",
43
43
  });
44
44
  // @ts-ignore
45
45
  abap.builtin.sy.get().subrc.set(subrc);
46
46
  // @ts-ignore
47
47
  abap.builtin.sy.get().dbcnt.set(dbcnt);
48
48
  }
49
- else {
50
- throw "deleteDatabase todo";
51
- }
52
49
  }
53
50
  //# sourceMappingURL=delete_database.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.10.18",
3
+ "version": "2.10.20",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",
@@ -29,12 +29,12 @@
29
29
  "author": "abaplint",
30
30
  "license": "MIT",
31
31
  "devDependencies": {
32
- "@types/chai": "^4.3.19",
33
- "@types/mocha": "^10.0.7",
32
+ "@types/chai": "^4.3.20",
33
+ "@types/mocha": "^10.0.8",
34
34
  "chai": "^4.5.0",
35
35
  "mocha": "^10.7.3",
36
36
  "source-map-support": "^0.5.21",
37
- "typescript": "^5.5.4"
37
+ "typescript": "^5.6.2"
38
38
  },
39
39
  "dependencies": {
40
40
  "temporal-polyfill": "^0.2.5"