@fable-org/fable-library-js 1.9.0 → 2.0.0-beta.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/Array.js +19 -18
- package/CHANGELOG.md +11 -1
- package/FSharp.Collections.js +5 -5
- package/FSharp.Core.d.ts +15 -1
- package/FSharp.Core.js +88 -2
- package/List.js +15 -15
- package/Map.js +5 -5
- package/Random.js +5 -4
- package/Seq.js +7 -7
- package/Seq2.js +1 -1
- package/Set.js +5 -5
- package/System.Collections.Generic.js +8 -8
- package/System.Text.d.ts +1 -0
- package/System.Text.js +6 -1
- package/Types.js +1 -1
- package/package.json +1 -1
package/Array.js
CHANGED
|
@@ -4,6 +4,7 @@ import { value as value_2, map as map_1, defaultArg, some } from "./Option.js";
|
|
|
4
4
|
import { min as min_1, max as max_1 } from "./Double.js";
|
|
5
5
|
import { equals as equals_1, disposeSafe, getEnumerator, copyToArray, defaultOf } from "./Util.js";
|
|
6
6
|
import { SR_indexOutOfBounds } from "./Global.js";
|
|
7
|
+
import { Operators_IsNull } from "./FSharp.Core.js";
|
|
7
8
|
function indexNotFound() {
|
|
8
9
|
throw new Error("An index satisfying the predicate was not found in the collection.");
|
|
9
10
|
}
|
|
@@ -182,7 +183,7 @@ export function where(predicate, array) {
|
|
|
182
183
|
}
|
|
183
184
|
export function indexOf(array, item_1, start, count, eq) {
|
|
184
185
|
const start_1 = defaultArg(start, 0) | 0;
|
|
185
|
-
const end$0027 = defaultArg(map_1((c) => (start_1 + c), count), array.length) | 0;
|
|
186
|
+
const end$0027 = defaultArg(map_1((c) => ((start_1 + c) | 0), count), array.length) | 0;
|
|
186
187
|
const loop = (i_mut) => {
|
|
187
188
|
loop: while (true) {
|
|
188
189
|
const i = i_mut;
|
|
@@ -338,11 +339,11 @@ export function addRangeInPlace(range, array) {
|
|
|
338
339
|
}
|
|
339
340
|
}
|
|
340
341
|
export function insertRangeInPlace(index, range, array) {
|
|
341
|
-
let index_1;
|
|
342
342
|
let i = index;
|
|
343
343
|
const enumerator = getEnumerator(range);
|
|
344
344
|
try {
|
|
345
345
|
while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
|
|
346
|
+
let index_1;
|
|
346
347
|
const x = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
347
348
|
(index_1 = (i | 0), array.splice(index_1, 0, x));
|
|
348
349
|
i = ((i + 1) | 0);
|
|
@@ -645,29 +646,29 @@ export function setSlice(target, lower, upper, source) {
|
|
|
645
646
|
}
|
|
646
647
|
}
|
|
647
648
|
export function sortInPlaceBy(projection, xs, comparer) {
|
|
648
|
-
xs.sort((x, y) => comparer.Compare(projection(x), projection(y)));
|
|
649
|
+
xs.sort((x, y) => (comparer.Compare(projection(x), projection(y)) | 0));
|
|
649
650
|
}
|
|
650
651
|
export function sortInPlace(xs, comparer) {
|
|
651
|
-
xs.sort((x, y) => comparer.Compare(x, y));
|
|
652
|
+
xs.sort((x, y) => (comparer.Compare(x, y) | 0));
|
|
652
653
|
}
|
|
653
654
|
export function sort(xs, comparer) {
|
|
654
655
|
const xs_1 = xs.slice();
|
|
655
|
-
xs_1.sort((x, y) => comparer.Compare(x, y));
|
|
656
|
+
xs_1.sort((x, y) => (comparer.Compare(x, y) | 0));
|
|
656
657
|
return xs_1;
|
|
657
658
|
}
|
|
658
659
|
export function sortBy(projection, xs, comparer) {
|
|
659
660
|
const xs_1 = xs.slice();
|
|
660
|
-
xs_1.sort((x, y) => comparer.Compare(projection(x), projection(y)));
|
|
661
|
+
xs_1.sort((x, y) => (comparer.Compare(projection(x), projection(y)) | 0));
|
|
661
662
|
return xs_1;
|
|
662
663
|
}
|
|
663
664
|
export function sortDescending(xs, comparer) {
|
|
664
665
|
const xs_1 = xs.slice();
|
|
665
|
-
xs_1.sort((x, y) => (comparer.Compare(x, y) * -1));
|
|
666
|
+
xs_1.sort((x, y) => ((comparer.Compare(x, y) * -1) | 0));
|
|
666
667
|
return xs_1;
|
|
667
668
|
}
|
|
668
669
|
export function sortByDescending(projection, xs, comparer) {
|
|
669
670
|
const xs_1 = xs.slice();
|
|
670
|
-
xs_1.sort((x, y) => (comparer.Compare(projection(x), projection(y)) * -1));
|
|
671
|
+
xs_1.sort((x, y) => ((comparer.Compare(projection(x), projection(y)) * -1) | 0));
|
|
671
672
|
return xs_1;
|
|
672
673
|
}
|
|
673
674
|
export function sortWith(comparer, xs) {
|
|
@@ -773,15 +774,15 @@ export function splitAt(index, array) {
|
|
|
773
774
|
return [array.slice(0, (0 + index)), array.slice(index)];
|
|
774
775
|
}
|
|
775
776
|
export function compareWith(comparer, source1, source2) {
|
|
776
|
-
if (source1
|
|
777
|
-
if (source2
|
|
777
|
+
if (Operators_IsNull(source1)) {
|
|
778
|
+
if (Operators_IsNull(source2)) {
|
|
778
779
|
return 0;
|
|
779
780
|
}
|
|
780
781
|
else {
|
|
781
782
|
return -1;
|
|
782
783
|
}
|
|
783
784
|
}
|
|
784
|
-
else if (source2
|
|
785
|
+
else if (Operators_IsNull(source2)) {
|
|
785
786
|
return 1;
|
|
786
787
|
}
|
|
787
788
|
else {
|
|
@@ -809,15 +810,15 @@ export function compareWith(comparer, source1, source2) {
|
|
|
809
810
|
}
|
|
810
811
|
}
|
|
811
812
|
export function compareTo(comparer, source1, source2) {
|
|
812
|
-
if (source1
|
|
813
|
-
if (source2
|
|
813
|
+
if (Operators_IsNull(source1)) {
|
|
814
|
+
if (Operators_IsNull(source2)) {
|
|
814
815
|
return 0;
|
|
815
816
|
}
|
|
816
817
|
else {
|
|
817
818
|
return -1;
|
|
818
819
|
}
|
|
819
820
|
}
|
|
820
|
-
else if (source2
|
|
821
|
+
else if (Operators_IsNull(source2)) {
|
|
821
822
|
return 1;
|
|
822
823
|
}
|
|
823
824
|
else {
|
|
@@ -841,15 +842,15 @@ export function compareTo(comparer, source1, source2) {
|
|
|
841
842
|
}
|
|
842
843
|
}
|
|
843
844
|
export function equalsWith(equals, array1, array2) {
|
|
844
|
-
if (array1
|
|
845
|
-
if (array2
|
|
845
|
+
if (Operators_IsNull(array1)) {
|
|
846
|
+
if (Operators_IsNull(array2)) {
|
|
846
847
|
return true;
|
|
847
848
|
}
|
|
848
849
|
else {
|
|
849
850
|
return false;
|
|
850
851
|
}
|
|
851
852
|
}
|
|
852
|
-
else if (array2
|
|
853
|
+
else if (Operators_IsNull(array2)) {
|
|
853
854
|
return false;
|
|
854
855
|
}
|
|
855
856
|
else {
|
|
@@ -1223,7 +1224,7 @@ export function resize(xs, newSize, zero, cons) {
|
|
|
1223
1224
|
throw new Error("The input must be non-negative.\\nParameter name: newSize");
|
|
1224
1225
|
}
|
|
1225
1226
|
const zero_1 = defaultArg(zero, defaultOf());
|
|
1226
|
-
if (xs.contents
|
|
1227
|
+
if (Operators_IsNull(xs.contents)) {
|
|
1227
1228
|
xs.contents = ((array = Helpers_allocateArrayFromCons(cons, newSize), array.fill(zero_1, 0, (0 + newSize))));
|
|
1228
1229
|
}
|
|
1229
1230
|
else {
|
package/CHANGELOG.md
CHANGED
|
@@ -7,11 +7,21 @@ 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.1 - 2025-02-16
|
|
11
|
+
|
|
12
|
+
* Compiled with Fable 5.0.0-alpha.10
|
|
13
|
+
|
|
14
|
+
## 1.10.0 - 2025-01-23
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
* [JS/TS] Add `StringBuiler.Append(c: char, repeatCount: int)` overload (by @roboz0r)
|
|
19
|
+
|
|
10
20
|
## 1.9.0 - 2025-01-09
|
|
11
21
|
|
|
12
22
|
### Added
|
|
13
23
|
|
|
14
|
-
* [JS/TS] Add new `
|
|
24
|
+
* [JS/TS] Add new `TimSpane` overload support coming from .NET 9 (by @MangelMaxime)
|
|
15
25
|
|
|
16
26
|
### Fixed
|
|
17
27
|
|
package/FSharp.Collections.js
CHANGED
|
@@ -5,23 +5,23 @@ export function HashIdentity_FromFunctions(hash, eq) {
|
|
|
5
5
|
return eq(x, y);
|
|
6
6
|
},
|
|
7
7
|
GetHashCode(x_1) {
|
|
8
|
-
return hash(x_1);
|
|
8
|
+
return hash(x_1) | 0;
|
|
9
9
|
},
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
export function HashIdentity_Structural() {
|
|
13
|
-
return HashIdentity_FromFunctions(structuralHash, equals);
|
|
13
|
+
return HashIdentity_FromFunctions((obj) => (structuralHash(obj) | 0), equals);
|
|
14
14
|
}
|
|
15
15
|
export function HashIdentity_Reference() {
|
|
16
|
-
return HashIdentity_FromFunctions(physicalHash, (e, e_1) => (e === e_1));
|
|
16
|
+
return HashIdentity_FromFunctions((obj) => (physicalHash(obj) | 0), (e, e_1) => (e === e_1));
|
|
17
17
|
}
|
|
18
18
|
export function ComparisonIdentity_FromFunction(comparer) {
|
|
19
19
|
return {
|
|
20
20
|
Compare(x, y) {
|
|
21
|
-
return comparer(x, y);
|
|
21
|
+
return comparer(x, y) | 0;
|
|
22
22
|
},
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
export function ComparisonIdentity_Structural() {
|
|
26
|
-
return ComparisonIdentity_FromFunction(compare);
|
|
26
|
+
return ComparisonIdentity_FromFunction((e, e_1) => (compare(e, e_1) | 0));
|
|
27
27
|
}
|
package/FSharp.Core.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IDisposable, IEqualityComparer, IComparer } from "./Util.js";
|
|
2
|
-
import { Option } from "./Option.js";
|
|
2
|
+
import { Nullable, Option } from "./Option.js";
|
|
3
|
+
import { FSharpChoice$2_$union } from "./Choice.js";
|
|
3
4
|
import { StringBuilder } from "./System.Text.js";
|
|
4
5
|
export declare const LanguagePrimitives_GenericEqualityComparer: any;
|
|
5
6
|
export declare const LanguagePrimitives_GenericEqualityERComparer: any;
|
|
@@ -12,6 +13,19 @@ export declare function Operators_FailurePattern(exn: Error): Option<string>;
|
|
|
12
13
|
export declare function Operators_NullArg<$a>(x: string): $a;
|
|
13
14
|
export declare function Operators_Using<T extends IDisposable, R>(resource: T, action: ((arg0: T) => R)): R;
|
|
14
15
|
export declare function Operators_Lock<$a, $b>(_lockObj: $a, action: (() => $b)): $b;
|
|
16
|
+
export declare function Operators_IsNull<T>(value: T): boolean;
|
|
17
|
+
export declare function Operators_IsNotNull<T>(value: T): boolean;
|
|
18
|
+
export declare function Operators_IsNullV<T extends any>(value: Nullable<T>): boolean;
|
|
19
|
+
export declare function Operators_NonNull<T>(value: T): T;
|
|
20
|
+
export declare function Operators_NonNullV<T extends any>(value: Nullable<T>): T;
|
|
21
|
+
export declare function Operators_NullMatchPattern<T>(value: T): FSharpChoice$2_$union<void, T>;
|
|
22
|
+
export declare function Operators_NullValueMatchPattern<T extends any>(value: Nullable<T>): FSharpChoice$2_$union<void, T>;
|
|
23
|
+
export declare function Operators_NonNullQuickPattern<T>(value: T): T;
|
|
24
|
+
export declare function Operators_NonNullQuickValuePattern<T extends any>(value: Nullable<T>): T;
|
|
25
|
+
export declare function Operators_WithNull<T>(value: T): T;
|
|
26
|
+
export declare function Operators_WithNullV<T extends any>(value: T): T;
|
|
27
|
+
export declare function Operators_NullV<T extends any>(): Nullable<T>;
|
|
28
|
+
export declare function Operators_NullArgCheck<T>(argumentName: string, value: T): T;
|
|
15
29
|
export declare function ExtraTopLevelOperators_LazyPattern<$a>(input: any): $a;
|
|
16
30
|
export declare function PrintfModule_PrintFormatToStringBuilderThen<$a, $b>(continuation: (() => $a), builder: StringBuilder, format: any): $b;
|
|
17
31
|
export declare function PrintfModule_PrintFormatToStringBuilder<$a>(builder: StringBuilder, format: any): $a;
|
package/FSharp.Core.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { disposeSafe, defaultOf, structuralHash, equals } from "./Util.js";
|
|
2
2
|
import { HashIdentity_Structural, ComparisonIdentity_Structural } from "./FSharp.Collections.js";
|
|
3
|
+
import { value as value_1 } from "./Option.js";
|
|
4
|
+
import { FSharpChoice$2_Choice2Of2, FSharpChoice$2_Choice1Of2 } from "./Choice.js";
|
|
3
5
|
import { StringBuilder__Append_Z721C83C5 } from "./System.Text.js";
|
|
4
6
|
export const LanguagePrimitives_GenericEqualityComparer = {
|
|
5
7
|
"System.Collections.IEqualityComparer.Equals541DA560"(x, y) {
|
|
6
8
|
return equals(x, y);
|
|
7
9
|
},
|
|
8
10
|
"System.Collections.IEqualityComparer.GetHashCode4E60E31B"(x_1) {
|
|
9
|
-
return structuralHash(x_1);
|
|
11
|
+
return structuralHash(x_1) | 0;
|
|
10
12
|
},
|
|
11
13
|
};
|
|
12
14
|
export const LanguagePrimitives_GenericEqualityERComparer = {
|
|
@@ -14,7 +16,7 @@ export const LanguagePrimitives_GenericEqualityERComparer = {
|
|
|
14
16
|
return equals(x, y);
|
|
15
17
|
},
|
|
16
18
|
"System.Collections.IEqualityComparer.GetHashCode4E60E31B"(x_1) {
|
|
17
|
-
return structuralHash(x_1);
|
|
19
|
+
return structuralHash(x_1) | 0;
|
|
18
20
|
},
|
|
19
21
|
};
|
|
20
22
|
export function LanguagePrimitives_FastGenericComparer() {
|
|
@@ -54,6 +56,90 @@ export function Operators_Using(resource, action) {
|
|
|
54
56
|
export function Operators_Lock(_lockObj, action) {
|
|
55
57
|
return action();
|
|
56
58
|
}
|
|
59
|
+
export function Operators_IsNull(value) {
|
|
60
|
+
if (equals(value, defaultOf())) {
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export function Operators_IsNotNull(value) {
|
|
68
|
+
if (equals(value, defaultOf())) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
export function Operators_IsNullV(value) {
|
|
76
|
+
return !(value != null);
|
|
77
|
+
}
|
|
78
|
+
export function Operators_NonNull(value) {
|
|
79
|
+
if (equals(value, defaultOf())) {
|
|
80
|
+
throw new Error();
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
return value;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
export function Operators_NonNullV(value) {
|
|
87
|
+
if (value != null) {
|
|
88
|
+
return value_1(value);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
throw new Error();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
export function Operators_NullMatchPattern(value) {
|
|
95
|
+
if (equals(value, defaultOf())) {
|
|
96
|
+
return FSharpChoice$2_Choice1Of2(undefined);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
return FSharpChoice$2_Choice2Of2(value);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
export function Operators_NullValueMatchPattern(value) {
|
|
103
|
+
if (value != null) {
|
|
104
|
+
return FSharpChoice$2_Choice2Of2(value_1(value));
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
return FSharpChoice$2_Choice1Of2(undefined);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
export function Operators_NonNullQuickPattern(value) {
|
|
111
|
+
if (equals(value, defaultOf())) {
|
|
112
|
+
throw new Error();
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
return value;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
export function Operators_NonNullQuickValuePattern(value) {
|
|
119
|
+
if (value != null) {
|
|
120
|
+
return value_1(value);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
throw new Error();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
export function Operators_WithNull(value) {
|
|
127
|
+
return value;
|
|
128
|
+
}
|
|
129
|
+
export function Operators_WithNullV(value) {
|
|
130
|
+
return value;
|
|
131
|
+
}
|
|
132
|
+
export function Operators_NullV() {
|
|
133
|
+
return defaultOf();
|
|
134
|
+
}
|
|
135
|
+
export function Operators_NullArgCheck(argumentName, value) {
|
|
136
|
+
if (equals(value, defaultOf())) {
|
|
137
|
+
throw new Error(argumentName);
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
return value;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
57
143
|
export function ExtraTopLevelOperators_LazyPattern(input) {
|
|
58
144
|
return input.Value;
|
|
59
145
|
}
|
package/List.js
CHANGED
|
@@ -261,7 +261,7 @@ export function isEmpty(xs) {
|
|
|
261
261
|
return FSharpList__get_IsEmpty(xs);
|
|
262
262
|
}
|
|
263
263
|
export function length(xs) {
|
|
264
|
-
return FSharpList__get_Length(xs);
|
|
264
|
+
return FSharpList__get_Length(xs) | 0;
|
|
265
265
|
}
|
|
266
266
|
export function head(xs) {
|
|
267
267
|
return FSharpList__get_Head(xs);
|
|
@@ -405,9 +405,9 @@ export function foldBack2(folder, xs, ys, state) {
|
|
|
405
405
|
}
|
|
406
406
|
export function unfold(gen, state) {
|
|
407
407
|
const loop = (acc_mut, node_mut) => {
|
|
408
|
-
let t;
|
|
409
408
|
loop: while (true) {
|
|
410
409
|
const acc = acc_mut, node = node_mut;
|
|
410
|
+
let t;
|
|
411
411
|
const matchValue = gen(acc);
|
|
412
412
|
if (matchValue != null) {
|
|
413
413
|
acc_mut = value_1(matchValue)[1];
|
|
@@ -462,7 +462,6 @@ export function ofArray(xs) {
|
|
|
462
462
|
return ofArrayWithTail(xs, FSharpList_get_Empty());
|
|
463
463
|
}
|
|
464
464
|
export function ofSeq(xs) {
|
|
465
|
-
let xs_3, t;
|
|
466
465
|
if (isArrayLike(xs)) {
|
|
467
466
|
return ofArray(xs);
|
|
468
467
|
}
|
|
@@ -475,6 +474,7 @@ export function ofSeq(xs) {
|
|
|
475
474
|
const enumerator = getEnumerator(xs);
|
|
476
475
|
try {
|
|
477
476
|
while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
|
|
477
|
+
let xs_3, t;
|
|
478
478
|
const x = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
479
479
|
node = ((xs_3 = node, (t = (new FSharpList(x, undefined)), (xs_3.tail = t, t))));
|
|
480
480
|
}
|
|
@@ -522,7 +522,6 @@ export function concat(lists) {
|
|
|
522
522
|
return FSharpList__get_Tail(root);
|
|
523
523
|
}
|
|
524
524
|
export function scan(folder, state, xs) {
|
|
525
|
-
let xs_4, t_2;
|
|
526
525
|
const root = FSharpList_get_Empty();
|
|
527
526
|
let node;
|
|
528
527
|
const t = new FSharpList(state, undefined);
|
|
@@ -531,6 +530,7 @@ export function scan(folder, state, xs) {
|
|
|
531
530
|
let acc = state;
|
|
532
531
|
let xs_3 = xs;
|
|
533
532
|
while (!FSharpList__get_IsEmpty(xs_3)) {
|
|
533
|
+
let xs_4, t_2;
|
|
534
534
|
acc = folder(acc, FSharpList__get_Head(xs_3));
|
|
535
535
|
node = ((xs_4 = node, (t_2 = (new FSharpList(acc, undefined)), (xs_4.tail = t_2, t_2))));
|
|
536
536
|
xs_3 = FSharpList__get_Tail(xs_3);
|
|
@@ -547,13 +547,13 @@ export function append(xs, ys) {
|
|
|
547
547
|
return fold((acc, x) => FSharpList_Cons_305B8EAC(x, acc), ys, reverse(xs));
|
|
548
548
|
}
|
|
549
549
|
export function collect(mapping, xs) {
|
|
550
|
-
let xs_1, t;
|
|
551
550
|
const root = FSharpList_get_Empty();
|
|
552
551
|
let node = root;
|
|
553
552
|
let ys = xs;
|
|
554
553
|
while (!FSharpList__get_IsEmpty(ys)) {
|
|
555
554
|
let zs = mapping(FSharpList__get_Head(ys));
|
|
556
555
|
while (!FSharpList__get_IsEmpty(zs)) {
|
|
556
|
+
let xs_1, t;
|
|
557
557
|
node = ((xs_1 = node, (t = (new FSharpList(FSharpList__get_Head(zs), undefined)), (xs_1.tail = t, t))));
|
|
558
558
|
zs = FSharpList__get_Tail(zs);
|
|
559
559
|
}
|
|
@@ -602,9 +602,9 @@ export function map2(mapping, xs, ys) {
|
|
|
602
602
|
}
|
|
603
603
|
export function mapIndexed2(mapping, xs, ys) {
|
|
604
604
|
const loop = (i_mut, acc_mut, xs_1_mut, ys_1_mut) => {
|
|
605
|
-
let t;
|
|
606
605
|
loop: while (true) {
|
|
607
606
|
const i = i_mut, acc = acc_mut, xs_1 = xs_1_mut, ys_1 = ys_1_mut;
|
|
607
|
+
let t;
|
|
608
608
|
if (FSharpList__get_IsEmpty(xs_1) ? true : FSharpList__get_IsEmpty(ys_1)) {
|
|
609
609
|
return acc;
|
|
610
610
|
}
|
|
@@ -626,9 +626,9 @@ export function mapIndexed2(mapping, xs, ys) {
|
|
|
626
626
|
}
|
|
627
627
|
export function map3(mapping, xs, ys, zs) {
|
|
628
628
|
const loop = (acc_mut, xs_1_mut, ys_1_mut, zs_1_mut) => {
|
|
629
|
-
let t;
|
|
630
629
|
loop: while (true) {
|
|
631
630
|
const acc = acc_mut, xs_1 = xs_1_mut, ys_1 = ys_1_mut, zs_1 = zs_1_mut;
|
|
631
|
+
let t;
|
|
632
632
|
if ((FSharpList__get_IsEmpty(xs_1) ? true : FSharpList__get_IsEmpty(ys_1)) ? true : FSharpList__get_IsEmpty(zs_1)) {
|
|
633
633
|
return acc;
|
|
634
634
|
}
|
|
@@ -841,10 +841,10 @@ export function contains(value, xs, eq) {
|
|
|
841
841
|
return tryFindIndex((v) => eq.Equals(value, v), xs) != null;
|
|
842
842
|
}
|
|
843
843
|
export function initialize(n, f) {
|
|
844
|
-
let xs, t;
|
|
845
844
|
const root = FSharpList_get_Empty();
|
|
846
845
|
let node = root;
|
|
847
846
|
for (let i = 0; i <= (n - 1); i++) {
|
|
847
|
+
let xs, t;
|
|
848
848
|
node = ((xs = node, (t = (new FSharpList(f(i), undefined)), (xs.tail = t, t))));
|
|
849
849
|
}
|
|
850
850
|
const xs_2 = node;
|
|
@@ -937,16 +937,16 @@ export function sortWith(comparer, xs) {
|
|
|
937
937
|
return ofArray(arr);
|
|
938
938
|
}
|
|
939
939
|
export function sort(xs, comparer) {
|
|
940
|
-
return sortWith((x, y) => comparer.Compare(x, y), xs);
|
|
940
|
+
return sortWith((x, y) => (comparer.Compare(x, y) | 0), xs);
|
|
941
941
|
}
|
|
942
942
|
export function sortBy(projection, xs, comparer) {
|
|
943
|
-
return sortWith((x, y) => comparer.Compare(projection(x), projection(y)), xs);
|
|
943
|
+
return sortWith((x, y) => (comparer.Compare(projection(x), projection(y)) | 0), xs);
|
|
944
944
|
}
|
|
945
945
|
export function sortDescending(xs, comparer) {
|
|
946
|
-
return sortWith((x, y) => (comparer.Compare(x, y) * -1), xs);
|
|
946
|
+
return sortWith((x, y) => ((comparer.Compare(x, y) * -1) | 0), xs);
|
|
947
947
|
}
|
|
948
948
|
export function sortByDescending(projection, xs, comparer) {
|
|
949
|
-
return sortWith((x, y) => (comparer.Compare(projection(x), projection(y)) * -1), xs);
|
|
949
|
+
return sortWith((x, y) => ((comparer.Compare(projection(x), projection(y)) * -1) | 0), xs);
|
|
950
950
|
}
|
|
951
951
|
export function sum(xs, adder) {
|
|
952
952
|
return fold((acc, x) => adder.Add(acc, x), adder.GetZero(), xs);
|
|
@@ -1041,9 +1041,9 @@ export function take(count, xs) {
|
|
|
1041
1041
|
throw new Error((SR_inputMustBeNonNegative + "\\nParameter name: ") + "count");
|
|
1042
1042
|
}
|
|
1043
1043
|
const loop = (i_mut, acc_mut, xs_1_mut) => {
|
|
1044
|
-
let t;
|
|
1045
1044
|
loop: while (true) {
|
|
1046
1045
|
const i = i_mut, acc = acc_mut, xs_1 = xs_1_mut;
|
|
1046
|
+
let t;
|
|
1047
1047
|
if (i <= 0) {
|
|
1048
1048
|
return acc;
|
|
1049
1049
|
}
|
|
@@ -1067,9 +1067,9 @@ export function take(count, xs) {
|
|
|
1067
1067
|
}
|
|
1068
1068
|
export function takeWhile(predicate, xs) {
|
|
1069
1069
|
const loop = (acc_mut, xs_1_mut) => {
|
|
1070
|
-
let t;
|
|
1071
1070
|
loop: while (true) {
|
|
1072
1071
|
const acc = acc_mut, xs_1 = xs_1_mut;
|
|
1072
|
+
let t;
|
|
1073
1073
|
if (FSharpList__get_IsEmpty(xs_1)) {
|
|
1074
1074
|
return acc;
|
|
1075
1075
|
}
|
|
@@ -1092,9 +1092,9 @@ export function takeWhile(predicate, xs) {
|
|
|
1092
1092
|
}
|
|
1093
1093
|
export function truncate(count, xs) {
|
|
1094
1094
|
const loop = (i_mut, acc_mut, xs_1_mut) => {
|
|
1095
|
-
let t;
|
|
1096
1095
|
loop: while (true) {
|
|
1097
1096
|
const i = i_mut, acc = acc_mut, xs_1 = xs_1_mut;
|
|
1097
|
+
let t;
|
|
1098
1098
|
if (i <= 0) {
|
|
1099
1099
|
return acc;
|
|
1100
1100
|
}
|
package/Map.js
CHANGED
|
@@ -45,7 +45,7 @@ export function MapTreeNode$2__get_Right(_) {
|
|
|
45
45
|
return _.right;
|
|
46
46
|
}
|
|
47
47
|
export function MapTreeNode$2__get_Height(_) {
|
|
48
|
-
return _.h;
|
|
48
|
+
return _.h | 0;
|
|
49
49
|
}
|
|
50
50
|
export function MapTreeModule_empty() {
|
|
51
51
|
return undefined;
|
|
@@ -72,7 +72,7 @@ export function MapTreeModule_sizeAux(acc_mut, m_mut) {
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
export function MapTreeModule_size(x) {
|
|
75
|
-
return MapTreeModule_sizeAux(0, x);
|
|
75
|
+
return MapTreeModule_sizeAux(0, x) | 0;
|
|
76
76
|
}
|
|
77
77
|
export function MapTreeModule_mk(l, k, v, r) {
|
|
78
78
|
let mn, mn_1;
|
|
@@ -1223,7 +1223,7 @@ export function FSharpMap__Partition(m, predicate) {
|
|
|
1223
1223
|
return [FSharpMap_$ctor(m.comparer, patternInput[0]), FSharpMap_$ctor(m.comparer, patternInput[1])];
|
|
1224
1224
|
}
|
|
1225
1225
|
export function FSharpMap__get_Count(m) {
|
|
1226
|
-
return MapTreeModule_size(m.tree);
|
|
1226
|
+
return MapTreeModule_size(m.tree) | 0;
|
|
1227
1227
|
}
|
|
1228
1228
|
export function FSharpMap__ContainsKey(m, key) {
|
|
1229
1229
|
return MapTreeModule_mem(m.comparer, key, m.tree);
|
|
@@ -1264,7 +1264,7 @@ export function FSharpMap__ToArray(m) {
|
|
|
1264
1264
|
return MapTreeModule_toArray(m.tree);
|
|
1265
1265
|
}
|
|
1266
1266
|
export function FSharpMap__ComputeHashCode(this$) {
|
|
1267
|
-
const combineHash = (x, y) => (((x << 1) + y) + 631);
|
|
1267
|
+
const combineHash = (x, y) => ((((x << 1) + y) + 631) | 0);
|
|
1268
1268
|
let res = 0;
|
|
1269
1269
|
const enumerator = getEnumerator(this$);
|
|
1270
1270
|
try {
|
|
@@ -1392,5 +1392,5 @@ export function empty(comparer) {
|
|
|
1392
1392
|
return FSharpMap_Empty(comparer);
|
|
1393
1393
|
}
|
|
1394
1394
|
export function count(table) {
|
|
1395
|
-
return FSharpMap__get_Count(table);
|
|
1395
|
+
return FSharpMap__get_Count(table) | 0;
|
|
1396
1396
|
}
|
package/Random.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { class_type } from "./Reflection.js";
|
|
2
2
|
import { fromFloat64, op_Addition, toInt32, toFloat64, compare, fromInt32, toInt64 } from "./BigInt.js";
|
|
3
|
+
import { Operators_IsNull } from "./FSharp.Core.js";
|
|
3
4
|
import { item, fill, setItem } from "./Array.js";
|
|
4
5
|
function Native_random() {
|
|
5
6
|
return Math.random();
|
|
@@ -32,13 +33,13 @@ export class NonSeeded {
|
|
|
32
33
|
constructor() {
|
|
33
34
|
}
|
|
34
35
|
Next0() {
|
|
35
|
-
return Native_randomNext(0, 2147483647);
|
|
36
|
+
return Native_randomNext(0, 2147483647) | 0;
|
|
36
37
|
}
|
|
37
38
|
Next1(maxValue) {
|
|
38
|
-
return Native_randomNext(0, maxValue);
|
|
39
|
+
return Native_randomNext(0, maxValue) | 0;
|
|
39
40
|
}
|
|
40
41
|
Next2(minValue, maxValue) {
|
|
41
|
-
return Native_randomNext(minValue, maxValue);
|
|
42
|
+
return Native_randomNext(minValue, maxValue) | 0;
|
|
42
43
|
}
|
|
43
44
|
NextDouble() {
|
|
44
45
|
return Native_random();
|
|
@@ -111,7 +112,7 @@ export class Seeded {
|
|
|
111
112
|
}
|
|
112
113
|
NextBytes(buffer) {
|
|
113
114
|
const this$ = this;
|
|
114
|
-
if (buffer
|
|
115
|
+
if (Operators_IsNull(buffer)) {
|
|
115
116
|
throw new Error("buffer");
|
|
116
117
|
}
|
|
117
118
|
for (let i = 0; i <= (buffer.length - 1); i++) {
|
package/Seq.js
CHANGED
|
@@ -2,7 +2,7 @@ import { clear, defaultOf, equals, isDisposable, isArrayLike, toIterator, dispos
|
|
|
2
2
|
import { toString } from "./Types.js";
|
|
3
3
|
import { class_type } from "./Reflection.js";
|
|
4
4
|
import { some, value as value_1 } from "./Option.js";
|
|
5
|
-
import { Operators_Lock, Operators_NullArg } from "./FSharp.Core.js";
|
|
5
|
+
import { Operators_Lock, Operators_NullArg, Operators_IsNull } from "./FSharp.Core.js";
|
|
6
6
|
import { chunkBySize as chunkBySize_1, permute as permute_1, transpose as transpose_1, map as map_1, windowed as windowed_1, splitInto as splitInto_1, pairwise as pairwise_1, scanBack as scanBack_1, reverse as reverse_1, mapFoldBack as mapFoldBack_1, mapFold as mapFold_1, tryItem as tryItem_1, tryHead as tryHead_1, foldBack2 as foldBack2_1, foldBack as foldBack_1, tryFindIndexBack as tryFindIndexBack_1, tryFindBack as tryFindBack_1, singleton as singleton_1 } from "./Array.js";
|
|
7
7
|
import { length as length_1, tryItem as tryItem_2, isEmpty as isEmpty_1, tryHead as tryHead_2, ofSeq as ofSeq_1, ofArray as ofArray_1, toArray as toArray_1, FSharpList } from "./List.js";
|
|
8
8
|
import { SR_indexOutOfBounds } from "./Global.js";
|
|
@@ -144,7 +144,6 @@ export function Enumerator_concat(sources) {
|
|
|
144
144
|
return Enumerator_alreadyFinished();
|
|
145
145
|
}
|
|
146
146
|
}, () => {
|
|
147
|
-
let copyOfStruct;
|
|
148
147
|
if (!started) {
|
|
149
148
|
started = true;
|
|
150
149
|
}
|
|
@@ -154,6 +153,7 @@ export function Enumerator_concat(sources) {
|
|
|
154
153
|
else {
|
|
155
154
|
let res = undefined;
|
|
156
155
|
while (res == null) {
|
|
156
|
+
let copyOfStruct;
|
|
157
157
|
const outerOpt_1 = outerOpt;
|
|
158
158
|
const innerOpt_1 = innerOpt;
|
|
159
159
|
if (outerOpt_1 != null) {
|
|
@@ -297,7 +297,7 @@ export function indexNotFound() {
|
|
|
297
297
|
throw new Error(SR_keyNotFoundAlt);
|
|
298
298
|
}
|
|
299
299
|
export function checkNonNull(argName, arg) {
|
|
300
|
-
if (arg
|
|
300
|
+
if (Operators_IsNull(arg)) {
|
|
301
301
|
Operators_NullArg(argName);
|
|
302
302
|
}
|
|
303
303
|
}
|
|
@@ -1176,16 +1176,16 @@ export function sortWith(comparer, xs) {
|
|
|
1176
1176
|
});
|
|
1177
1177
|
}
|
|
1178
1178
|
export function sort(xs, comparer) {
|
|
1179
|
-
return sortWith((x, y) => comparer.Compare(x, y), xs);
|
|
1179
|
+
return sortWith((x, y) => (comparer.Compare(x, y) | 0), xs);
|
|
1180
1180
|
}
|
|
1181
1181
|
export function sortBy(projection, xs, comparer) {
|
|
1182
|
-
return sortWith((x, y) => comparer.Compare(projection(x), projection(y)), xs);
|
|
1182
|
+
return sortWith((x, y) => (comparer.Compare(projection(x), projection(y)) | 0), xs);
|
|
1183
1183
|
}
|
|
1184
1184
|
export function sortDescending(xs, comparer) {
|
|
1185
|
-
return sortWith((x, y) => (comparer.Compare(x, y) * -1), xs);
|
|
1185
|
+
return sortWith((x, y) => ((comparer.Compare(x, y) * -1) | 0), xs);
|
|
1186
1186
|
}
|
|
1187
1187
|
export function sortByDescending(projection, xs, comparer) {
|
|
1188
|
-
return sortWith((x, y) => (comparer.Compare(projection(x), projection(y)) * -1), xs);
|
|
1188
|
+
return sortWith((x, y) => ((comparer.Compare(projection(x), projection(y)) * -1) | 0), xs);
|
|
1189
1189
|
}
|
|
1190
1190
|
export function sum(xs, adder) {
|
|
1191
1191
|
return fold((acc, x) => adder.Add(acc, x), adder.GetZero(), xs);
|
package/Seq2.js
CHANGED
|
@@ -32,7 +32,7 @@ export function countBy(projection, xs, comparer) {
|
|
|
32
32
|
const key = projection(enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]());
|
|
33
33
|
let matchValue;
|
|
34
34
|
let outArg = 0;
|
|
35
|
-
matchValue = [tryGetValue(dict, key, new FSharpRef(() => outArg, (v) => {
|
|
35
|
+
matchValue = [tryGetValue(dict, key, new FSharpRef(() => (outArg | 0), (v) => {
|
|
36
36
|
outArg = (v | 0);
|
|
37
37
|
})), outArg];
|
|
38
38
|
if (matchValue[0]) {
|
package/Set.js
CHANGED
|
@@ -42,7 +42,7 @@ export function SetTreeNode$1__get_Right(_) {
|
|
|
42
42
|
return _.right;
|
|
43
43
|
}
|
|
44
44
|
export function SetTreeNode$1__get_Height(_) {
|
|
45
|
-
return _.h;
|
|
45
|
+
return _.h | 0;
|
|
46
46
|
}
|
|
47
47
|
export function SetTreeModule_empty() {
|
|
48
48
|
return undefined;
|
|
@@ -69,7 +69,7 @@ export function SetTreeModule_countAux(t_mut, acc_mut) {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
export function SetTreeModule_count(s) {
|
|
72
|
-
return SetTreeModule_countAux(s, 0);
|
|
72
|
+
return SetTreeModule_countAux(s, 0) | 0;
|
|
73
73
|
}
|
|
74
74
|
export function SetTreeModule_mk(l, k, r) {
|
|
75
75
|
let tn, tn_1;
|
|
@@ -1517,7 +1517,7 @@ export function FSharpSet__Remove(s, value) {
|
|
|
1517
1517
|
return FSharpSet_$ctor(FSharpSet__get_Comparer(s), SetTreeModule_remove(FSharpSet__get_Comparer(s), value, FSharpSet__get_Tree(s)));
|
|
1518
1518
|
}
|
|
1519
1519
|
export function FSharpSet__get_Count(s) {
|
|
1520
|
-
return SetTreeModule_count(FSharpSet__get_Tree(s));
|
|
1520
|
+
return SetTreeModule_count(FSharpSet__get_Tree(s)) | 0;
|
|
1521
1521
|
}
|
|
1522
1522
|
export function FSharpSet__Contains(s, value) {
|
|
1523
1523
|
return SetTreeModule_mem(FSharpSet__get_Comparer(s), value, FSharpSet__get_Tree(s));
|
|
@@ -1598,7 +1598,7 @@ export function FSharpSet_Equality(a, b) {
|
|
|
1598
1598
|
return SetTreeModule_compare(FSharpSet__get_Comparer(a), FSharpSet__get_Tree(a), FSharpSet__get_Tree(b)) === 0;
|
|
1599
1599
|
}
|
|
1600
1600
|
export function FSharpSet_Compare(a, b) {
|
|
1601
|
-
return SetTreeModule_compare(FSharpSet__get_Comparer(a), FSharpSet__get_Tree(a), FSharpSet__get_Tree(b));
|
|
1601
|
+
return SetTreeModule_compare(FSharpSet__get_Comparer(a), FSharpSet__get_Tree(a), FSharpSet__get_Tree(b)) | 0;
|
|
1602
1602
|
}
|
|
1603
1603
|
export function FSharpSet__get_Choose(x) {
|
|
1604
1604
|
return SetTreeModule_choose(FSharpSet__get_Tree(x));
|
|
@@ -1696,7 +1696,7 @@ export function map(mapping, set$, comparer) {
|
|
|
1696
1696
|
return FSharpSet__Map(set$, mapping, comparer);
|
|
1697
1697
|
}
|
|
1698
1698
|
export function count(set$) {
|
|
1699
|
-
return FSharpSet__get_Count(set$);
|
|
1699
|
+
return FSharpSet__get_Count(set$) | 0;
|
|
1700
1700
|
}
|
|
1701
1701
|
export function ofList(elements, comparer) {
|
|
1702
1702
|
return FSharpSet_$ctor(comparer, SetTreeModule_ofSeq(comparer, elements));
|
|
@@ -19,13 +19,13 @@ export function Comparer$1_$ctor_47C913C(comparison) {
|
|
|
19
19
|
return new Comparer$1(comparison);
|
|
20
20
|
}
|
|
21
21
|
export function Comparer$1_get_Default() {
|
|
22
|
-
return Comparer$1_$ctor_47C913C(compare);
|
|
22
|
+
return Comparer$1_$ctor_47C913C((e, e_1) => (compare(e, e_1) | 0));
|
|
23
23
|
}
|
|
24
24
|
export function Comparer$1_Create_47C913C(comparison) {
|
|
25
25
|
return Comparer$1_$ctor_47C913C(comparison);
|
|
26
26
|
}
|
|
27
27
|
export function Comparer$1__Compare_5BDDA0(_, x, y) {
|
|
28
|
-
return _.comparison(x, y);
|
|
28
|
+
return _.comparison(x, y) | 0;
|
|
29
29
|
}
|
|
30
30
|
export class EqualityComparer$1 {
|
|
31
31
|
constructor(equals, getHashCode) {
|
|
@@ -48,7 +48,7 @@ export function EqualityComparer$1_$ctor_Z6EE254AB(equals, getHashCode) {
|
|
|
48
48
|
return new EqualityComparer$1(equals, getHashCode);
|
|
49
49
|
}
|
|
50
50
|
export function EqualityComparer$1_get_Default() {
|
|
51
|
-
return EqualityComparer$1_$ctor_Z6EE254AB(equals_1, structuralHash);
|
|
51
|
+
return EqualityComparer$1_$ctor_Z6EE254AB(equals_1, (obj) => (structuralHash(obj) | 0));
|
|
52
52
|
}
|
|
53
53
|
export function EqualityComparer$1_Create_Z6EE254AB(equals, getHashCode) {
|
|
54
54
|
return EqualityComparer$1_$ctor_Z6EE254AB(equals, getHashCode);
|
|
@@ -57,7 +57,7 @@ export function EqualityComparer$1__Equals_5BDDA0(_, x, y) {
|
|
|
57
57
|
return _.equals(x, y);
|
|
58
58
|
}
|
|
59
59
|
export function EqualityComparer$1__GetHashCode_2B595(_, x) {
|
|
60
|
-
return _.getHashCode(x);
|
|
60
|
+
return _.getHashCode(x) | 0;
|
|
61
61
|
}
|
|
62
62
|
export class Stack$1 {
|
|
63
63
|
constructor(initialContents, initialCount) {
|
|
@@ -107,7 +107,7 @@ export function Stack$1__Ensure_Z524259A4(_, newSize) {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
export function Stack$1__get_Count(_) {
|
|
110
|
-
return _.count;
|
|
110
|
+
return _.count | 0;
|
|
111
111
|
}
|
|
112
112
|
export function Stack$1__Pop(_) {
|
|
113
113
|
_.count = ((_.count - 1) | 0);
|
|
@@ -203,7 +203,7 @@ export function Queue$1_$ctor_BB573A(xs) {
|
|
|
203
203
|
return Queue$1_$ctor_Z3B4C077E(arr, arr.length);
|
|
204
204
|
}
|
|
205
205
|
export function Queue$1__get_Count(_) {
|
|
206
|
-
return _.count;
|
|
206
|
+
return _.count | 0;
|
|
207
207
|
}
|
|
208
208
|
export function Queue$1__Enqueue_2B595(_, value) {
|
|
209
209
|
if (_.count === Queue$1__size(_)) {
|
|
@@ -288,10 +288,10 @@ export function Queue$1__CopyTo_Z3B4C077E(_, target, start) {
|
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
export function Queue$1__size(this$) {
|
|
291
|
-
return this$.contents.length;
|
|
291
|
+
return this$.contents.length | 0;
|
|
292
292
|
}
|
|
293
293
|
export function Queue$1__toIndex_Z524259A4(this$, i) {
|
|
294
|
-
return (this$.head + i) % Queue$1__size(this$);
|
|
294
|
+
return ((this$.head + i) % Queue$1__size(this$)) | 0;
|
|
295
295
|
}
|
|
296
296
|
export function Queue$1__ensure_Z524259A4(this$, requiredSize) {
|
|
297
297
|
const newBuffer = fill(new Array(requiredSize), 0, requiredSize, null);
|
package/System.Text.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export declare function StringBuilder_$ctor(): StringBuilder;
|
|
|
13
13
|
export declare function StringBuilder__Append_Z721C83C5(x: StringBuilder, s: string): StringBuilder;
|
|
14
14
|
export declare function StringBuilder__Append_487EF8FB(x: StringBuilder, s: string, startIndex: int32, count: int32): StringBuilder;
|
|
15
15
|
export declare function StringBuilder__Append_244C7CD6(x: StringBuilder, c: string): StringBuilder;
|
|
16
|
+
export declare function StringBuilder__Append_61B1CA(x: StringBuilder, c: string, repeatCount: int32): StringBuilder;
|
|
16
17
|
export declare function StringBuilder__Append_Z524259A4(x: StringBuilder, o: int32): StringBuilder;
|
|
17
18
|
export declare function StringBuilder__Append_5E38073B(x: StringBuilder, o: float64): StringBuilder;
|
|
18
19
|
export declare function StringBuilder__Append_Z1FBCCD16(x: StringBuilder, o: boolean): StringBuilder;
|
package/System.Text.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { replace, format, substring, isNullOrEmpty, join } from "./String.js";
|
|
1
|
+
import { replace, format, replicate, substring, isNullOrEmpty, join } from "./String.js";
|
|
2
2
|
import { class_type } from "./Reflection.js";
|
|
3
3
|
import { clear, int32ToString } from "./Util.js";
|
|
4
4
|
import { toString } from "./Types.js";
|
|
@@ -41,6 +41,11 @@ export function StringBuilder__Append_244C7CD6(x, c) {
|
|
|
41
41
|
void (x.buf.push(c));
|
|
42
42
|
return x;
|
|
43
43
|
}
|
|
44
|
+
export function StringBuilder__Append_61B1CA(x, c, repeatCount) {
|
|
45
|
+
const s = replicate(repeatCount, c);
|
|
46
|
+
void (x.buf.push(s));
|
|
47
|
+
return x;
|
|
48
|
+
}
|
|
44
49
|
export function StringBuilder__Append_Z524259A4(x, o) {
|
|
45
50
|
void (x.buf.push(int32ToString(o)));
|
|
46
51
|
return x;
|
package/Types.js
CHANGED
|
@@ -19,7 +19,7 @@ export function seqToString(self) {
|
|
|
19
19
|
}
|
|
20
20
|
export function toString(x, callStack = 0) {
|
|
21
21
|
if (x != null && typeof x === "object") {
|
|
22
|
-
if (typeof x.toString === "function") {
|
|
22
|
+
if (typeof x.toString === "function" && x.toString !== Object.prototype.toString) {
|
|
23
23
|
return x.toString();
|
|
24
24
|
}
|
|
25
25
|
else if (Symbol.iterator in x) {
|
package/package.json
CHANGED