@abaplint/runtime 2.3.86 → 2.3.87
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.
- package/build/src/builtin/count.d.ts +3 -0
- package/build/src/builtin/count.js +9 -1
- package/build/src/builtin/index.d.ts +1 -0
- package/build/src/builtin/index.js +1 -0
- package/build/src/builtin/numofchar.d.ts +5 -0
- package/build/src/builtin/numofchar.js +16 -0
- package/build/src/compare/ca.js +13 -2
- package/build/src/compare/co.js +12 -1
- package/package.json +1 -1
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { Integer } from "../types";
|
|
2
2
|
import { ICharacter } from "../types/_character";
|
|
3
|
+
import { INumeric } from "../types/_numeric";
|
|
3
4
|
export declare type countInput = {
|
|
4
5
|
val: ICharacter;
|
|
5
6
|
sub: ICharacter;
|
|
6
7
|
regex?: ICharacter;
|
|
7
8
|
case?: ICharacter;
|
|
9
|
+
len?: INumeric;
|
|
10
|
+
off?: INumeric;
|
|
8
11
|
};
|
|
9
12
|
export declare function count(input: countInput): Integer;
|
|
@@ -5,7 +5,15 @@ const compare_1 = require("../compare");
|
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
function count(input) {
|
|
7
7
|
let found = 0;
|
|
8
|
-
|
|
8
|
+
let val = input.val.get();
|
|
9
|
+
if (input.off) {
|
|
10
|
+
const off = input.off.get();
|
|
11
|
+
val = val.substring(off);
|
|
12
|
+
}
|
|
13
|
+
if (input.len) {
|
|
14
|
+
const len = input.len.get();
|
|
15
|
+
val = val.substring(0, len);
|
|
16
|
+
}
|
|
9
17
|
let reg = "";
|
|
10
18
|
if (input.sub) {
|
|
11
19
|
reg = input.sub.get();
|
|
@@ -35,6 +35,7 @@ __exportStar(require("./match"), exports);
|
|
|
35
35
|
__exportStar(require("./matches"), exports);
|
|
36
36
|
__exportStar(require("./nmax"), exports);
|
|
37
37
|
__exportStar(require("./nmin"), exports);
|
|
38
|
+
__exportStar(require("./numofchar"), exports);
|
|
38
39
|
__exportStar(require("./repeat"), exports);
|
|
39
40
|
__exportStar(require("./replace"), exports);
|
|
40
41
|
__exportStar(require("./reverse"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.numofchar = void 0;
|
|
4
|
+
const types_1 = require("../types");
|
|
5
|
+
function numofchar(input) {
|
|
6
|
+
let str = "";
|
|
7
|
+
if (typeof input.val === "string") {
|
|
8
|
+
str = input.val;
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
str = input.val.get();
|
|
12
|
+
}
|
|
13
|
+
return new types_1.Integer().set(str.length);
|
|
14
|
+
}
|
|
15
|
+
exports.numofchar = numofchar;
|
|
16
|
+
//# sourceMappingURL=numofchar.js.map
|
package/build/src/compare/ca.js
CHANGED
|
@@ -19,8 +19,19 @@ function ca(left, right) {
|
|
|
19
19
|
else {
|
|
20
20
|
r = right.get().toString();
|
|
21
21
|
}
|
|
22
|
-
const
|
|
23
|
-
|
|
22
|
+
const characters = r.split("");
|
|
23
|
+
let fdpos = 0;
|
|
24
|
+
for (const c of l.split("")) {
|
|
25
|
+
if (characters.includes(c) === true) {
|
|
26
|
+
// @ts-ignore
|
|
27
|
+
abap.builtin.sy.get().fdpos.set(fdpos);
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
fdpos++;
|
|
31
|
+
}
|
|
32
|
+
// @ts-ignore
|
|
33
|
+
abap.builtin.sy.get().fdpos.set(fdpos);
|
|
34
|
+
return false;
|
|
24
35
|
}
|
|
25
36
|
exports.ca = ca;
|
|
26
37
|
//# sourceMappingURL=ca.js.map
|
package/build/src/compare/co.js
CHANGED
|
@@ -21,7 +21,18 @@ function co(left, right) {
|
|
|
21
21
|
r = right.get().toString();
|
|
22
22
|
}
|
|
23
23
|
const characters = r.split("");
|
|
24
|
-
|
|
24
|
+
let fdpos = 0;
|
|
25
|
+
for (const c of l.split("")) {
|
|
26
|
+
if (characters.includes(c) === false) {
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
abap.builtin.sy.get().fdpos.set(fdpos);
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
fdpos++;
|
|
32
|
+
}
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
abap.builtin.sy.get().fdpos.set(fdpos);
|
|
35
|
+
return true;
|
|
25
36
|
}
|
|
26
37
|
exports.co = co;
|
|
27
38
|
//# sourceMappingURL=co.js.map
|