@abaplint/runtime 2.7.163 → 2.7.165
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/abs.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.abs = void 0;
|
|
4
|
+
/* eslint-disable radix */
|
|
5
|
+
const types_1 = require("../types");
|
|
4
6
|
function abs(input) {
|
|
5
7
|
let num_in = undefined;
|
|
6
8
|
if (typeof input.val === "number") {
|
|
@@ -9,6 +11,9 @@ function abs(input) {
|
|
|
9
11
|
else if (typeof input.val === "string") {
|
|
10
12
|
num_in = parseFloat(input.val);
|
|
11
13
|
}
|
|
14
|
+
else if (input.val instanceof types_1.Float) {
|
|
15
|
+
num_in = input.val.getRaw();
|
|
16
|
+
}
|
|
12
17
|
else {
|
|
13
18
|
num_in = parseFloat(input.val.get().toString());
|
|
14
19
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.trunc = void 0;
|
|
4
|
+
/* eslint-disable radix */
|
|
5
|
+
const types_1 = require("../types");
|
|
4
6
|
function trunc(input) {
|
|
5
7
|
let num_in = undefined;
|
|
6
8
|
if (typeof input.val === "number") {
|
|
@@ -9,6 +11,9 @@ function trunc(input) {
|
|
|
9
11
|
else if (typeof input.val === "string") {
|
|
10
12
|
num_in = parseFloat(input.val);
|
|
11
13
|
}
|
|
14
|
+
else if (input.val instanceof types_1.Float) {
|
|
15
|
+
num_in = input.val.getRaw();
|
|
16
|
+
}
|
|
12
17
|
else {
|
|
13
18
|
num_in = parseFloat(input.val.get().toString());
|
|
14
19
|
}
|
|
@@ -32,6 +32,7 @@ function templateFormatting(source, options) {
|
|
|
32
32
|
const raw = source.getRaw();
|
|
33
33
|
if ((options === null || options === void 0 ? void 0 : options.style) === "scientific") {
|
|
34
34
|
text = raw.toExponential().toUpperCase();
|
|
35
|
+
text = text.replace(/([+-])(\d)$/, "$10$2");
|
|
35
36
|
}
|
|
36
37
|
else if (Number.isInteger(raw)) {
|
|
37
38
|
text = raw.toFixed(0);
|
|
@@ -55,6 +55,7 @@ class FieldSymbol {
|
|
|
55
55
|
const pt = this.pointer;
|
|
56
56
|
if (pt instanceof float_1.Float) {
|
|
57
57
|
const buf = Buffer.allocUnsafe(8);
|
|
58
|
+
// CASTING is platform specific, so perhaps add a setting? But anyhow its not something developers should use
|
|
58
59
|
buf.writeDoubleLE(pt.getRaw());
|
|
59
60
|
return buf.toString("hex").toUpperCase();
|
|
60
61
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/runtime",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.165",
|
|
4
4
|
"description": "Transpiler - Runtime",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/src/index.d.ts",
|
|
@@ -37,6 +37,6 @@
|
|
|
37
37
|
"typescript": "^5.3.3"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"temporal-polyfill": "^0.2.
|
|
40
|
+
"temporal-polyfill": "^0.2.3"
|
|
41
41
|
}
|
|
42
42
|
}
|