@abaplint/runtime 2.5.38 → 2.5.39
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/abap_regex.d.ts +4 -4
- package/build/src/abap_regex.js +18 -18
- package/build/src/binary_search.d.ts +5 -5
- package/build/src/binary_search.js +48 -48
- package/build/src/builtin/abs.d.ts +5 -5
- package/build/src/builtin/abs.js +17 -17
- package/build/src/builtin/boolc.d.ts +4 -4
- package/build/src/builtin/boolc.js +22 -22
- package/build/src/builtin/ceil.d.ts +5 -5
- package/build/src/builtin/ceil.js +17 -17
- package/build/src/builtin/concat_lines_of.d.ts +7 -7
- package/build/src/builtin/concat_lines_of.js +15 -15
- package/build/src/builtin/condense.d.ts +9 -9
- package/build/src/builtin/condense.js +28 -28
- package/build/src/builtin/contains.d.ts +12 -12
- package/build/src/builtin/contains.js +15 -15
- package/build/src/builtin/cos.d.ts +5 -5
- package/build/src/builtin/cos.js +22 -22
- package/build/src/builtin/count.d.ts +12 -12
- package/build/src/builtin/count.js +37 -37
- package/build/src/builtin/count_any_of.d.ts +8 -8
- package/build/src/builtin/count_any_of.js +17 -17
- package/build/src/builtin/escape.d.ts +7 -7
- package/build/src/builtin/escape.js +30 -30
- package/build/src/builtin/find.d.ts +13 -13
- package/build/src/builtin/find.js +57 -57
- package/build/src/builtin/floor.d.ts +5 -5
- package/build/src/builtin/floor.js +17 -17
- package/build/src/builtin/frac.d.ts +6 -6
- package/build/src/builtin/frac.js +40 -40
- package/build/src/builtin/index.d.ts +47 -47
- package/build/src/builtin/index.js +64 -64
- package/build/src/builtin/insert.d.ts +9 -9
- package/build/src/builtin/insert.js +15 -15
- package/build/src/builtin/ipow.d.ts +6 -6
- package/build/src/builtin/ipow.js +27 -27
- package/build/src/builtin/lines.d.ts +4 -4
- package/build/src/builtin/lines.js +8 -8
- package/build/src/builtin/match.d.ts +5 -5
- package/build/src/builtin/match.js +22 -22
- package/build/src/builtin/matches.d.ts +6 -6
- package/build/src/builtin/matches.js +29 -29
- package/build/src/builtin/nmax.d.ts +14 -14
- package/build/src/builtin/nmax.js +34 -34
- package/build/src/builtin/nmin.d.ts +14 -14
- package/build/src/builtin/nmin.js +34 -34
- package/build/src/builtin/numofchar.d.ts +5 -5
- package/build/src/builtin/numofchar.js +15 -15
- package/build/src/builtin/repeat.d.ts +6 -6
- package/build/src/builtin/repeat.js +9 -9
- package/build/src/builtin/replace.d.ts +13 -13
- package/build/src/builtin/replace.js +65 -65
- package/build/src/builtin/reverse.d.ts +5 -5
- package/build/src/builtin/reverse.js +16 -16
- package/build/src/builtin/round.d.ts +8 -8
- package/build/src/builtin/round.js +41 -41
- package/build/src/builtin/segment.d.ts +8 -8
- package/build/src/builtin/segment.js +32 -32
- package/build/src/builtin/shift_left.d.ts +9 -9
- package/build/src/builtin/shift_left.js +30 -30
- package/build/src/builtin/sign.d.ts +5 -5
- package/build/src/builtin/sign.js +17 -17
- package/build/src/builtin/sin.d.ts +5 -5
- package/build/src/builtin/sin.js +22 -22
- package/build/src/builtin/sqrt.d.ts +5 -5
- package/build/src/builtin/sqrt.js +22 -22
- package/build/src/builtin/strlen.d.ts +5 -5
- package/build/src/builtin/strlen.js +15 -15
- package/build/src/builtin/substring.d.ts +8 -8
- package/build/src/builtin/substring.js +28 -28
- package/build/src/builtin/substring_after.d.ts +6 -6
- package/build/src/builtin/substring_after.js +28 -28
- package/build/src/builtin/substring_before.d.ts +6 -6
- package/build/src/builtin/substring_before.js +28 -28
- package/build/src/builtin/sy.d.ts +2 -2
- package/build/src/builtin/sy.js +30 -30
- package/build/src/builtin/tan.d.ts +5 -5
- package/build/src/builtin/tan.js +22 -22
- package/build/src/builtin/to_lower.d.ts +4 -4
- package/build/src/builtin/to_lower.js +9 -9
- package/build/src/builtin/to_mixed.d.ts +9 -9
- package/build/src/builtin/to_mixed.js +48 -48
- package/build/src/builtin/to_upper.d.ts +4 -4
- package/build/src/builtin/to_upper.js +9 -9
- package/build/src/builtin/translate.d.ts +6 -6
- package/build/src/builtin/translate.js +19 -19
- package/build/src/builtin/trunc.d.ts +5 -5
- package/build/src/builtin/trunc.js +17 -17
- package/build/src/builtin/xstrlen.d.ts +5 -5
- package/build/src/builtin/xstrlen.js +13 -13
- package/build/src/classic_error.d.ts +6 -6
- package/build/src/classic_error.js +10 -10
- package/build/src/clone.d.ts +1 -1
- package/build/src/clone.js +37 -37
- package/build/src/compare/assigned.d.ts +2 -2
- package/build/src/compare/assigned.js +7 -7
- package/build/src/compare/between.d.ts +2 -2
- package/build/src/compare/between.js +9 -9
- package/build/src/compare/ca.d.ts +3 -3
- package/build/src/compare/ca.js +36 -36
- package/build/src/compare/cn.d.ts +3 -3
- package/build/src/compare/cn.js +8 -8
- package/build/src/compare/co.d.ts +4 -4
- package/build/src/compare/co.js +37 -37
- package/build/src/compare/cp.d.ts +4 -4
- package/build/src/compare/cp.js +48 -48
- package/build/src/compare/cs.d.ts +3 -3
- package/build/src/compare/cs.js +33 -33
- package/build/src/compare/eq.d.ts +4 -4
- package/build/src/compare/eq.js +134 -134
- package/build/src/compare/ge.d.ts +3 -3
- package/build/src/compare/ge.js +8 -8
- package/build/src/compare/gt.d.ts +4 -4
- package/build/src/compare/gt.js +107 -107
- package/build/src/compare/in.d.ts +4 -4
- package/build/src/compare/in.js +34 -34
- package/build/src/compare/index.d.ts +22 -22
- package/build/src/compare/index.js +40 -40
- package/build/src/compare/initial.d.ts +4 -4
- package/build/src/compare/initial.js +63 -63
- package/build/src/compare/instance_of.d.ts +2 -2
- package/build/src/compare/instance_of.js +7 -7
- package/build/src/compare/le.d.ts +3 -3
- package/build/src/compare/le.js +8 -8
- package/build/src/compare/lt.d.ts +4 -4
- package/build/src/compare/lt.js +8 -8
- package/build/src/compare/m.d.ts +3 -3
- package/build/src/compare/m.js +37 -37
- package/build/src/compare/na.d.ts +3 -3
- package/build/src/compare/na.js +8 -8
- package/build/src/compare/ne.d.ts +3 -3
- package/build/src/compare/ne.js +8 -8
- package/build/src/compare/np.d.ts +3 -3
- package/build/src/compare/np.js +8 -8
- package/build/src/compare/ns.d.ts +3 -3
- package/build/src/compare/ns.js +8 -8
- package/build/src/compare/o.d.ts +2 -2
- package/build/src/compare/o.js +28 -28
- package/build/src/compare/z.d.ts +2 -2
- package/build/src/compare/z.js +28 -28
- package/build/src/console.d.ts +7 -7
- package/build/src/console.js +21 -21
- package/build/src/context.d.ts +13 -13
- package/build/src/context.js +17 -17
- package/build/src/db/db.d.ts +55 -55
- package/build/src/db/db.js +2 -2
- package/build/src/expand_dynamic.d.ts +2 -2
- package/build/src/expand_dynamic.js +22 -22
- package/build/src/expand_in.d.ts +2 -2
- package/build/src/expand_in.js +24 -24
- package/build/src/index.d.ts +52 -52
- package/build/src/index.js +54 -54
- package/build/src/offset_length.d.ts +16 -16
- package/build/src/offset_length.js +78 -78
- package/build/src/operators/_bit_operations.d.ts +6 -6
- package/build/src/operators/_bit_operations.js +29 -29
- package/build/src/operators/_parse.d.ts +4 -4
- package/build/src/operators/_parse.js +45 -45
- package/build/src/operators/add.d.ts +4 -4
- package/build/src/operators/add.js +42 -42
- package/build/src/operators/bit-and.d.ts +2 -2
- package/build/src/operators/bit-and.js +18 -18
- package/build/src/operators/bit-not.d.ts +2 -2
- package/build/src/operators/bit-not.js +14 -14
- package/build/src/operators/bit-or.d.ts +2 -2
- package/build/src/operators/bit-or.js +18 -18
- package/build/src/operators/bit-xor.d.ts +2 -2
- package/build/src/operators/bit-xor.js +18 -18
- package/build/src/operators/concat.d.ts +4 -4
- package/build/src/operators/concat.js +35 -35
- package/build/src/operators/div.d.ts +4 -4
- package/build/src/operators/div.js +12 -12
- package/build/src/operators/divide.d.ts +4 -4
- package/build/src/operators/divide.js +16 -16
- package/build/src/operators/index.d.ts +12 -12
- package/build/src/operators/index.js +28 -28
- package/build/src/operators/minus.d.ts +4 -4
- package/build/src/operators/minus.js +41 -41
- package/build/src/operators/mod.d.ts +4 -4
- package/build/src/operators/mod.js +12 -12
- package/build/src/operators/multiply.d.ts +4 -4
- package/build/src/operators/multiply.js +29 -29
- package/build/src/operators/power.d.ts +4 -4
- package/build/src/operators/power.js +9 -9
- package/build/src/rfc.d.ts +25 -25
- package/build/src/rfc.js +2 -2
- package/build/src/statements/append.d.ts +13 -13
- package/build/src/statements/append.js +66 -66
- package/build/src/statements/assert.d.ts +1 -1
- package/build/src/statements/assert.js +9 -9
- package/build/src/statements/assign.d.ts +12 -12
- package/build/src/statements/assign.js +136 -136
- package/build/src/statements/call_function.d.ts +15 -15
- package/build/src/statements/call_function.js +35 -35
- package/build/src/statements/cast.d.ts +2 -2
- package/build/src/statements/cast.js +56 -56
- package/build/src/statements/clear.d.ts +4 -4
- package/build/src/statements/clear.js +7 -7
- package/build/src/statements/collect.d.ts +3 -3
- package/build/src/statements/collect.js +13 -13
- package/build/src/statements/commit.d.ts +1 -1
- package/build/src/statements/commit.js +7 -7
- package/build/src/statements/concatenate.d.ts +11 -11
- package/build/src/statements/concatenate.js +47 -47
- package/build/src/statements/condense.d.ts +4 -4
- package/build/src/statements/condense.js +15 -15
- package/build/src/statements/convert.d.ts +14 -14
- package/build/src/statements/convert.js +78 -78
- package/build/src/statements/create_data.d.ts +16 -16
- package/build/src/statements/create_data.js +154 -154
- package/build/src/statements/delete_database.d.ts +13 -13
- package/build/src/statements/delete_database.js +51 -51
- package/build/src/statements/delete_internal.d.ts +12 -12
- package/build/src/statements/delete_internal.js +106 -99
- package/build/src/statements/describe.d.ts +13 -13
- package/build/src/statements/describe.js +89 -89
- package/build/src/statements/find.d.ts +17 -17
- package/build/src/statements/find.js +173 -168
- package/build/src/statements/get_bit.d.ts +4 -4
- package/build/src/statements/get_bit.js +12 -12
- package/build/src/statements/get_locale.d.ts +2 -2
- package/build/src/statements/get_locale.js +8 -8
- package/build/src/statements/get_parameter.d.ts +2 -2
- package/build/src/statements/get_parameter.js +9 -9
- package/build/src/statements/get_run_time.d.ts +2 -2
- package/build/src/statements/get_run_time.js +16 -16
- package/build/src/statements/get_time.d.ts +9 -9
- package/build/src/statements/get_time.js +30 -30
- package/build/src/statements/index.d.ts +96 -96
- package/build/src/statements/index.js +115 -115
- package/build/src/statements/insert_database.d.ts +13 -13
- package/build/src/statements/insert_database.js +56 -56
- package/build/src/statements/insert_internal.d.ts +13 -13
- package/build/src/statements/insert_internal.js +113 -113
- package/build/src/statements/loop.d.ts +15 -15
- package/build/src/statements/loop.js +115 -115
- package/build/src/statements/message.d.ts +17 -17
- package/build/src/statements/message.js +89 -89
- package/build/src/statements/modify_database.d.ts +12 -12
- package/build/src/statements/modify_database.js +39 -39
- package/build/src/statements/modify_internal.d.ts +7 -7
- package/build/src/statements/modify_internal.js +29 -29
- package/build/src/statements/move_corresponding.d.ts +2 -2
- package/build/src/statements/move_corresponding.js +10 -10
- package/build/src/statements/overlay.d.ts +3 -3
- package/build/src/statements/overlay.js +16 -16
- package/build/src/statements/raise_event.d.ts +1 -1
- package/build/src/statements/raise_event.js +8 -8
- package/build/src/statements/read_report.d.ts +8 -8
- package/build/src/statements/read_report.js +14 -14
- package/build/src/statements/read_table.d.ts +22 -22
- package/build/src/statements/read_table.js +130 -130
- package/build/src/statements/replace.d.ts +13 -13
- package/build/src/statements/replace.js +60 -60
- package/build/src/statements/rollback.d.ts +1 -1
- package/build/src/statements/rollback.js +7 -7
- package/build/src/statements/select.d.ts +8 -8
- package/build/src/statements/select.js +77 -77
- package/build/src/statements/set_bit.d.ts +4 -4
- package/build/src/statements/set_bit.js +41 -41
- package/build/src/statements/set_handler.d.ts +3 -3
- package/build/src/statements/set_handler.js +8 -8
- package/build/src/statements/set_locale.d.ts +2 -2
- package/build/src/statements/set_locale.js +7 -7
- package/build/src/statements/shift.d.ts +12 -12
- package/build/src/statements/shift.js +113 -113
- package/build/src/statements/sort.d.ts +9 -9
- package/build/src/statements/sort.js +82 -82
- package/build/src/statements/split.d.ts +9 -9
- package/build/src/statements/split.js +38 -38
- package/build/src/statements/translate.d.ts +2 -2
- package/build/src/statements/translate.js +39 -39
- package/build/src/statements/update_database.d.ts +14 -14
- package/build/src/statements/update_database.js +53 -53
- package/build/src/statements/write.d.ts +17 -17
- package/build/src/statements/write.js +56 -56
- package/build/src/template_formatting.d.ts +14 -14
- package/build/src/template_formatting.js +82 -82
- package/build/src/throw_error.d.ts +1 -1
- package/build/src/throw_error.js +14 -14
- package/build/src/types/_abstract_type_data.d.ts +5 -5
- package/build/src/types/_abstract_type_data.js +2 -2
- package/build/src/types/_character.d.ts +11 -11
- package/build/src/types/_character.js +2 -2
- package/build/src/types/_date_helper.d.ts +2 -2
- package/build/src/types/_date_helper.js +40 -40
- package/build/src/types/_numeric.d.ts +5 -5
- package/build/src/types/_numeric.js +2 -2
- package/build/src/types/abap_object.d.ts +11 -11
- package/build/src/types/abap_object.js +32 -32
- package/build/src/types/character.d.ts +26 -26
- package/build/src/types/character.js +111 -111
- package/build/src/types/data_reference.d.ts +28 -28
- package/build/src/types/data_reference.js +88 -88
- package/build/src/types/date.d.ts +20 -20
- package/build/src/types/date.js +66 -66
- package/build/src/types/decfloat34.d.ts +11 -11
- package/build/src/types/decfloat34.js +45 -45
- package/build/src/types/field_symbol.d.ts +32 -32
- package/build/src/types/field_symbol.js +115 -115
- package/build/src/types/float.d.ts +15 -15
- package/build/src/types/float.js +74 -74
- package/build/src/types/hex.d.ts +20 -20
- package/build/src/types/hex.js +81 -81
- package/build/src/types/index.d.ts +17 -17
- package/build/src/types/index.js +33 -33
- package/build/src/types/integer.d.ts +15 -15
- package/build/src/types/integer.js +56 -56
- package/build/src/types/numc.d.ts +21 -21
- package/build/src/types/numc.js +48 -48
- package/build/src/types/packed.d.ts +19 -19
- package/build/src/types/packed.js +53 -53
- package/build/src/types/string.d.ts +19 -19
- package/build/src/types/string.js +86 -86
- package/build/src/types/structure.d.ts +23 -23
- package/build/src/types/structure.js +113 -113
- package/build/src/types/table.d.ts +55 -55
- package/build/src/types/table.js +220 -220
- package/build/src/types/time.d.ts +20 -20
- package/build/src/types/time.js +67 -67
- package/build/src/types/utc_long.d.ts +18 -18
- package/build/src/types/utc_long.js +26 -26
- package/build/src/types/xstring.d.ts +18 -18
- package/build/src/types/xstring.js +70 -70
- package/build/src/unit_test.d.ts +26 -26
- package/build/src/unit_test.js +75 -75
- package/package.json +2 -2
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.split = void 0;
|
|
4
|
-
const types_1 = require("../types");
|
|
5
|
-
function split(param) {
|
|
6
|
-
const source = typeof param.source === "string" ? param.source : param.source.get();
|
|
7
|
-
const at = typeof param.at === "string" ? param.at : param.at.get();
|
|
8
|
-
const split = source.includes(at) ? source.split(at) : [];
|
|
9
|
-
if (param.table) {
|
|
10
|
-
if (source.endsWith(at)) {
|
|
11
|
-
split.pop();
|
|
12
|
-
}
|
|
13
|
-
param.table.clear();
|
|
14
|
-
for (const s of split) {
|
|
15
|
-
param.table.append(new types_1.String().set(s));
|
|
16
|
-
}
|
|
17
|
-
if (source !== "" && split.length === 0) {
|
|
18
|
-
param.table.append(new types_1.String().set(source));
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
if (param.targets) {
|
|
22
|
-
if (split.length === 0) {
|
|
23
|
-
split.push(source);
|
|
24
|
-
}
|
|
25
|
-
for (const t of param.targets) {
|
|
26
|
-
t.clear();
|
|
27
|
-
if (split.length > 0) {
|
|
28
|
-
t.set(split.shift().replace(/ +$/, ""));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
if (split.length > 0) {
|
|
32
|
-
const concat = split.join(at);
|
|
33
|
-
const last = param.targets[param.targets.length - 1];
|
|
34
|
-
last.set(last.get() + at + concat);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.split = split;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.split = void 0;
|
|
4
|
+
const types_1 = require("../types");
|
|
5
|
+
function split(param) {
|
|
6
|
+
const source = typeof param.source === "string" ? param.source : param.source.get();
|
|
7
|
+
const at = typeof param.at === "string" ? param.at : param.at.get();
|
|
8
|
+
const split = source.includes(at) ? source.split(at) : [];
|
|
9
|
+
if (param.table) {
|
|
10
|
+
if (source.endsWith(at)) {
|
|
11
|
+
split.pop();
|
|
12
|
+
}
|
|
13
|
+
param.table.clear();
|
|
14
|
+
for (const s of split) {
|
|
15
|
+
param.table.append(new types_1.String().set(s));
|
|
16
|
+
}
|
|
17
|
+
if (source !== "" && split.length === 0) {
|
|
18
|
+
param.table.append(new types_1.String().set(source));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
if (param.targets) {
|
|
22
|
+
if (split.length === 0) {
|
|
23
|
+
split.push(source);
|
|
24
|
+
}
|
|
25
|
+
for (const t of param.targets) {
|
|
26
|
+
t.clear();
|
|
27
|
+
if (split.length > 0) {
|
|
28
|
+
t.set(split.shift().replace(/ +$/, ""));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (split.length > 0) {
|
|
32
|
+
const concat = split.join(at);
|
|
33
|
+
const last = param.targets[param.targets.length - 1];
|
|
34
|
+
last.set(last.get() + at + concat);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.split = split;
|
|
39
39
|
//# sourceMappingURL=split.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ICharacter } from "../types/_character";
|
|
2
|
-
export declare function translate(input: ICharacter, i: ICharacter | string): void;
|
|
1
|
+
import { ICharacter } from "../types/_character";
|
|
2
|
+
export declare function translate(input: ICharacter, i: ICharacter | string): void;
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.translate = void 0;
|
|
4
|
-
function translate(input, i) {
|
|
5
|
-
let c = i;
|
|
6
|
-
if (typeof c !== "string") {
|
|
7
|
-
c = c.get();
|
|
8
|
-
}
|
|
9
|
-
if (c === "LOWER") {
|
|
10
|
-
input.set(input.get().toLowerCase());
|
|
11
|
-
}
|
|
12
|
-
else if (c === "UPPER") {
|
|
13
|
-
input.set(input.get().toUpperCase());
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
const chunks = c.match(/.{1,2}/g);
|
|
17
|
-
for (const chunk of chunks || []) {
|
|
18
|
-
let search = chunk.substr(0, 1);
|
|
19
|
-
const replace = chunk.substr(1, 1);
|
|
20
|
-
// regexp escaping
|
|
21
|
-
if (search === "+"
|
|
22
|
-
|| search === "*"
|
|
23
|
-
|| search === "?"
|
|
24
|
-
|| search === "."
|
|
25
|
-
|| search === "^"
|
|
26
|
-
|| search === "$"
|
|
27
|
-
|| search === "|"
|
|
28
|
-
|| search === "["
|
|
29
|
-
|| search === "]"
|
|
30
|
-
|| search === "\\"
|
|
31
|
-
|| search === "("
|
|
32
|
-
|| search === ")") {
|
|
33
|
-
search = "\\" + search;
|
|
34
|
-
}
|
|
35
|
-
input.set(input.get().replace(new RegExp(search, "g"), replace));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
exports.translate = translate;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.translate = void 0;
|
|
4
|
+
function translate(input, i) {
|
|
5
|
+
let c = i;
|
|
6
|
+
if (typeof c !== "string") {
|
|
7
|
+
c = c.get();
|
|
8
|
+
}
|
|
9
|
+
if (c === "LOWER") {
|
|
10
|
+
input.set(input.get().toLowerCase());
|
|
11
|
+
}
|
|
12
|
+
else if (c === "UPPER") {
|
|
13
|
+
input.set(input.get().toUpperCase());
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
const chunks = c.match(/.{1,2}/g);
|
|
17
|
+
for (const chunk of chunks || []) {
|
|
18
|
+
let search = chunk.substr(0, 1);
|
|
19
|
+
const replace = chunk.substr(1, 1);
|
|
20
|
+
// regexp escaping
|
|
21
|
+
if (search === "+"
|
|
22
|
+
|| search === "*"
|
|
23
|
+
|| search === "?"
|
|
24
|
+
|| search === "."
|
|
25
|
+
|| search === "^"
|
|
26
|
+
|| search === "$"
|
|
27
|
+
|| search === "|"
|
|
28
|
+
|| search === "["
|
|
29
|
+
|| search === "]"
|
|
30
|
+
|| search === "\\"
|
|
31
|
+
|| search === "("
|
|
32
|
+
|| search === ")") {
|
|
33
|
+
search = "\\" + search;
|
|
34
|
+
}
|
|
35
|
+
input.set(input.get().replace(new RegExp(search, "g"), replace));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.translate = translate;
|
|
40
40
|
//# sourceMappingURL=translate.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Context } from "../context";
|
|
2
|
-
import { FieldSymbol, Structure, Table } from "../types";
|
|
3
|
-
import { ICharacter } from "../types/_character";
|
|
4
|
-
export interface IUpdateDatabaseOptions {
|
|
5
|
-
from?: Structure | FieldSymbol;
|
|
6
|
-
table?: Table | FieldSymbol;
|
|
7
|
-
set?: string[];
|
|
8
|
-
where?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare class UpdateDatabase {
|
|
11
|
-
private readonly context;
|
|
12
|
-
constructor(context: Context);
|
|
13
|
-
updateDatabase(table: string | ICharacter, options: IUpdateDatabaseOptions): Promise<number>;
|
|
14
|
-
}
|
|
1
|
+
import { Context } from "../context";
|
|
2
|
+
import { FieldSymbol, Structure, Table } from "../types";
|
|
3
|
+
import { ICharacter } from "../types/_character";
|
|
4
|
+
export interface IUpdateDatabaseOptions {
|
|
5
|
+
from?: Structure | FieldSymbol;
|
|
6
|
+
table?: Table | FieldSymbol;
|
|
7
|
+
set?: string[];
|
|
8
|
+
where?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class UpdateDatabase {
|
|
11
|
+
private readonly context;
|
|
12
|
+
constructor(context: Context);
|
|
13
|
+
updateDatabase(table: string | ICharacter, options: IUpdateDatabaseOptions): Promise<number>;
|
|
14
|
+
}
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UpdateDatabase = void 0;
|
|
4
|
-
const types_1 = require("../types");
|
|
5
|
-
const insert_database_1 = require("./insert_database");
|
|
6
|
-
class UpdateDatabase {
|
|
7
|
-
constructor(context) {
|
|
8
|
-
this.context = context;
|
|
9
|
-
}
|
|
10
|
-
async updateDatabase(table, options) {
|
|
11
|
-
if (options.table instanceof types_1.FieldSymbol) {
|
|
12
|
-
options.table = options.table.getPointer();
|
|
13
|
-
}
|
|
14
|
-
if (options.from instanceof types_1.FieldSymbol) {
|
|
15
|
-
options.from = options.from.getPointer();
|
|
16
|
-
}
|
|
17
|
-
if (typeof table !== "string") {
|
|
18
|
-
table = table.get();
|
|
19
|
-
}
|
|
20
|
-
// @ts-ignore
|
|
21
|
-
const keys = abap.DDIC[table.toUpperCase()].keyFields;
|
|
22
|
-
const where = [];
|
|
23
|
-
const set = [];
|
|
24
|
-
if (options.from) {
|
|
25
|
-
const structure = options.from.get();
|
|
26
|
-
for (const k of Object.keys(structure)) {
|
|
27
|
-
const str = k + " = " + (0, insert_database_1.toValue)(structure[k].get());
|
|
28
|
-
if (keys.includes(k.toUpperCase())) {
|
|
29
|
-
where.push(str);
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
set.push(str);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
else if (options.set) {
|
|
37
|
-
if (options.where) {
|
|
38
|
-
where.push(options.where);
|
|
39
|
-
}
|
|
40
|
-
set.push(...options.set);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
throw "updateDatabase, todo";
|
|
44
|
-
}
|
|
45
|
-
const { subrc, dbcnt } = await this.context.defaultDB().update({ table, where: where.join(" AND "), set });
|
|
46
|
-
// @ts-ignore
|
|
47
|
-
abap.builtin.sy.get().subrc.set(subrc);
|
|
48
|
-
// @ts-ignore
|
|
49
|
-
abap.builtin.sy.get().dbcnt.set(dbcnt);
|
|
50
|
-
return subrc;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
exports.UpdateDatabase = UpdateDatabase;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateDatabase = void 0;
|
|
4
|
+
const types_1 = require("../types");
|
|
5
|
+
const insert_database_1 = require("./insert_database");
|
|
6
|
+
class UpdateDatabase {
|
|
7
|
+
constructor(context) {
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
async updateDatabase(table, options) {
|
|
11
|
+
if (options.table instanceof types_1.FieldSymbol) {
|
|
12
|
+
options.table = options.table.getPointer();
|
|
13
|
+
}
|
|
14
|
+
if (options.from instanceof types_1.FieldSymbol) {
|
|
15
|
+
options.from = options.from.getPointer();
|
|
16
|
+
}
|
|
17
|
+
if (typeof table !== "string") {
|
|
18
|
+
table = table.get();
|
|
19
|
+
}
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
const keys = abap.DDIC[table.toUpperCase()].keyFields;
|
|
22
|
+
const where = [];
|
|
23
|
+
const set = [];
|
|
24
|
+
if (options.from) {
|
|
25
|
+
const structure = options.from.get();
|
|
26
|
+
for (const k of Object.keys(structure)) {
|
|
27
|
+
const str = k + " = " + (0, insert_database_1.toValue)(structure[k].get());
|
|
28
|
+
if (keys.includes(k.toUpperCase())) {
|
|
29
|
+
where.push(str);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
set.push(str);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
else if (options.set) {
|
|
37
|
+
if (options.where) {
|
|
38
|
+
where.push(options.where);
|
|
39
|
+
}
|
|
40
|
+
set.push(...options.set);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
throw "updateDatabase, todo";
|
|
44
|
+
}
|
|
45
|
+
const { subrc, dbcnt } = await this.context.defaultDB().update({ table, where: where.join(" AND "), set });
|
|
46
|
+
// @ts-ignore
|
|
47
|
+
abap.builtin.sy.get().subrc.set(subrc);
|
|
48
|
+
// @ts-ignore
|
|
49
|
+
abap.builtin.sy.get().dbcnt.set(dbcnt);
|
|
50
|
+
return subrc;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.UpdateDatabase = UpdateDatabase;
|
|
54
54
|
//# sourceMappingURL=update_database.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { Context } from "../context";
|
|
2
|
-
import { FieldSymbol } from "../types/field_symbol";
|
|
3
|
-
import { ICharacter } from "../types/_character";
|
|
4
|
-
import { INumeric } from "../types/_numeric";
|
|
5
|
-
export interface IWriteOptions {
|
|
6
|
-
newLine?: boolean;
|
|
7
|
-
skipLine?: boolean;
|
|
8
|
-
target?: ICharacter;
|
|
9
|
-
exponent?: ICharacter | INumeric;
|
|
10
|
-
noGrouping?: boolean;
|
|
11
|
-
noSign?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare class WriteStatement {
|
|
14
|
-
private readonly context;
|
|
15
|
-
constructor(context: Context);
|
|
16
|
-
write(source: INumeric | ICharacter | FieldSymbol | string | number, options?: IWriteOptions): void;
|
|
17
|
-
}
|
|
1
|
+
import { Context } from "../context";
|
|
2
|
+
import { FieldSymbol } from "../types/field_symbol";
|
|
3
|
+
import { ICharacter } from "../types/_character";
|
|
4
|
+
import { INumeric } from "../types/_numeric";
|
|
5
|
+
export interface IWriteOptions {
|
|
6
|
+
newLine?: boolean;
|
|
7
|
+
skipLine?: boolean;
|
|
8
|
+
target?: ICharacter;
|
|
9
|
+
exponent?: ICharacter | INumeric;
|
|
10
|
+
noGrouping?: boolean;
|
|
11
|
+
noSign?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare class WriteStatement {
|
|
14
|
+
private readonly context;
|
|
15
|
+
constructor(context: Context);
|
|
16
|
+
write(source: INumeric | ICharacter | FieldSymbol | string | number, options?: IWriteOptions): void;
|
|
17
|
+
}
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WriteStatement = void 0;
|
|
4
|
-
const types_1 = require("../types");
|
|
5
|
-
class WriteStatement {
|
|
6
|
-
constructor(context) {
|
|
7
|
-
this.context = context;
|
|
8
|
-
}
|
|
9
|
-
write(source, options) {
|
|
10
|
-
var _a;
|
|
11
|
-
if ((options === null || options === void 0 ? void 0 : options.skipLine) === true) {
|
|
12
|
-
this.context.console.add("\n");
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
if ((options === null || options === void 0 ? void 0 : options.newLine) === true && this.context.console.get().length > 0) {
|
|
16
|
-
this.context.console.add("\n");
|
|
17
|
-
}
|
|
18
|
-
let result = "";
|
|
19
|
-
if (typeof source === "string" || typeof source === "number") {
|
|
20
|
-
result = source.toString();
|
|
21
|
-
}
|
|
22
|
-
else if (source instanceof types_1.Structure) {
|
|
23
|
-
const obj = source.getCharacter();
|
|
24
|
-
this.write(obj, Object.assign({}, options));
|
|
25
|
-
}
|
|
26
|
-
else if (source instanceof types_1.Float) {
|
|
27
|
-
if (((_a = options === null || options === void 0 ? void 0 : options.exponent) === null || _a === void 0 ? void 0 : _a.get()) === 0) {
|
|
28
|
-
const tens = source.getRaw().toFixed(0).length - 1;
|
|
29
|
-
if (options.noSign === true && source.getRaw() < 0) {
|
|
30
|
-
result = source.getRaw().toFixed(17 - tens).replace(".", ",");
|
|
31
|
-
result = result.replace("-", "");
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
result = source.getRaw().toFixed(16 - tens).replace(".", ",");
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
result = source.get().toString();
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
else if (source instanceof types_1.Packed) {
|
|
42
|
-
result = source.get().toFixed(source.getDecimals());
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
result = source.get().toString();
|
|
46
|
-
}
|
|
47
|
-
if (options === null || options === void 0 ? void 0 : options.target) {
|
|
48
|
-
options.target.set(result);
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
this.context.console.add(result);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
exports.WriteStatement = WriteStatement;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WriteStatement = void 0;
|
|
4
|
+
const types_1 = require("../types");
|
|
5
|
+
class WriteStatement {
|
|
6
|
+
constructor(context) {
|
|
7
|
+
this.context = context;
|
|
8
|
+
}
|
|
9
|
+
write(source, options) {
|
|
10
|
+
var _a;
|
|
11
|
+
if ((options === null || options === void 0 ? void 0 : options.skipLine) === true) {
|
|
12
|
+
this.context.console.add("\n");
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
if ((options === null || options === void 0 ? void 0 : options.newLine) === true && this.context.console.get().length > 0) {
|
|
16
|
+
this.context.console.add("\n");
|
|
17
|
+
}
|
|
18
|
+
let result = "";
|
|
19
|
+
if (typeof source === "string" || typeof source === "number") {
|
|
20
|
+
result = source.toString();
|
|
21
|
+
}
|
|
22
|
+
else if (source instanceof types_1.Structure) {
|
|
23
|
+
const obj = source.getCharacter();
|
|
24
|
+
this.write(obj, Object.assign({}, options));
|
|
25
|
+
}
|
|
26
|
+
else if (source instanceof types_1.Float) {
|
|
27
|
+
if (((_a = options === null || options === void 0 ? void 0 : options.exponent) === null || _a === void 0 ? void 0 : _a.get()) === 0) {
|
|
28
|
+
const tens = source.getRaw().toFixed(0).length - 1;
|
|
29
|
+
if (options.noSign === true && source.getRaw() < 0) {
|
|
30
|
+
result = source.getRaw().toFixed(17 - tens).replace(".", ",");
|
|
31
|
+
result = result.replace("-", "");
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
result = source.getRaw().toFixed(16 - tens).replace(".", ",");
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
result = source.get().toString();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else if (source instanceof types_1.Packed) {
|
|
42
|
+
result = source.get().toFixed(source.getDecimals());
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
result = source.get().toString();
|
|
46
|
+
}
|
|
47
|
+
if (options === null || options === void 0 ? void 0 : options.target) {
|
|
48
|
+
options.target.set(result);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
this.context.console.add(result);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.WriteStatement = WriteStatement;
|
|
57
57
|
//# sourceMappingURL=write.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { ICharacter } from "./types/_character";
|
|
2
|
-
import { INumeric } from "./types/_numeric";
|
|
3
|
-
|
|
4
|
-
timestamp?: string;
|
|
5
|
-
date?: string;
|
|
6
|
-
time?: string;
|
|
7
|
-
pad?: string;
|
|
8
|
-
width?: number;
|
|
9
|
-
decimals?: number;
|
|
10
|
-
currency?: any;
|
|
11
|
-
align?: "left" | "right";
|
|
12
|
-
};
|
|
13
|
-
export declare function templateFormatting(source: ICharacter | INumeric, options?: options): string;
|
|
14
|
-
export {};
|
|
1
|
+
import { ICharacter } from "./types/_character";
|
|
2
|
+
import { INumeric } from "./types/_numeric";
|
|
3
|
+
type options = {
|
|
4
|
+
timestamp?: string;
|
|
5
|
+
date?: string;
|
|
6
|
+
time?: string;
|
|
7
|
+
pad?: string;
|
|
8
|
+
width?: number;
|
|
9
|
+
decimals?: number;
|
|
10
|
+
currency?: any;
|
|
11
|
+
align?: "left" | "right";
|
|
12
|
+
};
|
|
13
|
+
export declare function templateFormatting(source: ICharacter | INumeric, options?: options): string;
|
|
14
|
+
export {};
|
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.templateFormatting = void 0;
|
|
4
|
-
const types_1 = require("./types");
|
|
5
|
-
function templateFormatting(source, options) {
|
|
6
|
-
let text = "";
|
|
7
|
-
if (source instanceof types_1.FieldSymbol) {
|
|
8
|
-
if (source.getPointer() === undefined) {
|
|
9
|
-
throw new Error("GETWA_NOT_ASSIGNED");
|
|
10
|
-
}
|
|
11
|
-
return templateFormatting(source.getPointer(), options);
|
|
12
|
-
}
|
|
13
|
-
else if (source instanceof types_1.Table) {
|
|
14
|
-
throw new Error("STRG_ILLEGAL_DATA_TYPE");
|
|
15
|
-
}
|
|
16
|
-
else if (source instanceof types_1.Character) {
|
|
17
|
-
text = source.getTrimEnd();
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
text = source.get() + "";
|
|
21
|
-
}
|
|
22
|
-
if ((options === null || options === void 0 ? void 0 : options.currency) !== undefined) {
|
|
23
|
-
throw "template formatting with currency not supported";
|
|
24
|
-
}
|
|
25
|
-
if ((options === null || options === void 0 ? void 0 : options.date) === "iso") {
|
|
26
|
-
text = text.substr(0, 4) + "-" + text.substr(4, 2) + "-" + text.substr(6, 2);
|
|
27
|
-
}
|
|
28
|
-
if ((options === null || options === void 0 ? void 0 : options.time) === "iso") {
|
|
29
|
-
text = text.substr(0, 2) + ":" + text.substr(2, 2) + ":" + text.substr(4, 2);
|
|
30
|
-
}
|
|
31
|
-
if ((options === null || options === void 0 ? void 0 : options.timestamp) === "iso") {
|
|
32
|
-
text = text.substr(0, 4) + "-" + text.substr(4, 2) + "-" + text.substr(6, 2) + "T" + text.substr(8, 2) + ":" + text.substr(10, 2) + ":" + text.substr(12, 2);
|
|
33
|
-
if (text === "0--T::") {
|
|
34
|
-
text = "0000-00-00T00:00:00";
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
else if ((options === null || options === void 0 ? void 0 : options.width) && options.pad) {
|
|
38
|
-
if (options.align === "right") {
|
|
39
|
-
text = text.trimEnd().padStart(options.width, options.pad);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
text = text.trimEnd().padEnd(options.width, options.pad);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
else if (options === null || options === void 0 ? void 0 : options.width) {
|
|
46
|
-
text = text.trimEnd().padEnd(options.width, " ");
|
|
47
|
-
}
|
|
48
|
-
else if ((options === null || options === void 0 ? void 0 : options.decimals) && source instanceof types_1.Integer) {
|
|
49
|
-
text = source.get().toFixed(options.decimals);
|
|
50
|
-
}
|
|
51
|
-
else if (source instanceof types_1.Packed) {
|
|
52
|
-
if (options === null || options === void 0 ? void 0 : options.decimals) {
|
|
53
|
-
text = source.get().toFixed(options.decimals);
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
text = source.get().toFixed(source.getDecimals());
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
else if ((options === null || options === void 0 ? void 0 : options.decimals) && source instanceof types_1.Float) {
|
|
60
|
-
text = source.getRaw().toFixed(options.decimals);
|
|
61
|
-
}
|
|
62
|
-
else if (source instanceof types_1.DecFloat34) {
|
|
63
|
-
const raw = source.getRaw();
|
|
64
|
-
if (Number.isInteger(raw)) {
|
|
65
|
-
text = raw.toFixed(0);
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
text = raw + "";
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
else if (source instanceof types_1.Float) {
|
|
72
|
-
const raw = source.getRaw();
|
|
73
|
-
if (Number.isInteger(raw)) {
|
|
74
|
-
text = raw.toFixed(0);
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
text = raw.toFixed(16);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return text;
|
|
81
|
-
}
|
|
82
|
-
exports.templateFormatting = templateFormatting;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.templateFormatting = void 0;
|
|
4
|
+
const types_1 = require("./types");
|
|
5
|
+
function templateFormatting(source, options) {
|
|
6
|
+
let text = "";
|
|
7
|
+
if (source instanceof types_1.FieldSymbol) {
|
|
8
|
+
if (source.getPointer() === undefined) {
|
|
9
|
+
throw new Error("GETWA_NOT_ASSIGNED");
|
|
10
|
+
}
|
|
11
|
+
return templateFormatting(source.getPointer(), options);
|
|
12
|
+
}
|
|
13
|
+
else if (source instanceof types_1.Table) {
|
|
14
|
+
throw new Error("STRG_ILLEGAL_DATA_TYPE");
|
|
15
|
+
}
|
|
16
|
+
else if (source instanceof types_1.Character) {
|
|
17
|
+
text = source.getTrimEnd();
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
text = source.get() + "";
|
|
21
|
+
}
|
|
22
|
+
if ((options === null || options === void 0 ? void 0 : options.currency) !== undefined) {
|
|
23
|
+
throw "template formatting with currency not supported";
|
|
24
|
+
}
|
|
25
|
+
if ((options === null || options === void 0 ? void 0 : options.date) === "iso") {
|
|
26
|
+
text = text.substr(0, 4) + "-" + text.substr(4, 2) + "-" + text.substr(6, 2);
|
|
27
|
+
}
|
|
28
|
+
if ((options === null || options === void 0 ? void 0 : options.time) === "iso") {
|
|
29
|
+
text = text.substr(0, 2) + ":" + text.substr(2, 2) + ":" + text.substr(4, 2);
|
|
30
|
+
}
|
|
31
|
+
if ((options === null || options === void 0 ? void 0 : options.timestamp) === "iso") {
|
|
32
|
+
text = text.substr(0, 4) + "-" + text.substr(4, 2) + "-" + text.substr(6, 2) + "T" + text.substr(8, 2) + ":" + text.substr(10, 2) + ":" + text.substr(12, 2);
|
|
33
|
+
if (text === "0--T::") {
|
|
34
|
+
text = "0000-00-00T00:00:00";
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
else if ((options === null || options === void 0 ? void 0 : options.width) && options.pad) {
|
|
38
|
+
if (options.align === "right") {
|
|
39
|
+
text = text.trimEnd().padStart(options.width, options.pad);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
text = text.trimEnd().padEnd(options.width, options.pad);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
else if (options === null || options === void 0 ? void 0 : options.width) {
|
|
46
|
+
text = text.trimEnd().padEnd(options.width, " ");
|
|
47
|
+
}
|
|
48
|
+
else if ((options === null || options === void 0 ? void 0 : options.decimals) && source instanceof types_1.Integer) {
|
|
49
|
+
text = source.get().toFixed(options.decimals);
|
|
50
|
+
}
|
|
51
|
+
else if (source instanceof types_1.Packed) {
|
|
52
|
+
if (options === null || options === void 0 ? void 0 : options.decimals) {
|
|
53
|
+
text = source.get().toFixed(options.decimals);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
text = source.get().toFixed(source.getDecimals());
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
else if ((options === null || options === void 0 ? void 0 : options.decimals) && source instanceof types_1.Float) {
|
|
60
|
+
text = source.getRaw().toFixed(options.decimals);
|
|
61
|
+
}
|
|
62
|
+
else if (source instanceof types_1.DecFloat34) {
|
|
63
|
+
const raw = source.getRaw();
|
|
64
|
+
if (Number.isInteger(raw)) {
|
|
65
|
+
text = raw.toFixed(0);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
text = raw + "";
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
else if (source instanceof types_1.Float) {
|
|
72
|
+
const raw = source.getRaw();
|
|
73
|
+
if (Number.isInteger(raw)) {
|
|
74
|
+
text = raw.toFixed(0);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
text = raw.toFixed(16);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return text;
|
|
81
|
+
}
|
|
82
|
+
exports.templateFormatting = templateFormatting;
|
|
83
83
|
//# sourceMappingURL=template_formatting.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function throwError(name: string): void;
|
|
1
|
+
export declare function throwError(name: string): void;
|