@fable-org/fable-library-js 1.4.1 → 1.4.2

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/BigInt.js CHANGED
@@ -111,10 +111,11 @@ export function toFloat16(x) { return Number(x); }
111
111
  export function toFloat32(x) { return Number(x); }
112
112
  export function toFloat64(x) { return Number(x); }
113
113
  export function toDecimal(x) {
114
- const low = Number(BigInt.asUintN(32, x));
115
- const mid = Number(BigInt.asUintN(32, x >> 32n));
116
- const high = Number(BigInt.asUintN(32, x >> 64n));
117
114
  const isNegative = x < zero;
115
+ const bits = abs(x);
116
+ const low = Number(BigInt.asUintN(32, bits));
117
+ const mid = Number(BigInt.asUintN(32, bits >> 32n));
118
+ const high = Number(BigInt.asUintN(32, bits >> 64n));
118
119
  const scale = 0;
119
120
  return fromParts(low, mid, high, isNegative, scale);
120
121
  }
package/CHANGELOG.md CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## Unreleased
9
9
 
10
+ ## 1.4.2 - 2024-06-13
11
+
12
+ ### Fixed
13
+
14
+ * [JS/TS] Fixed BigInt.ToDecimal with negative values (#3500) (by @ncave)
15
+
10
16
  ## 1.4.1 - 2024-06-13
11
17
 
12
18
  ### Fixed
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "private": false,
4
4
  "type": "module",
5
5
  "name": "@fable-org/fable-library-js",
6
- "version": "1.4.1",
6
+ "version": "1.4.2",
7
7
  "description": "Core library used by F# projects compiled with fable.io",
8
8
  "author": "Fable Contributors",
9
9
  "license": "MIT",