@fable-org/fable-library-ts 1.10.0 → 2.0.0-beta.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/Array.ts +1378 -1378
- package/Async.ts +13 -14
- package/BigInt.ts +48 -22
- package/CHANGELOG.md +18 -1
- package/Choice.ts +301 -301
- package/Date.ts +47 -41
- package/Decimal.ts +29 -1
- package/FSharp.Collections.ts +34 -34
- package/FSharp.Core.CompilerServices.ts +37 -37
- package/FSharp.Core.ts +184 -184
- package/Global.ts +37 -37
- package/List.ts +1417 -1417
- package/Map.ts +1552 -1552
- package/MapUtil.ts +3 -0
- package/MutableMap.ts +345 -345
- package/MutableSet.ts +249 -249
- package/Native.ts +11 -11
- package/Numeric.ts +8 -3
- package/Random.ts +181 -181
- package/Range.ts +56 -56
- package/Result.ts +196 -196
- package/Seq.ts +1525 -1525
- package/Seq2.ts +129 -129
- package/Set.ts +1955 -1955
- package/String.ts +81 -10
- package/System.Collections.Generic.ts +380 -380
- package/System.Text.ts +203 -203
- package/Types.ts +1 -1
- package/package.json +1 -1
package/System.Text.ts
CHANGED
|
@@ -1,203 +1,203 @@
|
|
|
1
|
-
import { replace, format, replicate, substring, isNullOrEmpty, join } from "./String.js";
|
|
2
|
-
import { float64, int32 } from "./Int32.js";
|
|
3
|
-
import { class_type, TypeInfo } from "./Reflection.js";
|
|
4
|
-
import { clear, int32ToString } from "./Util.js";
|
|
5
|
-
import { toString } from "./Types.js";
|
|
6
|
-
|
|
7
|
-
export class StringBuilder {
|
|
8
|
-
readonly buf: string[];
|
|
9
|
-
constructor(value: string, capacity: int32) {
|
|
10
|
-
this.buf = [];
|
|
11
|
-
if (!isNullOrEmpty(value)) {
|
|
12
|
-
void (this.buf.push(value));
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
toString(): string {
|
|
16
|
-
const _: StringBuilder = this;
|
|
17
|
-
return join("", _.buf);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function StringBuilder_$reflection(): TypeInfo {
|
|
22
|
-
return class_type("System.Text.StringBuilder", undefined, StringBuilder);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function StringBuilder_$ctor_Z18115A39(value: string, capacity: int32): StringBuilder {
|
|
26
|
-
return new StringBuilder(value, capacity);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export function StringBuilder_$ctor_Z524259A4(capacity: int32): StringBuilder {
|
|
30
|
-
return StringBuilder_$ctor_Z18115A39("", capacity);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export function StringBuilder_$ctor_Z721C83C5(value: string): StringBuilder {
|
|
34
|
-
return StringBuilder_$ctor_Z18115A39(value, 16);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export function StringBuilder_$ctor(): StringBuilder {
|
|
38
|
-
return StringBuilder_$ctor_Z18115A39("", 16);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function StringBuilder__Append_Z721C83C5(x: StringBuilder, s: string): StringBuilder {
|
|
42
|
-
void (x.buf.push(s));
|
|
43
|
-
return x;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export function StringBuilder__Append_487EF8FB(x: StringBuilder, s: string, startIndex: int32, count: int32): StringBuilder {
|
|
47
|
-
void (x.buf.push(substring(s, startIndex, count)));
|
|
48
|
-
return x;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export function StringBuilder__Append_244C7CD6(x: StringBuilder, c: string): StringBuilder {
|
|
52
|
-
void (x.buf.push(c));
|
|
53
|
-
return x;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export function StringBuilder__Append_61B1CA(x: StringBuilder, c: string, repeatCount: int32): StringBuilder {
|
|
57
|
-
const s: string = replicate(repeatCount, c);
|
|
58
|
-
void (x.buf.push(s));
|
|
59
|
-
return x;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export function StringBuilder__Append_Z524259A4(x: StringBuilder, o: int32): StringBuilder {
|
|
63
|
-
void (x.buf.push(int32ToString(o)));
|
|
64
|
-
return x;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export function StringBuilder__Append_5E38073B(x: StringBuilder, o: float64): StringBuilder {
|
|
68
|
-
void (x.buf.push(o.toString()));
|
|
69
|
-
return x;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export function StringBuilder__Append_Z1FBCCD16(x: StringBuilder, o: boolean): StringBuilder {
|
|
73
|
-
void (x.buf.push(toString(o)));
|
|
74
|
-
return x;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export function StringBuilder__Append_4E60E31B(x: StringBuilder, o: any): StringBuilder {
|
|
78
|
-
void (x.buf.push(toString(o)));
|
|
79
|
-
return x;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export function StringBuilder__Append_Z372E4D23(x: StringBuilder, cs: string[]): StringBuilder {
|
|
83
|
-
void (x.buf.push(cs.join('')));
|
|
84
|
-
return x;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export function StringBuilder__Append_43A65C09(x: StringBuilder, s: StringBuilder): StringBuilder {
|
|
88
|
-
void (x.buf.push(toString(s)));
|
|
89
|
-
return x;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export function StringBuilder__AppendFormat_433E080(x: StringBuilder, fmt: string, o: any): StringBuilder {
|
|
93
|
-
void (x.buf.push(format(fmt, o)));
|
|
94
|
-
return x;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export function StringBuilder__AppendFormat_Z3B30EC65(x: StringBuilder, fmt: string, o1: any, o2: any): StringBuilder {
|
|
98
|
-
void (x.buf.push(format(fmt, o1, o2)));
|
|
99
|
-
return x;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export function StringBuilder__AppendFormat_10D165E0(x: StringBuilder, fmt: string, o1: any, o2: any, o3: any): StringBuilder {
|
|
103
|
-
void (x.buf.push(format(fmt, o1, o2, o3)));
|
|
104
|
-
return x;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export function StringBuilder__AppendFormat_Z17053F5(x: StringBuilder, fmt: string, arr: any[]): StringBuilder {
|
|
108
|
-
void (x.buf.push(format(fmt, ...arr)));
|
|
109
|
-
return x;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export function StringBuilder__AppendFormat_Z696D8D1B(x: StringBuilder, provider: any, fmt: string, o: any): StringBuilder {
|
|
113
|
-
void (x.buf.push(format(provider, fmt, o)));
|
|
114
|
-
return x;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export function StringBuilder__AppendFormat_26802C9E(x: StringBuilder, provider: any, fmt: string, o1: any, o2: any): StringBuilder {
|
|
118
|
-
void (x.buf.push(format(provider, fmt, o1, o2)));
|
|
119
|
-
return x;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export function StringBuilder__AppendFormat_Z471ADCBB(x: StringBuilder, provider: any, fmt: string, o1: any, o2: any, o3: any): StringBuilder {
|
|
123
|
-
void (x.buf.push(format(provider, fmt, o1, o2, o3)));
|
|
124
|
-
return x;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export function StringBuilder__AppendFormat_6C2E3E6E(x: StringBuilder, provider: any, fmt: string, arr: any[]): StringBuilder {
|
|
128
|
-
void (x.buf.push(format(provider, fmt, ...arr)));
|
|
129
|
-
return x;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export function StringBuilder__AppendLine(x: StringBuilder): StringBuilder {
|
|
133
|
-
void (x.buf.push("\n"));
|
|
134
|
-
return x;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
export function StringBuilder__AppendLine_Z721C83C5(x: StringBuilder, s: string): StringBuilder {
|
|
138
|
-
void (x.buf.push(s));
|
|
139
|
-
void (x.buf.push("\n"));
|
|
140
|
-
return x;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
export function StringBuilder__Clear(x: StringBuilder): StringBuilder {
|
|
144
|
-
clear(x.buf);
|
|
145
|
-
return x;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export function StringBuilder__get_Chars_Z524259A4(x: StringBuilder, index: int32): string {
|
|
149
|
-
let len = 0;
|
|
150
|
-
let i = -1;
|
|
151
|
-
while (((i + 1) < x.buf.length) && (len < index)) {
|
|
152
|
-
i = ((i + 1) | 0);
|
|
153
|
-
len = ((len + x.buf[i].length) | 0);
|
|
154
|
-
}
|
|
155
|
-
if (((index < 0) ? true : (i < 0)) ? true : (i >= x.buf.length)) {
|
|
156
|
-
throw new Error("Index was outside the bounds of the array");
|
|
157
|
-
}
|
|
158
|
-
else {
|
|
159
|
-
const pos: int32 = ((len - index) - 1) | 0;
|
|
160
|
-
return x.buf[i][pos];
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
export function StringBuilder__set_Chars_413E0D0A(x: StringBuilder, index: int32, value: string): void {
|
|
165
|
-
let len = 0;
|
|
166
|
-
let i = -1;
|
|
167
|
-
while (((i + 1) < x.buf.length) && (len < index)) {
|
|
168
|
-
i = ((i + 1) | 0);
|
|
169
|
-
len = ((len + x.buf[i].length) | 0);
|
|
170
|
-
}
|
|
171
|
-
if (((index < 0) ? true : (i < 0)) ? true : (i >= x.buf.length)) {
|
|
172
|
-
throw new Error("Index was outside the bounds of the array");
|
|
173
|
-
}
|
|
174
|
-
else {
|
|
175
|
-
const pos: int32 = ((len - index) - 1) | 0;
|
|
176
|
-
x.buf[i] = ((x.buf[i].slice(0, (pos - 1) + 1) + value) + x.buf[i].slice(pos + 1, x.buf[i].length));
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
export function StringBuilder__Replace_Z766F94C0(x: StringBuilder, oldValue: string, newValue: string): StringBuilder {
|
|
181
|
-
for (let i: int32 = x.buf.length - 1; i >= 0; i--) {
|
|
182
|
-
x.buf[i] = replace(x.buf[i], oldValue, newValue);
|
|
183
|
-
}
|
|
184
|
-
return x;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
export function StringBuilder__Replace_Z384F8060(x: StringBuilder, oldValue: string, newValue: string): StringBuilder {
|
|
188
|
-
const str: string = replace(toString(x), oldValue, newValue);
|
|
189
|
-
return StringBuilder__Append_Z721C83C5(StringBuilder__Clear(x), str);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
export function StringBuilder__get_Length(x: StringBuilder): int32 {
|
|
193
|
-
let len = 0;
|
|
194
|
-
for (let i: int32 = x.buf.length - 1; i >= 0; i--) {
|
|
195
|
-
len = ((len + x.buf[i].length) | 0);
|
|
196
|
-
}
|
|
197
|
-
return len | 0;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
export function StringBuilder__ToString_Z37302880(x: StringBuilder, firstIndex: int32, length: int32): string {
|
|
201
|
-
return substring(toString(x), firstIndex, length);
|
|
202
|
-
}
|
|
203
|
-
|
|
1
|
+
import { replace, format, replicate, substring, isNullOrEmpty, join } from "./String.js";
|
|
2
|
+
import { float64, int32 } from "./Int32.js";
|
|
3
|
+
import { class_type, TypeInfo } from "./Reflection.js";
|
|
4
|
+
import { clear, int32ToString } from "./Util.js";
|
|
5
|
+
import { toString } from "./Types.js";
|
|
6
|
+
|
|
7
|
+
export class StringBuilder {
|
|
8
|
+
readonly buf: string[];
|
|
9
|
+
constructor(value: string, capacity: int32) {
|
|
10
|
+
this.buf = [];
|
|
11
|
+
if (!isNullOrEmpty(value)) {
|
|
12
|
+
void (this.buf.push(value));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
toString(): string {
|
|
16
|
+
const _: StringBuilder = this;
|
|
17
|
+
return join("", _.buf);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function StringBuilder_$reflection(): TypeInfo {
|
|
22
|
+
return class_type("System.Text.StringBuilder", undefined, StringBuilder);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function StringBuilder_$ctor_Z18115A39(value: string, capacity: int32): StringBuilder {
|
|
26
|
+
return new StringBuilder(value, capacity);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function StringBuilder_$ctor_Z524259A4(capacity: int32): StringBuilder {
|
|
30
|
+
return StringBuilder_$ctor_Z18115A39("", capacity);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function StringBuilder_$ctor_Z721C83C5(value: string): StringBuilder {
|
|
34
|
+
return StringBuilder_$ctor_Z18115A39(value, 16);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function StringBuilder_$ctor(): StringBuilder {
|
|
38
|
+
return StringBuilder_$ctor_Z18115A39("", 16);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function StringBuilder__Append_Z721C83C5(x: StringBuilder, s: string): StringBuilder {
|
|
42
|
+
void (x.buf.push(s));
|
|
43
|
+
return x;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function StringBuilder__Append_487EF8FB(x: StringBuilder, s: string, startIndex: int32, count: int32): StringBuilder {
|
|
47
|
+
void (x.buf.push(substring(s, startIndex, count)));
|
|
48
|
+
return x;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function StringBuilder__Append_244C7CD6(x: StringBuilder, c: string): StringBuilder {
|
|
52
|
+
void (x.buf.push(c));
|
|
53
|
+
return x;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function StringBuilder__Append_61B1CA(x: StringBuilder, c: string, repeatCount: int32): StringBuilder {
|
|
57
|
+
const s: string = replicate(repeatCount, c);
|
|
58
|
+
void (x.buf.push(s));
|
|
59
|
+
return x;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function StringBuilder__Append_Z524259A4(x: StringBuilder, o: int32): StringBuilder {
|
|
63
|
+
void (x.buf.push(int32ToString(o)));
|
|
64
|
+
return x;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function StringBuilder__Append_5E38073B(x: StringBuilder, o: float64): StringBuilder {
|
|
68
|
+
void (x.buf.push(o.toString()));
|
|
69
|
+
return x;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function StringBuilder__Append_Z1FBCCD16(x: StringBuilder, o: boolean): StringBuilder {
|
|
73
|
+
void (x.buf.push(toString(o)));
|
|
74
|
+
return x;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function StringBuilder__Append_4E60E31B(x: StringBuilder, o: any): StringBuilder {
|
|
78
|
+
void (x.buf.push(toString(o)));
|
|
79
|
+
return x;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function StringBuilder__Append_Z372E4D23(x: StringBuilder, cs: string[]): StringBuilder {
|
|
83
|
+
void (x.buf.push(cs.join('')));
|
|
84
|
+
return x;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function StringBuilder__Append_43A65C09(x: StringBuilder, s: StringBuilder): StringBuilder {
|
|
88
|
+
void (x.buf.push(toString(s)));
|
|
89
|
+
return x;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function StringBuilder__AppendFormat_433E080(x: StringBuilder, fmt: string, o: any): StringBuilder {
|
|
93
|
+
void (x.buf.push(format(fmt, o)));
|
|
94
|
+
return x;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function StringBuilder__AppendFormat_Z3B30EC65(x: StringBuilder, fmt: string, o1: any, o2: any): StringBuilder {
|
|
98
|
+
void (x.buf.push(format(fmt, o1, o2)));
|
|
99
|
+
return x;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export function StringBuilder__AppendFormat_10D165E0(x: StringBuilder, fmt: string, o1: any, o2: any, o3: any): StringBuilder {
|
|
103
|
+
void (x.buf.push(format(fmt, o1, o2, o3)));
|
|
104
|
+
return x;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function StringBuilder__AppendFormat_Z17053F5(x: StringBuilder, fmt: string, arr: any[]): StringBuilder {
|
|
108
|
+
void (x.buf.push(format(fmt, ...arr)));
|
|
109
|
+
return x;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function StringBuilder__AppendFormat_Z696D8D1B(x: StringBuilder, provider: any, fmt: string, o: any): StringBuilder {
|
|
113
|
+
void (x.buf.push(format(provider, fmt, o)));
|
|
114
|
+
return x;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export function StringBuilder__AppendFormat_26802C9E(x: StringBuilder, provider: any, fmt: string, o1: any, o2: any): StringBuilder {
|
|
118
|
+
void (x.buf.push(format(provider, fmt, o1, o2)));
|
|
119
|
+
return x;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function StringBuilder__AppendFormat_Z471ADCBB(x: StringBuilder, provider: any, fmt: string, o1: any, o2: any, o3: any): StringBuilder {
|
|
123
|
+
void (x.buf.push(format(provider, fmt, o1, o2, o3)));
|
|
124
|
+
return x;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export function StringBuilder__AppendFormat_6C2E3E6E(x: StringBuilder, provider: any, fmt: string, arr: any[]): StringBuilder {
|
|
128
|
+
void (x.buf.push(format(provider, fmt, ...arr)));
|
|
129
|
+
return x;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export function StringBuilder__AppendLine(x: StringBuilder): StringBuilder {
|
|
133
|
+
void (x.buf.push("\n"));
|
|
134
|
+
return x;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export function StringBuilder__AppendLine_Z721C83C5(x: StringBuilder, s: string): StringBuilder {
|
|
138
|
+
void (x.buf.push(s));
|
|
139
|
+
void (x.buf.push("\n"));
|
|
140
|
+
return x;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export function StringBuilder__Clear(x: StringBuilder): StringBuilder {
|
|
144
|
+
clear(x.buf);
|
|
145
|
+
return x;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export function StringBuilder__get_Chars_Z524259A4(x: StringBuilder, index: int32): string {
|
|
149
|
+
let len = 0;
|
|
150
|
+
let i = -1;
|
|
151
|
+
while (((i + 1) < x.buf.length) && (len < index)) {
|
|
152
|
+
i = ((i + 1) | 0);
|
|
153
|
+
len = ((len + x.buf[i].length) | 0);
|
|
154
|
+
}
|
|
155
|
+
if (((index < 0) ? true : (i < 0)) ? true : (i >= x.buf.length)) {
|
|
156
|
+
throw new Error("Index was outside the bounds of the array");
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
const pos: int32 = ((len - index) - 1) | 0;
|
|
160
|
+
return x.buf[i][pos];
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export function StringBuilder__set_Chars_413E0D0A(x: StringBuilder, index: int32, value: string): void {
|
|
165
|
+
let len = 0;
|
|
166
|
+
let i = -1;
|
|
167
|
+
while (((i + 1) < x.buf.length) && (len < index)) {
|
|
168
|
+
i = ((i + 1) | 0);
|
|
169
|
+
len = ((len + x.buf[i].length) | 0);
|
|
170
|
+
}
|
|
171
|
+
if (((index < 0) ? true : (i < 0)) ? true : (i >= x.buf.length)) {
|
|
172
|
+
throw new Error("Index was outside the bounds of the array");
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
const pos: int32 = ((len - index) - 1) | 0;
|
|
176
|
+
x.buf[i] = ((x.buf[i].slice(0, (pos - 1) + 1) + value) + x.buf[i].slice(pos + 1, x.buf[i].length));
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export function StringBuilder__Replace_Z766F94C0(x: StringBuilder, oldValue: string, newValue: string): StringBuilder {
|
|
181
|
+
for (let i: int32 = x.buf.length - 1; i >= 0; i--) {
|
|
182
|
+
x.buf[i] = replace(x.buf[i], oldValue, newValue);
|
|
183
|
+
}
|
|
184
|
+
return x;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export function StringBuilder__Replace_Z384F8060(x: StringBuilder, oldValue: string, newValue: string): StringBuilder {
|
|
188
|
+
const str: string = replace(toString(x), oldValue, newValue);
|
|
189
|
+
return StringBuilder__Append_Z721C83C5(StringBuilder__Clear(x), str);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export function StringBuilder__get_Length(x: StringBuilder): int32 {
|
|
193
|
+
let len = 0;
|
|
194
|
+
for (let i: int32 = x.buf.length - 1; i >= 0; i--) {
|
|
195
|
+
len = ((len + x.buf[i].length) | 0);
|
|
196
|
+
}
|
|
197
|
+
return len | 0;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export function StringBuilder__ToString_Z37302880(x: StringBuilder, firstIndex: int32, length: int32): string {
|
|
201
|
+
return substring(toString(x), firstIndex, length);
|
|
202
|
+
}
|
|
203
|
+
|
package/Types.ts
CHANGED
|
@@ -23,7 +23,7 @@ export function seqToString<T>(self: Iterable<T>): string {
|
|
|
23
23
|
|
|
24
24
|
export function toString(x: any, callStack = 0): string {
|
|
25
25
|
if (x != null && typeof x === "object") {
|
|
26
|
-
if (typeof x.toString === "function") {
|
|
26
|
+
if (typeof x.toString === "function" && x.toString !== Object.prototype.toString) {
|
|
27
27
|
return x.toString();
|
|
28
28
|
} else if (Symbol.iterator in x) {
|
|
29
29
|
return seqToString(x);
|
package/package.json
CHANGED