@fable-org/fable-library-ts 2.0.0-beta.6 → 2.0.0-beta.7
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 +4 -0
- package/System.Text.ts +10 -10
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,10 @@ 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-beta.7 - 2026-02-03
|
|
11
|
+
|
|
12
|
+
* [JS/TS] Fix `StringBuilder.Chars` getter and setter (by @MangelMaxime)
|
|
13
|
+
|
|
10
14
|
## 2.0.0-beta.6 - 2025-12-26
|
|
11
15
|
|
|
12
16
|
### 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 =
|
|
152
|
-
while ((
|
|
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 ((
|
|
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 = (
|
|
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 =
|
|
168
|
-
while ((
|
|
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 ((
|
|
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 = (
|
|
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
|
+
"version": "2.0.0-beta.7",
|
|
7
7
|
"description": "Core library used by F# projects compiled with fable.io",
|
|
8
8
|
"author": "Fable Contributors",
|
|
9
9
|
"license": "MIT",
|