@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,16 +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;
|
|
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
16
|
//# sourceMappingURL=numofchar.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ICharacter } from "../types/_character";
|
|
2
|
-
import { INumeric } from "../types/_numeric";
|
|
3
|
-
export declare function repeat(input: {
|
|
4
|
-
val: ICharacter | string;
|
|
5
|
-
occ: INumeric;
|
|
6
|
-
}): ICharacter;
|
|
1
|
+
import { ICharacter } from "../types/_character";
|
|
2
|
+
import { INumeric } from "../types/_numeric";
|
|
3
|
+
export declare function repeat(input: {
|
|
4
|
+
val: ICharacter | string;
|
|
5
|
+
occ: INumeric;
|
|
6
|
+
}): ICharacter;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.repeat = void 0;
|
|
4
|
-
const string_1 = require("../types/string");
|
|
5
|
-
function repeat(input) {
|
|
6
|
-
const val = typeof input.val === "string" ? input.val : input.val.get();
|
|
7
|
-
return new string_1.String().set(val.repeat(input.occ.get()));
|
|
8
|
-
}
|
|
9
|
-
exports.repeat = repeat;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.repeat = void 0;
|
|
4
|
+
const string_1 = require("../types/string");
|
|
5
|
+
function repeat(input) {
|
|
6
|
+
const val = typeof input.val === "string" ? input.val : input.val.get();
|
|
7
|
+
return new string_1.String().set(val.repeat(input.occ.get()));
|
|
8
|
+
}
|
|
9
|
+
exports.repeat = repeat;
|
|
10
10
|
//# sourceMappingURL=repeat.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ICharacter } from "../types/_character";
|
|
2
|
-
import { INumeric } from "../types/_numeric";
|
|
3
|
-
import { String } from "../types/string";
|
|
4
|
-
export interface IReplaceInput {
|
|
5
|
-
val: string | ICharacter;
|
|
6
|
-
sub?: string | ICharacter;
|
|
7
|
-
with?: string | ICharacter;
|
|
8
|
-
regex?: string | ICharacter;
|
|
9
|
-
off?: INumeric;
|
|
10
|
-
len?: INumeric;
|
|
11
|
-
occ?: INumeric;
|
|
12
|
-
}
|
|
13
|
-
export declare function replace(input: IReplaceInput): String;
|
|
1
|
+
import { ICharacter } from "../types/_character";
|
|
2
|
+
import { INumeric } from "../types/_numeric";
|
|
3
|
+
import { String } from "../types/string";
|
|
4
|
+
export interface IReplaceInput {
|
|
5
|
+
val: string | ICharacter;
|
|
6
|
+
sub?: string | ICharacter;
|
|
7
|
+
with?: string | ICharacter;
|
|
8
|
+
regex?: string | ICharacter;
|
|
9
|
+
off?: INumeric;
|
|
10
|
+
len?: INumeric;
|
|
11
|
+
occ?: INumeric;
|
|
12
|
+
}
|
|
13
|
+
export declare function replace(input: IReplaceInput): String;
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.replace = void 0;
|
|
4
|
-
const string_1 = require("../types/string");
|
|
5
|
-
const abap_regex_1 = require("../abap_regex");
|
|
6
|
-
const types_1 = require("../types");
|
|
7
|
-
function replace(input) {
|
|
8
|
-
let val = undefined;
|
|
9
|
-
if (typeof input.val === "string") {
|
|
10
|
-
val = input.val;
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
13
|
-
val = input.val.get();
|
|
14
|
-
}
|
|
15
|
-
let wi = undefined;
|
|
16
|
-
if (typeof input.with === "string") {
|
|
17
|
-
wi = input.with;
|
|
18
|
-
}
|
|
19
|
-
else if (input.with instanceof types_1.Character) {
|
|
20
|
-
wi = input.with.getTrimEnd();
|
|
21
|
-
}
|
|
22
|
-
else if (input.with) {
|
|
23
|
-
wi = input.with.get();
|
|
24
|
-
}
|
|
25
|
-
let sub = undefined;
|
|
26
|
-
if (typeof input.sub === "string") {
|
|
27
|
-
sub = input.sub;
|
|
28
|
-
}
|
|
29
|
-
else if (input.sub) {
|
|
30
|
-
sub = input.sub.get();
|
|
31
|
-
}
|
|
32
|
-
if (sub !== undefined) {
|
|
33
|
-
sub = sub.replace(/\\/g, "\\\\");
|
|
34
|
-
sub = sub.replace(/\[/g, "\\[");
|
|
35
|
-
}
|
|
36
|
-
if (typeof input.regex === "string") {
|
|
37
|
-
sub = new RegExp(abap_regex_1.ABAPRegExp.convert(input.regex), "g");
|
|
38
|
-
}
|
|
39
|
-
else if (input.regex) {
|
|
40
|
-
sub = new RegExp(abap_regex_1.ABAPRegExp.convert(input.regex.get()), "g");
|
|
41
|
-
}
|
|
42
|
-
if (input.off && input.len && typeof input.val === "string") {
|
|
43
|
-
const offset = input.off.get();
|
|
44
|
-
const length = input.len.get();
|
|
45
|
-
val = val.substring(0, offset) + wi + val.substring(offset + length);
|
|
46
|
-
}
|
|
47
|
-
else if (input.off && input.len && !(typeof input.val === "string")) {
|
|
48
|
-
const offset = input.off.get();
|
|
49
|
-
const length = input.len.get();
|
|
50
|
-
val = input.val.getOffset({ offset: 0, length: offset }).get() +
|
|
51
|
-
wi +
|
|
52
|
-
input.val.getOffset({ offset: offset + length }).get();
|
|
53
|
-
}
|
|
54
|
-
else if (input.occ === undefined && sub && wi) {
|
|
55
|
-
val = val.replace(sub, wi);
|
|
56
|
-
}
|
|
57
|
-
else if (input.occ && input.occ.get() === 0 && sub && wi !== undefined) {
|
|
58
|
-
if (typeof sub === "string") {
|
|
59
|
-
sub = new RegExp(sub, "g");
|
|
60
|
-
}
|
|
61
|
-
val = val.replace(sub, wi);
|
|
62
|
-
}
|
|
63
|
-
return new string_1.String().set(val);
|
|
64
|
-
}
|
|
65
|
-
exports.replace = replace;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.replace = void 0;
|
|
4
|
+
const string_1 = require("../types/string");
|
|
5
|
+
const abap_regex_1 = require("../abap_regex");
|
|
6
|
+
const types_1 = require("../types");
|
|
7
|
+
function replace(input) {
|
|
8
|
+
let val = undefined;
|
|
9
|
+
if (typeof input.val === "string") {
|
|
10
|
+
val = input.val;
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
val = input.val.get();
|
|
14
|
+
}
|
|
15
|
+
let wi = undefined;
|
|
16
|
+
if (typeof input.with === "string") {
|
|
17
|
+
wi = input.with;
|
|
18
|
+
}
|
|
19
|
+
else if (input.with instanceof types_1.Character) {
|
|
20
|
+
wi = input.with.getTrimEnd();
|
|
21
|
+
}
|
|
22
|
+
else if (input.with) {
|
|
23
|
+
wi = input.with.get();
|
|
24
|
+
}
|
|
25
|
+
let sub = undefined;
|
|
26
|
+
if (typeof input.sub === "string") {
|
|
27
|
+
sub = input.sub;
|
|
28
|
+
}
|
|
29
|
+
else if (input.sub) {
|
|
30
|
+
sub = input.sub.get();
|
|
31
|
+
}
|
|
32
|
+
if (sub !== undefined) {
|
|
33
|
+
sub = sub.replace(/\\/g, "\\\\");
|
|
34
|
+
sub = sub.replace(/\[/g, "\\[");
|
|
35
|
+
}
|
|
36
|
+
if (typeof input.regex === "string") {
|
|
37
|
+
sub = new RegExp(abap_regex_1.ABAPRegExp.convert(input.regex), "g");
|
|
38
|
+
}
|
|
39
|
+
else if (input.regex) {
|
|
40
|
+
sub = new RegExp(abap_regex_1.ABAPRegExp.convert(input.regex.get()), "g");
|
|
41
|
+
}
|
|
42
|
+
if (input.off && input.len && typeof input.val === "string") {
|
|
43
|
+
const offset = input.off.get();
|
|
44
|
+
const length = input.len.get();
|
|
45
|
+
val = val.substring(0, offset) + wi + val.substring(offset + length);
|
|
46
|
+
}
|
|
47
|
+
else if (input.off && input.len && !(typeof input.val === "string")) {
|
|
48
|
+
const offset = input.off.get();
|
|
49
|
+
const length = input.len.get();
|
|
50
|
+
val = input.val.getOffset({ offset: 0, length: offset }).get() +
|
|
51
|
+
wi +
|
|
52
|
+
input.val.getOffset({ offset: offset + length }).get();
|
|
53
|
+
}
|
|
54
|
+
else if (input.occ === undefined && sub && wi) {
|
|
55
|
+
val = val.replace(sub, wi);
|
|
56
|
+
}
|
|
57
|
+
else if (input.occ && input.occ.get() === 0 && sub && wi !== undefined) {
|
|
58
|
+
if (typeof sub === "string") {
|
|
59
|
+
sub = new RegExp(sub, "g");
|
|
60
|
+
}
|
|
61
|
+
val = val.replace(sub, wi);
|
|
62
|
+
}
|
|
63
|
+
return new string_1.String().set(val);
|
|
64
|
+
}
|
|
65
|
+
exports.replace = replace;
|
|
66
66
|
//# sourceMappingURL=replace.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { String } from "../types";
|
|
2
|
-
import { ICharacter } from "../types/_character";
|
|
3
|
-
export declare function reverse(input: {
|
|
4
|
-
val: ICharacter | string;
|
|
5
|
-
}): String;
|
|
1
|
+
import { String } from "../types";
|
|
2
|
+
import { ICharacter } from "../types/_character";
|
|
3
|
+
export declare function reverse(input: {
|
|
4
|
+
val: ICharacter | string;
|
|
5
|
+
}): String;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.reverse = void 0;
|
|
4
|
-
const types_1 = require("../types");
|
|
5
|
-
function reverse(input) {
|
|
6
|
-
let val = "";
|
|
7
|
-
if (typeof input.val === "string") {
|
|
8
|
-
val = input.val;
|
|
9
|
-
}
|
|
10
|
-
else {
|
|
11
|
-
val = input.val.get();
|
|
12
|
-
}
|
|
13
|
-
val = val.split("").reverse().join("");
|
|
14
|
-
return new types_1.String().set(val);
|
|
15
|
-
}
|
|
16
|
-
exports.reverse = reverse;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.reverse = void 0;
|
|
4
|
+
const types_1 = require("../types");
|
|
5
|
+
function reverse(input) {
|
|
6
|
+
let val = "";
|
|
7
|
+
if (typeof input.val === "string") {
|
|
8
|
+
val = input.val;
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
val = input.val.get();
|
|
12
|
+
}
|
|
13
|
+
val = val.split("").reverse().join("");
|
|
14
|
+
return new types_1.String().set(val);
|
|
15
|
+
}
|
|
16
|
+
exports.reverse = reverse;
|
|
17
17
|
//# sourceMappingURL=reverse.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Float } from "../types";
|
|
2
|
-
import { ICharacter } from "../types/_character";
|
|
3
|
-
import { INumeric } from "../types/_numeric";
|
|
4
|
-
export declare function round(input: {
|
|
5
|
-
val: ICharacter | string;
|
|
6
|
-
dec: INumeric | number;
|
|
7
|
-
mode?: INumeric | number;
|
|
8
|
-
}): Float;
|
|
1
|
+
import { Float } from "../types";
|
|
2
|
+
import { ICharacter } from "../types/_character";
|
|
3
|
+
import { INumeric } from "../types/_numeric";
|
|
4
|
+
export declare function round(input: {
|
|
5
|
+
val: ICharacter | string;
|
|
6
|
+
dec: INumeric | number;
|
|
7
|
+
mode?: INumeric | number;
|
|
8
|
+
}): Float;
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.round = void 0;
|
|
4
|
-
const _parse_1 = require("../operators/_parse");
|
|
5
|
-
const types_1 = require("../types");
|
|
6
|
-
function round(input) {
|
|
7
|
-
let mode = input.mode;
|
|
8
|
-
if (mode === undefined) {
|
|
9
|
-
mode = 2;
|
|
10
|
-
}
|
|
11
|
-
else if (typeof mode !== "number") {
|
|
12
|
-
mode = mode === null || mode === void 0 ? void 0 : mode.get();
|
|
13
|
-
}
|
|
14
|
-
const val = (0, _parse_1.parse)(input.val);
|
|
15
|
-
const dec = (0, _parse_1.parse)(input.dec);
|
|
16
|
-
if (dec !== 0) {
|
|
17
|
-
throw "round(), todo, handle decimals";
|
|
18
|
-
}
|
|
19
|
-
const ret = new types_1.Float();
|
|
20
|
-
switch (mode) {
|
|
21
|
-
case 1:
|
|
22
|
-
ret.set(Math.ceil(val));
|
|
23
|
-
break;
|
|
24
|
-
case 2:
|
|
25
|
-
ret.set(Math.round(val));
|
|
26
|
-
break;
|
|
27
|
-
case 4:
|
|
28
|
-
ret.set(-Math.round(-val));
|
|
29
|
-
break;
|
|
30
|
-
case 5:
|
|
31
|
-
ret.set(Math.trunc(val));
|
|
32
|
-
break;
|
|
33
|
-
case 6:
|
|
34
|
-
ret.set(Math.floor(val));
|
|
35
|
-
break;
|
|
36
|
-
default:
|
|
37
|
-
throw "round(), unknown mode: " + mode;
|
|
38
|
-
}
|
|
39
|
-
return ret;
|
|
40
|
-
}
|
|
41
|
-
exports.round = round;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.round = void 0;
|
|
4
|
+
const _parse_1 = require("../operators/_parse");
|
|
5
|
+
const types_1 = require("../types");
|
|
6
|
+
function round(input) {
|
|
7
|
+
let mode = input.mode;
|
|
8
|
+
if (mode === undefined) {
|
|
9
|
+
mode = 2;
|
|
10
|
+
}
|
|
11
|
+
else if (typeof mode !== "number") {
|
|
12
|
+
mode = mode === null || mode === void 0 ? void 0 : mode.get();
|
|
13
|
+
}
|
|
14
|
+
const val = (0, _parse_1.parse)(input.val);
|
|
15
|
+
const dec = (0, _parse_1.parse)(input.dec);
|
|
16
|
+
if (dec !== 0) {
|
|
17
|
+
throw "round(), todo, handle decimals";
|
|
18
|
+
}
|
|
19
|
+
const ret = new types_1.Float();
|
|
20
|
+
switch (mode) {
|
|
21
|
+
case 1:
|
|
22
|
+
ret.set(Math.ceil(val));
|
|
23
|
+
break;
|
|
24
|
+
case 2:
|
|
25
|
+
ret.set(Math.round(val));
|
|
26
|
+
break;
|
|
27
|
+
case 4:
|
|
28
|
+
ret.set(-Math.round(-val));
|
|
29
|
+
break;
|
|
30
|
+
case 5:
|
|
31
|
+
ret.set(Math.trunc(val));
|
|
32
|
+
break;
|
|
33
|
+
case 6:
|
|
34
|
+
ret.set(Math.floor(val));
|
|
35
|
+
break;
|
|
36
|
+
default:
|
|
37
|
+
throw "round(), unknown mode: " + mode;
|
|
38
|
+
}
|
|
39
|
+
return ret;
|
|
40
|
+
}
|
|
41
|
+
exports.round = round;
|
|
42
42
|
//# sourceMappingURL=round.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { String } from "../types";
|
|
2
|
-
import { ICharacter } from "../types/_character";
|
|
3
|
-
import { INumeric } from "../types/_numeric";
|
|
4
|
-
export declare function segment(input: {
|
|
5
|
-
val: ICharacter | string;
|
|
6
|
-
index: INumeric | number;
|
|
7
|
-
sep: ICharacter | string;
|
|
8
|
-
}): String;
|
|
1
|
+
import { String } from "../types";
|
|
2
|
+
import { ICharacter } from "../types/_character";
|
|
3
|
+
import { INumeric } from "../types/_numeric";
|
|
4
|
+
export declare function segment(input: {
|
|
5
|
+
val: ICharacter | string;
|
|
6
|
+
index: INumeric | number;
|
|
7
|
+
sep: ICharacter | string;
|
|
8
|
+
}): String;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.segment = void 0;
|
|
4
|
-
const throw_error_1 = require("../throw_error");
|
|
5
|
-
const types_1 = require("../types");
|
|
6
|
-
function segment(input) {
|
|
7
|
-
let val = input.val;
|
|
8
|
-
if (typeof val !== "string") {
|
|
9
|
-
val = val.get();
|
|
10
|
-
}
|
|
11
|
-
let sep = input.sep;
|
|
12
|
-
if (typeof sep !== "string") {
|
|
13
|
-
sep = sep.get();
|
|
14
|
-
}
|
|
15
|
-
let index = input.index;
|
|
16
|
-
if (typeof index !== "number") {
|
|
17
|
-
index = index.get();
|
|
18
|
-
}
|
|
19
|
-
if (index === 0 || sep.length === 0) {
|
|
20
|
-
(0, throw_error_1.throwError)("CX_SY_STRG_PAR_VAL");
|
|
21
|
-
}
|
|
22
|
-
const array = val.split(sep);
|
|
23
|
-
if (index < 0) {
|
|
24
|
-
array.reverse();
|
|
25
|
-
index = Math.abs(index);
|
|
26
|
-
}
|
|
27
|
-
if (index > array.length) {
|
|
28
|
-
(0, throw_error_1.throwError)("CX_SY_STRG_PAR_VAL");
|
|
29
|
-
}
|
|
30
|
-
return new types_1.String().set(array[index - 1]);
|
|
31
|
-
}
|
|
32
|
-
exports.segment = segment;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.segment = void 0;
|
|
4
|
+
const throw_error_1 = require("../throw_error");
|
|
5
|
+
const types_1 = require("../types");
|
|
6
|
+
function segment(input) {
|
|
7
|
+
let val = input.val;
|
|
8
|
+
if (typeof val !== "string") {
|
|
9
|
+
val = val.get();
|
|
10
|
+
}
|
|
11
|
+
let sep = input.sep;
|
|
12
|
+
if (typeof sep !== "string") {
|
|
13
|
+
sep = sep.get();
|
|
14
|
+
}
|
|
15
|
+
let index = input.index;
|
|
16
|
+
if (typeof index !== "number") {
|
|
17
|
+
index = index.get();
|
|
18
|
+
}
|
|
19
|
+
if (index === 0 || sep.length === 0) {
|
|
20
|
+
(0, throw_error_1.throwError)("CX_SY_STRG_PAR_VAL");
|
|
21
|
+
}
|
|
22
|
+
const array = val.split(sep);
|
|
23
|
+
if (index < 0) {
|
|
24
|
+
array.reverse();
|
|
25
|
+
index = Math.abs(index);
|
|
26
|
+
}
|
|
27
|
+
if (index > array.length) {
|
|
28
|
+
(0, throw_error_1.throwError)("CX_SY_STRG_PAR_VAL");
|
|
29
|
+
}
|
|
30
|
+
return new types_1.String().set(array[index - 1]);
|
|
31
|
+
}
|
|
32
|
+
exports.segment = segment;
|
|
33
33
|
//# sourceMappingURL=segment.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ICharacter } from "../types/_character";
|
|
2
|
-
import { INumeric } from "../types/_numeric";
|
|
3
|
-
export interface IShiftLeftInput {
|
|
4
|
-
val: ICharacter | string;
|
|
5
|
-
sub?: ICharacter | string;
|
|
6
|
-
places?: ICharacter | INumeric | string;
|
|
7
|
-
circular?: INumeric;
|
|
8
|
-
}
|
|
9
|
-
export declare function shift_left(input: IShiftLeftInput): ICharacter;
|
|
1
|
+
import { ICharacter } from "../types/_character";
|
|
2
|
+
import { INumeric } from "../types/_numeric";
|
|
3
|
+
export interface IShiftLeftInput {
|
|
4
|
+
val: ICharacter | string;
|
|
5
|
+
sub?: ICharacter | string;
|
|
6
|
+
places?: ICharacter | INumeric | string;
|
|
7
|
+
circular?: INumeric;
|
|
8
|
+
}
|
|
9
|
+
export declare function shift_left(input: IShiftLeftInput): ICharacter;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.shift_left = void 0;
|
|
4
|
-
const string_1 = require("../types/string");
|
|
5
|
-
const throw_error_1 = require("../throw_error");
|
|
6
|
-
function shift_left(input) {
|
|
7
|
-
let val = typeof input.val === "string" ? input.val : input.val.get();
|
|
8
|
-
if (input.sub) {
|
|
9
|
-
const sub = typeof input.sub === "string" ? input.sub : input.sub.get();
|
|
10
|
-
while (val.startsWith(sub)) {
|
|
11
|
-
val = val.substr(sub.length);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
else if (input.places) {
|
|
15
|
-
let places = typeof input.places === "string" ? input.places : input.places.get();
|
|
16
|
-
if (typeof places === "string") {
|
|
17
|
-
places = parseInt(places, 10);
|
|
18
|
-
}
|
|
19
|
-
if (places > val.length) {
|
|
20
|
-
(0, throw_error_1.throwError)("CX_SY_RANGE_OUT_OF_BOUNDS");
|
|
21
|
-
}
|
|
22
|
-
val = val.substring(places);
|
|
23
|
-
}
|
|
24
|
-
else if (input.circular) {
|
|
25
|
-
const leftShifts = input.circular.get() % val.length;
|
|
26
|
-
val = val.slice(leftShifts) + val.slice(0, leftShifts);
|
|
27
|
-
}
|
|
28
|
-
return new string_1.String().set(val);
|
|
29
|
-
}
|
|
30
|
-
exports.shift_left = shift_left;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.shift_left = void 0;
|
|
4
|
+
const string_1 = require("../types/string");
|
|
5
|
+
const throw_error_1 = require("../throw_error");
|
|
6
|
+
function shift_left(input) {
|
|
7
|
+
let val = typeof input.val === "string" ? input.val : input.val.get();
|
|
8
|
+
if (input.sub) {
|
|
9
|
+
const sub = typeof input.sub === "string" ? input.sub : input.sub.get();
|
|
10
|
+
while (val.startsWith(sub)) {
|
|
11
|
+
val = val.substr(sub.length);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
else if (input.places) {
|
|
15
|
+
let places = typeof input.places === "string" ? input.places : input.places.get();
|
|
16
|
+
if (typeof places === "string") {
|
|
17
|
+
places = parseInt(places, 10);
|
|
18
|
+
}
|
|
19
|
+
if (places > val.length) {
|
|
20
|
+
(0, throw_error_1.throwError)("CX_SY_RANGE_OUT_OF_BOUNDS");
|
|
21
|
+
}
|
|
22
|
+
val = val.substring(places);
|
|
23
|
+
}
|
|
24
|
+
else if (input.circular) {
|
|
25
|
+
const leftShifts = input.circular.get() % val.length;
|
|
26
|
+
val = val.slice(leftShifts) + val.slice(0, leftShifts);
|
|
27
|
+
}
|
|
28
|
+
return new string_1.String().set(val);
|
|
29
|
+
}
|
|
30
|
+
exports.shift_left = shift_left;
|
|
31
31
|
//# sourceMappingURL=shift_left.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ICharacter } from "../types/_character";
|
|
2
|
-
import { INumeric } from "../types/_numeric";
|
|
3
|
-
export declare function sign(input: {
|
|
4
|
-
val: number | string | ICharacter | INumeric;
|
|
5
|
-
}): number;
|
|
1
|
+
import { ICharacter } from "../types/_character";
|
|
2
|
+
import { INumeric } from "../types/_numeric";
|
|
3
|
+
export declare function sign(input: {
|
|
4
|
+
val: number | string | ICharacter | INumeric;
|
|
5
|
+
}): number;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sign = void 0;
|
|
4
|
-
function sign(input) {
|
|
5
|
-
let num_in = undefined;
|
|
6
|
-
if (typeof input.val === "number") {
|
|
7
|
-
num_in = input.val;
|
|
8
|
-
}
|
|
9
|
-
else if (typeof input.val === "string") {
|
|
10
|
-
num_in = parseFloat(input.val);
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
13
|
-
num_in = parseFloat(input.val.get().toString());
|
|
14
|
-
}
|
|
15
|
-
return Math.sign(num_in);
|
|
16
|
-
}
|
|
17
|
-
exports.sign = sign;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sign = void 0;
|
|
4
|
+
function sign(input) {
|
|
5
|
+
let num_in = undefined;
|
|
6
|
+
if (typeof input.val === "number") {
|
|
7
|
+
num_in = input.val;
|
|
8
|
+
}
|
|
9
|
+
else if (typeof input.val === "string") {
|
|
10
|
+
num_in = parseFloat(input.val);
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
num_in = parseFloat(input.val.get().toString());
|
|
14
|
+
}
|
|
15
|
+
return Math.sign(num_in);
|
|
16
|
+
}
|
|
17
|
+
exports.sign = sign;
|
|
18
18
|
//# sourceMappingURL=sign.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ICharacter } from "../types/_character";
|
|
2
|
-
import { INumeric } from "../types/_numeric";
|
|
3
|
-
export declare function sin(input: {
|
|
4
|
-
val: number | string | ICharacter | INumeric;
|
|
5
|
-
}): number;
|
|
1
|
+
import { ICharacter } from "../types/_character";
|
|
2
|
+
import { INumeric } from "../types/_numeric";
|
|
3
|
+
export declare function sin(input: {
|
|
4
|
+
val: number | string | ICharacter | INumeric;
|
|
5
|
+
}): number;
|
package/build/src/builtin/sin.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sin = void 0;
|
|
4
|
-
/* eslint-disable radix */
|
|
5
|
-
const types_1 = require("../types");
|
|
6
|
-
function sin(input) {
|
|
7
|
-
let num_in = undefined;
|
|
8
|
-
if (typeof input.val === "number") {
|
|
9
|
-
num_in = input.val;
|
|
10
|
-
}
|
|
11
|
-
else if (typeof input.val === "string") {
|
|
12
|
-
num_in = parseFloat(input.val);
|
|
13
|
-
}
|
|
14
|
-
else if (input.val instanceof types_1.Float) {
|
|
15
|
-
num_in = input.val.getRaw();
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
num_in = parseFloat(input.val.get().toString());
|
|
19
|
-
}
|
|
20
|
-
return Math.sin(num_in);
|
|
21
|
-
}
|
|
22
|
-
exports.sin = sin;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sin = void 0;
|
|
4
|
+
/* eslint-disable radix */
|
|
5
|
+
const types_1 = require("../types");
|
|
6
|
+
function sin(input) {
|
|
7
|
+
let num_in = undefined;
|
|
8
|
+
if (typeof input.val === "number") {
|
|
9
|
+
num_in = input.val;
|
|
10
|
+
}
|
|
11
|
+
else if (typeof input.val === "string") {
|
|
12
|
+
num_in = parseFloat(input.val);
|
|
13
|
+
}
|
|
14
|
+
else if (input.val instanceof types_1.Float) {
|
|
15
|
+
num_in = input.val.getRaw();
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
num_in = parseFloat(input.val.get().toString());
|
|
19
|
+
}
|
|
20
|
+
return Math.sin(num_in);
|
|
21
|
+
}
|
|
22
|
+
exports.sin = sin;
|
|
23
23
|
//# sourceMappingURL=sin.js.map
|