@fable-org/fable-library-ts 2.0.0-beta.6 → 2.0.0-rc.1

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/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
+ ## 2.0.0-rc.1 - 2026-02-26
11
+
12
+ ## 2.0.0-beta.7 - 2026-02-03
13
+
14
+ * [JS/TS] Fix `StringBuilder.Chars` getter and setter (by @MangelMaxime)
15
+
10
16
  ## 2.0.0-beta.6 - 2025-12-26
11
17
 
12
18
  ### Fixed
package/System.Text.ts CHANGED
@@ -148,32 +148,32 @@ export function StringBuilder__Clear(x: StringBuilder): StringBuilder {
148
148
 
149
149
  export function StringBuilder__get_Chars_Z524259A4(x: StringBuilder, index: int32): string {
150
150
  let len = 0;
151
- let i = -1;
152
- while (((i + 1) < x.buf.length) && (len < index)) {
153
- i = ((i + 1) | 0);
151
+ let i = 0;
152
+ while ((i < x.buf.length) && ((len + x.buf[i].length) <= index)) {
154
153
  len = ((len + x.buf[i].length) | 0);
154
+ i = ((i + 1) | 0);
155
155
  }
156
- if (((index < 0) ? true : (i < 0)) ? true : (i >= x.buf.length)) {
156
+ if ((index < 0) ? true : (i >= x.buf.length)) {
157
157
  throw new Exception("Index was outside the bounds of the array");
158
158
  }
159
159
  else {
160
- const pos: int32 = ((len - index) - 1) | 0;
160
+ const pos: int32 = (index - len) | 0;
161
161
  return x.buf[i][pos];
162
162
  }
163
163
  }
164
164
 
165
165
  export function StringBuilder__set_Chars_413E0D0A(x: StringBuilder, index: int32, value: string): void {
166
166
  let len = 0;
167
- let i = -1;
168
- while (((i + 1) < x.buf.length) && (len < index)) {
169
- i = ((i + 1) | 0);
167
+ let i = 0;
168
+ while ((i < x.buf.length) && ((len + x.buf[i].length) <= index)) {
170
169
  len = ((len + x.buf[i].length) | 0);
170
+ i = ((i + 1) | 0);
171
171
  }
172
- if (((index < 0) ? true : (i < 0)) ? true : (i >= x.buf.length)) {
172
+ if ((index < 0) ? true : (i >= x.buf.length)) {
173
173
  throw new Exception("Index was outside the bounds of the array");
174
174
  }
175
175
  else {
176
- const pos: int32 = ((len - index) - 1) | 0;
176
+ const pos: int32 = (index - len) | 0;
177
177
  x.buf[i] = ((x.buf[i].slice(0, (pos - 1) + 1) + value) + x.buf[i].slice(pos + 1, x.buf[i].length));
178
178
  }
179
179
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "private": false,
4
4
  "type": "module",
5
5
  "name": "@fable-org/fable-library-ts",
6
- "version": "2.0.0-beta.6",
6
+ "version": "2.0.0-rc.1",
7
7
  "description": "Core library used by F# projects compiled with fable.io",
8
8
  "author": "Fable Contributors",
9
9
  "license": "MIT",