@abaplint/runtime 2.6.21 → 2.6.22

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.
@@ -25,6 +25,7 @@ export * from "./replace";
25
25
  export * from "./reverse";
26
26
  export * from "./round";
27
27
  export * from "./segment";
28
+ export * from "./shift_right";
28
29
  export * from "./shift_left";
29
30
  export * from "./sign";
30
31
  export * from "./sin";
@@ -42,6 +42,7 @@ __exportStar(require("./replace"), exports);
42
42
  __exportStar(require("./reverse"), exports);
43
43
  __exportStar(require("./round"), exports);
44
44
  __exportStar(require("./segment"), exports);
45
+ __exportStar(require("./shift_right"), exports);
45
46
  __exportStar(require("./shift_left"), exports);
46
47
  __exportStar(require("./sign"), exports);
47
48
  __exportStar(require("./sin"), exports);
@@ -25,6 +25,9 @@ function shift_left(input) {
25
25
  const leftShifts = input.circular.get() % val.length;
26
26
  val = val.slice(leftShifts) + val.slice(0, leftShifts);
27
27
  }
28
+ else {
29
+ return shift_left({ val: input.val, sub: " " });
30
+ }
28
31
  return new string_1.String().set(val);
29
32
  }
30
33
  exports.shift_left = shift_left;
@@ -0,0 +1,9 @@
1
+ import { ICharacter } from "../types/_character";
2
+ import { INumeric } from "../types/_numeric";
3
+ export interface IShiftRight {
4
+ val: ICharacter | string;
5
+ sub?: ICharacter | string;
6
+ places?: ICharacter | INumeric | string;
7
+ circular?: INumeric;
8
+ }
9
+ export declare function shift_right(input: IShiftRight): ICharacter;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.shift_right = void 0;
4
+ const string_1 = require("../types/string");
5
+ function shift_right(input) {
6
+ let val = typeof input.val === "string" ? input.val : input.val.get();
7
+ if (input.sub) {
8
+ const sub = typeof input.sub === "string" ? input.sub : input.sub.get();
9
+ while (val.endsWith(sub)) {
10
+ val = val.substr(0, val.length - sub.length);
11
+ }
12
+ }
13
+ else if (input.places) {
14
+ throw new Error("shift_right todo");
15
+ }
16
+ else if (input.circular) {
17
+ throw new Error("shift_right todo");
18
+ }
19
+ else {
20
+ return shift_right({ val: input.val, sub: " " });
21
+ }
22
+ return new string_1.String().set(val);
23
+ }
24
+ exports.shift_right = shift_right;
25
+ //# sourceMappingURL=shift_right.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.6.21",
3
+ "version": "2.6.22",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",