@abaplint/runtime 2.10.17 → 2.10.19

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);
@@ -30,12 +30,6 @@ function clone(obj) {
30
30
  // @ts-ignore
31
31
  // eslint-disable-next-line no-prototype-builtins
32
32
  if (obj.hasOwnProperty(attr)) {
33
- /*
34
- if (null === obj[attr]) {
35
- console.dir("null");
36
- copy[attr] = null;
37
- } else
38
- */
39
33
  if ("object" !== typeof obj[attr]) {
40
34
  copy[attr] = obj[attr];
41
35
  }
@@ -44,6 +38,9 @@ function clone(obj) {
44
38
  }
45
39
  }
46
40
  }
41
+ if (copy["constant"]) {
42
+ copy["constant"] = false;
43
+ }
47
44
  return copy;
48
45
  }
49
46
  //# sourceMappingURL=clone.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.10.17",
3
+ "version": "2.10.19",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",
@@ -34,7 +34,7 @@
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"