@fable-org/fable-library-ts 2.0.0-rc.6 → 2.0.0
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 +7 -0
- package/Seq.ts +10 -2
- package/Set.ts +95 -63
- package/String.ts +13 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,13 @@ 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 - 2026-04-21
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
* [JS/TS] Fix `ResizeArray` (`System.Collections.Generic.List`) equality to use reference equality instead of structural equality (fixes #3718)
|
|
15
|
+
* [JS/TS] Fix `String.Contains` ignoring `StringComparison` argument (second argument was silently discarded)
|
|
16
|
+
|
|
10
17
|
## 2.0.0-rc.6 - 2026-04-07
|
|
11
18
|
|
|
12
19
|
### Fixed
|
package/Seq.ts
CHANGED
|
@@ -6,9 +6,10 @@ import { class_type, TypeInfo } from "./Reflection.ts";
|
|
|
6
6
|
import { some, value as value_1, Option } from "./Option.ts";
|
|
7
7
|
import { KeyNotFoundException_$ctor_Z721C83C5 } from "./System.Collections.Generic.ts";
|
|
8
8
|
import { Operators_Lock, Operators_NullArgCheck } from "./FSharp.Core.ts";
|
|
9
|
-
import { randomSampleBy as randomSampleBy_1, randomChoicesBy as randomChoicesBy_1, randomChoice as randomChoice_1, randomChoiceWith as randomChoiceWith_1, randomChoiceBy as randomChoiceBy_1, randomShuffleInPlaceBy, 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,
|
|
9
|
+
import { randomSampleBy as randomSampleBy_1, randomChoicesBy as randomChoicesBy_1, randomChoice as randomChoice_1, randomChoiceWith as randomChoiceWith_1, randomChoiceBy as randomChoiceBy_1, randomShuffleInPlaceBy, 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, item as item_1, foldBack as foldBack_1, tryFindIndexBack as tryFindIndexBack_1, tryFindBack as tryFindBack_1, singleton as singleton_1 } from "./Array.ts";
|
|
10
10
|
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.ts";
|
|
11
11
|
import { float64, int32 } from "./Int32.ts";
|
|
12
|
+
import { min as min_1 } from "./Double.ts";
|
|
12
13
|
import { SR_indexOutOfBounds } from "./Global.ts";
|
|
13
14
|
import { nonSeeded } from "./Random.ts";
|
|
14
15
|
|
|
@@ -724,7 +725,14 @@ export function fold2<T1, T2, State>(folder: ((arg0: State, arg1: T1, arg2: T2)
|
|
|
724
725
|
}
|
|
725
726
|
|
|
726
727
|
export function foldBack2<T1, T2, State>(folder: ((arg0: T1, arg1: T2, arg2: State) => State), xs: Iterable<T1>, ys: Iterable<T2>, state: State): State {
|
|
727
|
-
|
|
728
|
+
const xs_1: MutableArray<T1> = toArray<T1>(xs);
|
|
729
|
+
const ys_1: MutableArray<T2> = toArray<T2>(ys);
|
|
730
|
+
const len: int32 = min_1(xs_1.length, ys_1.length) | 0;
|
|
731
|
+
let acc: State = state;
|
|
732
|
+
for (let i: int32 = len - 1; i >= 0; i--) {
|
|
733
|
+
acc = folder(item_1(i, xs_1), item_1(i, ys_1), acc);
|
|
734
|
+
}
|
|
735
|
+
return acc;
|
|
728
736
|
}
|
|
729
737
|
|
|
730
738
|
export function forAll<$a>(predicate: ((arg0: $a) => boolean), xs: Iterable<$a>): boolean {
|
package/Set.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { record_type, bool_type, list_type, option_type, class_type, TypeInfo } from "./Reflection.ts";
|
|
3
|
-
import { some, value as
|
|
3
|
+
import { some, value as value_2, Option } from "./Option.ts";
|
|
4
4
|
import { int32 } from "./Int32.ts";
|
|
5
5
|
import { structuralHash, ISet, toIterator, IDisposable, disposeSafe, getEnumerator, isArrayLike, MutableArray, IEnumerator, IComparer, Exception } from "./Util.ts";
|
|
6
6
|
import { Record } from "./Types.ts";
|
|
@@ -8,7 +8,7 @@ import { fold as fold_2, cons, singleton as singleton_1, empty as empty_1, ofArr
|
|
|
8
8
|
import { fold as fold_1, fill, setItem } from "./Array.ts";
|
|
9
9
|
import { join } from "./String.ts";
|
|
10
10
|
import { NotSupportedException_$ctor_Z721C83C5 } from "./System.ts";
|
|
11
|
-
import { exists as exists_1,
|
|
11
|
+
import { skip, truncate, iterateIndexed, exists as exists_1, forAll as forAll_1, fold as fold_3, reduce, iterate as iterate_1, map as map_1 } from "./Seq.ts";
|
|
12
12
|
import { HashSet__get_Comparer, HashSet_$ctor_Z6150332D, HashSet } from "./MutableSet.ts";
|
|
13
13
|
|
|
14
14
|
export class SetTreeLeaf$1<T> {
|
|
@@ -71,7 +71,7 @@ export function SetTreeModule_countAux<T>(t_mut: Option<SetTreeLeaf$1<T>>, acc_m
|
|
|
71
71
|
while (true) {
|
|
72
72
|
const t: Option<SetTreeLeaf$1<T>> = t_mut, acc: int32 = acc_mut;
|
|
73
73
|
if (t != null) {
|
|
74
|
-
const t2: SetTreeLeaf$1<T> =
|
|
74
|
+
const t2: SetTreeLeaf$1<T> = value_2(t);
|
|
75
75
|
if (t2 instanceof SetTreeNode$1) {
|
|
76
76
|
const tn = t2 as SetTreeNode$1<T>;
|
|
77
77
|
t_mut = SetTreeNode$1__get_Left<T>(tn);
|
|
@@ -98,7 +98,7 @@ export function SetTreeModule_mk<T>(l: Option<SetTreeLeaf$1<T>>, k: T, r: Option
|
|
|
98
98
|
let hl: int32;
|
|
99
99
|
const t: Option<SetTreeLeaf$1<T>> = l;
|
|
100
100
|
if (t != null) {
|
|
101
|
-
const t2: SetTreeLeaf$1<T> =
|
|
101
|
+
const t2: SetTreeLeaf$1<T> = value_2(t);
|
|
102
102
|
hl = ((t2 instanceof SetTreeNode$1) ? ((tn = (t2 as SetTreeNode$1<T>), SetTreeNode$1__get_Height<T>(tn))) : 1);
|
|
103
103
|
}
|
|
104
104
|
else {
|
|
@@ -107,7 +107,7 @@ export function SetTreeModule_mk<T>(l: Option<SetTreeLeaf$1<T>>, k: T, r: Option
|
|
|
107
107
|
let hr: int32;
|
|
108
108
|
const t_1: Option<SetTreeLeaf$1<T>> = r;
|
|
109
109
|
if (t_1 != null) {
|
|
110
|
-
const t2_1: SetTreeLeaf$1<T> =
|
|
110
|
+
const t2_1: SetTreeLeaf$1<T> = value_2(t_1);
|
|
111
111
|
hr = ((t2_1 instanceof SetTreeNode$1) ? ((tn_1 = (t2_1 as SetTreeNode$1<T>), SetTreeNode$1__get_Height<T>(tn_1))) : 1);
|
|
112
112
|
}
|
|
113
113
|
else {
|
|
@@ -127,7 +127,7 @@ export function SetTreeModule_rebalance<T>(t1: Option<SetTreeLeaf$1<T>>, v: T, t
|
|
|
127
127
|
let t1h: int32;
|
|
128
128
|
const t: Option<SetTreeLeaf$1<T>> = t1;
|
|
129
129
|
if (t != null) {
|
|
130
|
-
const t2_1: SetTreeLeaf$1<T> =
|
|
130
|
+
const t2_1: SetTreeLeaf$1<T> = value_2(t);
|
|
131
131
|
t1h = ((t2_1 instanceof SetTreeNode$1) ? ((tn = (t2_1 as SetTreeNode$1<T>), SetTreeNode$1__get_Height<T>(tn))) : 1);
|
|
132
132
|
}
|
|
133
133
|
else {
|
|
@@ -136,18 +136,18 @@ export function SetTreeModule_rebalance<T>(t1: Option<SetTreeLeaf$1<T>>, v: T, t
|
|
|
136
136
|
let t2h: int32;
|
|
137
137
|
const t_1: Option<SetTreeLeaf$1<T>> = t2;
|
|
138
138
|
if (t_1 != null) {
|
|
139
|
-
const t2_2: SetTreeLeaf$1<T> =
|
|
139
|
+
const t2_2: SetTreeLeaf$1<T> = value_2(t_1);
|
|
140
140
|
t2h = ((t2_2 instanceof SetTreeNode$1) ? ((tn_1 = (t2_2 as SetTreeNode$1<T>), SetTreeNode$1__get_Height<T>(tn_1))) : 1);
|
|
141
141
|
}
|
|
142
142
|
else {
|
|
143
143
|
t2h = 0;
|
|
144
144
|
}
|
|
145
145
|
if (t2h > (t1h + 2)) {
|
|
146
|
-
const matchValue: SetTreeLeaf$1<T> =
|
|
146
|
+
const matchValue: SetTreeLeaf$1<T> = value_2(t2);
|
|
147
147
|
if (matchValue instanceof SetTreeNode$1) {
|
|
148
148
|
const t2$0027 = matchValue as SetTreeNode$1<T>;
|
|
149
|
-
if (((t_2 = SetTreeNode$1__get_Left<T>(t2$0027), (t_2 != null) ? ((t2_3 =
|
|
150
|
-
const matchValue_1: SetTreeLeaf$1<T> =
|
|
149
|
+
if (((t_2 = SetTreeNode$1__get_Left<T>(t2$0027), (t_2 != null) ? ((t2_3 = value_2(t_2), (t2_3 instanceof SetTreeNode$1) ? ((tn_2 = (t2_3 as SetTreeNode$1<T>), SetTreeNode$1__get_Height<T>(tn_2))) : 1)) : 0)) > (t1h + 1)) {
|
|
150
|
+
const matchValue_1: SetTreeLeaf$1<T> = value_2(SetTreeNode$1__get_Left<T>(t2$0027));
|
|
151
151
|
if (matchValue_1 instanceof SetTreeNode$1) {
|
|
152
152
|
const t2l = matchValue_1 as SetTreeNode$1<T>;
|
|
153
153
|
return SetTreeModule_mk<T>(SetTreeModule_mk<T>(t1, v, SetTreeNode$1__get_Left<T>(t2l)), SetTreeLeaf$1__get_Key<T>(t2l), SetTreeModule_mk<T>(SetTreeNode$1__get_Right<T>(t2l), SetTreeLeaf$1__get_Key<T>(t2$0027), SetTreeNode$1__get_Right<T>(t2$0027)));
|
|
@@ -165,11 +165,11 @@ export function SetTreeModule_rebalance<T>(t1: Option<SetTreeLeaf$1<T>>, v: T, t
|
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
else if (t1h > (t2h + 2)) {
|
|
168
|
-
const matchValue_2: SetTreeLeaf$1<T> =
|
|
168
|
+
const matchValue_2: SetTreeLeaf$1<T> = value_2(t1);
|
|
169
169
|
if (matchValue_2 instanceof SetTreeNode$1) {
|
|
170
170
|
const t1$0027 = matchValue_2 as SetTreeNode$1<T>;
|
|
171
|
-
if (((t_3 = SetTreeNode$1__get_Right<T>(t1$0027), (t_3 != null) ? ((t2_4 =
|
|
172
|
-
const matchValue_3: SetTreeLeaf$1<T> =
|
|
171
|
+
if (((t_3 = SetTreeNode$1__get_Right<T>(t1$0027), (t_3 != null) ? ((t2_4 = value_2(t_3), (t2_4 instanceof SetTreeNode$1) ? ((tn_3 = (t2_4 as SetTreeNode$1<T>), SetTreeNode$1__get_Height<T>(tn_3))) : 1)) : 0)) > (t2h + 1)) {
|
|
172
|
+
const matchValue_3: SetTreeLeaf$1<T> = value_2(SetTreeNode$1__get_Right<T>(t1$0027));
|
|
173
173
|
if (matchValue_3 instanceof SetTreeNode$1) {
|
|
174
174
|
const t1r = matchValue_3 as SetTreeNode$1<T>;
|
|
175
175
|
return SetTreeModule_mk<T>(SetTreeModule_mk<T>(SetTreeNode$1__get_Left<T>(t1$0027), SetTreeLeaf$1__get_Key<T>(t1$0027), SetTreeNode$1__get_Left<T>(t1r)), SetTreeLeaf$1__get_Key<T>(t1r), SetTreeModule_mk<T>(SetTreeNode$1__get_Right<T>(t1r), v, t2));
|
|
@@ -193,7 +193,7 @@ export function SetTreeModule_rebalance<T>(t1: Option<SetTreeLeaf$1<T>>, v: T, t
|
|
|
193
193
|
|
|
194
194
|
export function SetTreeModule_add<T>(comparer: IComparer<T>, k: T, t: Option<SetTreeLeaf$1<T>>): Option<SetTreeLeaf$1<T>> {
|
|
195
195
|
if (t != null) {
|
|
196
|
-
const t2: SetTreeLeaf$1<T> =
|
|
196
|
+
const t2: SetTreeLeaf$1<T> = value_2(t);
|
|
197
197
|
const c: int32 = comparer.Compare(k, SetTreeLeaf$1__get_Key<T>(t2)) | 0;
|
|
198
198
|
if (t2 instanceof SetTreeNode$1) {
|
|
199
199
|
const tn = t2 as SetTreeNode$1<T>;
|
|
@@ -227,9 +227,9 @@ export function SetTreeModule_add<T>(comparer: IComparer<T>, k: T, t: Option<Set
|
|
|
227
227
|
|
|
228
228
|
export function SetTreeModule_balance<T>(comparer: IComparer<T>, t1: Option<SetTreeLeaf$1<T>>, k: T, t2: Option<SetTreeLeaf$1<T>>): Option<SetTreeLeaf$1<T>> {
|
|
229
229
|
if (t1 != null) {
|
|
230
|
-
const t1$0027: SetTreeLeaf$1<T> =
|
|
230
|
+
const t1$0027: SetTreeLeaf$1<T> = value_2(t1);
|
|
231
231
|
if (t2 != null) {
|
|
232
|
-
const t2$0027: SetTreeLeaf$1<T> =
|
|
232
|
+
const t2$0027: SetTreeLeaf$1<T> = value_2(t2);
|
|
233
233
|
if (t1$0027 instanceof SetTreeNode$1) {
|
|
234
234
|
const t1n = t1$0027 as SetTreeNode$1<T>;
|
|
235
235
|
if (t2$0027 instanceof SetTreeNode$1) {
|
|
@@ -263,7 +263,7 @@ export function SetTreeModule_balance<T>(comparer: IComparer<T>, t1: Option<SetT
|
|
|
263
263
|
|
|
264
264
|
export function SetTreeModule_split<T>(comparer: IComparer<T>, pivot: T, t: Option<SetTreeLeaf$1<T>>): [Option<SetTreeLeaf$1<T>>, boolean, Option<SetTreeLeaf$1<T>>] {
|
|
265
265
|
if (t != null) {
|
|
266
|
-
const t2: SetTreeLeaf$1<T> =
|
|
266
|
+
const t2: SetTreeLeaf$1<T> = value_2(t);
|
|
267
267
|
if (t2 instanceof SetTreeNode$1) {
|
|
268
268
|
const tn = t2 as SetTreeNode$1<T>;
|
|
269
269
|
const c: int32 = comparer.Compare(pivot, SetTreeLeaf$1__get_Key<T>(tn)) | 0;
|
|
@@ -299,7 +299,7 @@ export function SetTreeModule_split<T>(comparer: IComparer<T>, pivot: T, t: Opti
|
|
|
299
299
|
|
|
300
300
|
export function SetTreeModule_spliceOutSuccessor<T>(t: Option<SetTreeLeaf$1<T>>): [T, Option<SetTreeLeaf$1<T>>] {
|
|
301
301
|
if (t != null) {
|
|
302
|
-
const t2: SetTreeLeaf$1<T> =
|
|
302
|
+
const t2: SetTreeLeaf$1<T> = value_2(t);
|
|
303
303
|
if (t2 instanceof SetTreeNode$1) {
|
|
304
304
|
const tn = t2 as SetTreeNode$1<T>;
|
|
305
305
|
if (SetTreeNode$1__get_Left<T>(tn) == null) {
|
|
@@ -321,7 +321,7 @@ export function SetTreeModule_spliceOutSuccessor<T>(t: Option<SetTreeLeaf$1<T>>)
|
|
|
321
321
|
|
|
322
322
|
export function SetTreeModule_remove<T>(comparer: IComparer<T>, k: T, t: Option<SetTreeLeaf$1<T>>): Option<SetTreeLeaf$1<T>> {
|
|
323
323
|
if (t != null) {
|
|
324
|
-
const t2: SetTreeLeaf$1<T> =
|
|
324
|
+
const t2: SetTreeLeaf$1<T> = value_2(t);
|
|
325
325
|
const c: int32 = comparer.Compare(k, SetTreeLeaf$1__get_Key<T>(t2)) | 0;
|
|
326
326
|
if (t2 instanceof SetTreeNode$1) {
|
|
327
327
|
const tn = t2 as SetTreeNode$1<T>;
|
|
@@ -361,7 +361,7 @@ export function SetTreeModule_mem<T>(comparer_mut: IComparer<T>, k_mut: T, t_mut
|
|
|
361
361
|
while (true) {
|
|
362
362
|
const comparer: IComparer<T> = comparer_mut, k: T = k_mut, t: Option<SetTreeLeaf$1<T>> = t_mut;
|
|
363
363
|
if (t != null) {
|
|
364
|
-
const t2: SetTreeLeaf$1<T> =
|
|
364
|
+
const t2: SetTreeLeaf$1<T> = value_2(t);
|
|
365
365
|
const c: int32 = comparer.Compare(k, SetTreeLeaf$1__get_Key<T>(t2)) | 0;
|
|
366
366
|
if (t2 instanceof SetTreeNode$1) {
|
|
367
367
|
const tn = t2 as SetTreeNode$1<T>;
|
|
@@ -397,7 +397,7 @@ export function SetTreeModule_iter<T>(f_mut: ((arg0: T) => void), t_mut: Option<
|
|
|
397
397
|
while (true) {
|
|
398
398
|
const f: ((arg0: T) => void) = f_mut, t: Option<SetTreeLeaf$1<T>> = t_mut;
|
|
399
399
|
if (t != null) {
|
|
400
|
-
const t2: SetTreeLeaf$1<T> =
|
|
400
|
+
const t2: SetTreeLeaf$1<T> = value_2(t);
|
|
401
401
|
if (t2 instanceof SetTreeNode$1) {
|
|
402
402
|
const tn = t2 as SetTreeNode$1<T>;
|
|
403
403
|
SetTreeModule_iter<T>(f, SetTreeNode$1__get_Left<T>(tn));
|
|
@@ -419,7 +419,7 @@ export function SetTreeModule_foldBackOpt<T, $a>(f_mut: any, t_mut: Option<SetTr
|
|
|
419
419
|
while (true) {
|
|
420
420
|
const f: any = f_mut, t: Option<SetTreeLeaf$1<T>> = t_mut, x: $a = x_mut;
|
|
421
421
|
if (t != null) {
|
|
422
|
-
const t2: SetTreeLeaf$1<T> =
|
|
422
|
+
const t2: SetTreeLeaf$1<T> = value_2(t);
|
|
423
423
|
if (t2 instanceof SetTreeNode$1) {
|
|
424
424
|
const tn = t2 as SetTreeNode$1<T>;
|
|
425
425
|
f_mut = f;
|
|
@@ -447,7 +447,7 @@ export function SetTreeModule_foldOpt<$a, T>(f_mut: any, x_mut: $a, t_mut: Optio
|
|
|
447
447
|
while (true) {
|
|
448
448
|
const f: any = f_mut, x: $a = x_mut, t: Option<SetTreeLeaf$1<T>> = t_mut;
|
|
449
449
|
if (t != null) {
|
|
450
|
-
const t2: SetTreeLeaf$1<T> =
|
|
450
|
+
const t2: SetTreeLeaf$1<T> = value_2(t);
|
|
451
451
|
if (t2 instanceof SetTreeNode$1) {
|
|
452
452
|
const tn = t2 as SetTreeNode$1<T>;
|
|
453
453
|
f_mut = f;
|
|
@@ -475,7 +475,7 @@ export function SetTreeModule_forall<T>(f_mut: ((arg0: T) => boolean), t_mut: Op
|
|
|
475
475
|
while (true) {
|
|
476
476
|
const f: ((arg0: T) => boolean) = f_mut, t: Option<SetTreeLeaf$1<T>> = t_mut;
|
|
477
477
|
if (t != null) {
|
|
478
|
-
const t2: SetTreeLeaf$1<T> =
|
|
478
|
+
const t2: SetTreeLeaf$1<T> = value_2(t);
|
|
479
479
|
if (t2 instanceof SetTreeNode$1) {
|
|
480
480
|
const tn = t2 as SetTreeNode$1<T>;
|
|
481
481
|
if (f(SetTreeLeaf$1__get_Key<T>(tn)) && SetTreeModule_forall<T>(f, SetTreeNode$1__get_Left<T>(tn))) {
|
|
@@ -503,7 +503,7 @@ export function SetTreeModule_exists<T>(f_mut: ((arg0: T) => boolean), t_mut: Op
|
|
|
503
503
|
while (true) {
|
|
504
504
|
const f: ((arg0: T) => boolean) = f_mut, t: Option<SetTreeLeaf$1<T>> = t_mut;
|
|
505
505
|
if (t != null) {
|
|
506
|
-
const t2: SetTreeLeaf$1<T> =
|
|
506
|
+
const t2: SetTreeLeaf$1<T> = value_2(t);
|
|
507
507
|
if (t2 instanceof SetTreeNode$1) {
|
|
508
508
|
const tn = t2 as SetTreeNode$1<T>;
|
|
509
509
|
if (f(SetTreeLeaf$1__get_Key<T>(tn)) ? true : SetTreeModule_exists<T>(f, SetTreeNode$1__get_Left<T>(tn))) {
|
|
@@ -544,7 +544,7 @@ export function SetTreeModule_filterAux<T>(comparer_mut: IComparer<T>, f_mut: ((
|
|
|
544
544
|
while (true) {
|
|
545
545
|
const comparer: IComparer<T> = comparer_mut, f: ((arg0: T) => boolean) = f_mut, t: Option<SetTreeLeaf$1<T>> = t_mut, acc: Option<SetTreeLeaf$1<T>> = acc_mut;
|
|
546
546
|
if (t != null) {
|
|
547
|
-
const t2: SetTreeLeaf$1<T> =
|
|
547
|
+
const t2: SetTreeLeaf$1<T> = value_2(t);
|
|
548
548
|
if (t2 instanceof SetTreeNode$1) {
|
|
549
549
|
const tn = t2 as SetTreeNode$1<T>;
|
|
550
550
|
const acc_1: Option<SetTreeLeaf$1<T>> = f(SetTreeLeaf$1__get_Key<T>(tn)) ? SetTreeModule_add<T>(comparer, SetTreeLeaf$1__get_Key<T>(tn), acc) : acc;
|
|
@@ -580,7 +580,7 @@ export function SetTreeModule_diffAux<T>(comparer_mut: IComparer<T>, t_mut: Opti
|
|
|
580
580
|
return acc;
|
|
581
581
|
}
|
|
582
582
|
else if (t != null) {
|
|
583
|
-
const t2: SetTreeLeaf$1<T> =
|
|
583
|
+
const t2: SetTreeLeaf$1<T> = value_2(t);
|
|
584
584
|
if (t2 instanceof SetTreeNode$1) {
|
|
585
585
|
const tn = t2 as SetTreeNode$1<T>;
|
|
586
586
|
comparer_mut = comparer;
|
|
@@ -605,9 +605,9 @@ export function SetTreeModule_diff<$a>(comparer: IComparer<$a>, a: Option<SetTre
|
|
|
605
605
|
|
|
606
606
|
export function SetTreeModule_union<T>(comparer: IComparer<T>, t1: Option<SetTreeLeaf$1<T>>, t2: Option<SetTreeLeaf$1<T>>): Option<SetTreeLeaf$1<T>> {
|
|
607
607
|
if (t1 != null) {
|
|
608
|
-
const t1$0027: SetTreeLeaf$1<T> =
|
|
608
|
+
const t1$0027: SetTreeLeaf$1<T> = value_2(t1);
|
|
609
609
|
if (t2 != null) {
|
|
610
|
-
const t2$0027: SetTreeLeaf$1<T> =
|
|
610
|
+
const t2$0027: SetTreeLeaf$1<T> = value_2(t2);
|
|
611
611
|
if (t1$0027 instanceof SetTreeNode$1) {
|
|
612
612
|
const t1n = t1$0027 as SetTreeNode$1<T>;
|
|
613
613
|
if (t2$0027 instanceof SetTreeNode$1) {
|
|
@@ -643,7 +643,7 @@ export function SetTreeModule_intersectionAux<T>(comparer_mut: IComparer<T>, b_m
|
|
|
643
643
|
while (true) {
|
|
644
644
|
const comparer: IComparer<T> = comparer_mut, b: Option<SetTreeLeaf$1<T>> = b_mut, t: Option<SetTreeLeaf$1<T>> = t_mut, acc: Option<SetTreeLeaf$1<T>> = acc_mut;
|
|
645
645
|
if (t != null) {
|
|
646
|
-
const t2: SetTreeLeaf$1<T> =
|
|
646
|
+
const t2: SetTreeLeaf$1<T> = value_2(t);
|
|
647
647
|
if (t2 instanceof SetTreeNode$1) {
|
|
648
648
|
const tn = t2 as SetTreeNode$1<T>;
|
|
649
649
|
const acc_1: Option<SetTreeLeaf$1<T>> = SetTreeModule_intersectionAux<T>(comparer, b, SetTreeNode$1__get_Right<T>(tn), acc);
|
|
@@ -687,7 +687,7 @@ export function SetTreeModule_partitionAux<T>(comparer_mut: IComparer<T>, f_mut:
|
|
|
687
687
|
const comparer: IComparer<T> = comparer_mut, f: ((arg0: T) => boolean) = f_mut, t: Option<SetTreeLeaf$1<T>> = t_mut, acc_: Option<SetTreeLeaf$1<T>> = acc__mut, acc__1: Option<SetTreeLeaf$1<T>> = acc__1_mut;
|
|
688
688
|
const acc = [acc_, acc__1] as [Option<SetTreeLeaf$1<T>>, Option<SetTreeLeaf$1<T>>];
|
|
689
689
|
if (t != null) {
|
|
690
|
-
const t2: SetTreeLeaf$1<T> =
|
|
690
|
+
const t2: SetTreeLeaf$1<T> = value_2(t);
|
|
691
691
|
if (t2 instanceof SetTreeNode$1) {
|
|
692
692
|
const tn = t2 as SetTreeNode$1<T>;
|
|
693
693
|
const acc_1: [Option<SetTreeLeaf$1<T>>, Option<SetTreeLeaf$1<T>>] = SetTreeModule_partitionAux<T>(comparer, f, SetTreeNode$1__get_Right<T>(tn), acc[0], acc[1]);
|
|
@@ -719,7 +719,7 @@ export function SetTreeModule_minimumElementAux<T>(t_mut: Option<SetTreeLeaf$1<T
|
|
|
719
719
|
while (true) {
|
|
720
720
|
const t: Option<SetTreeLeaf$1<T>> = t_mut, n: T = n_mut;
|
|
721
721
|
if (t != null) {
|
|
722
|
-
const t2: SetTreeLeaf$1<T> =
|
|
722
|
+
const t2: SetTreeLeaf$1<T> = value_2(t);
|
|
723
723
|
if (t2 instanceof SetTreeNode$1) {
|
|
724
724
|
const tn = t2 as SetTreeNode$1<T>;
|
|
725
725
|
t_mut = SetTreeNode$1__get_Left<T>(tn);
|
|
@@ -739,7 +739,7 @@ export function SetTreeModule_minimumElementAux<T>(t_mut: Option<SetTreeLeaf$1<T
|
|
|
739
739
|
|
|
740
740
|
export function SetTreeModule_minimumElementOpt<T>(t: Option<SetTreeLeaf$1<T>>): Option<T> {
|
|
741
741
|
if (t != null) {
|
|
742
|
-
const t2: SetTreeLeaf$1<T> =
|
|
742
|
+
const t2: SetTreeLeaf$1<T> = value_2(t);
|
|
743
743
|
if (t2 instanceof SetTreeNode$1) {
|
|
744
744
|
const tn = t2 as SetTreeNode$1<T>;
|
|
745
745
|
return some(SetTreeModule_minimumElementAux<T>(SetTreeNode$1__get_Left<T>(tn), SetTreeLeaf$1__get_Key<T>(tn)));
|
|
@@ -758,7 +758,7 @@ export function SetTreeModule_maximumElementAux<T>(t_mut: Option<SetTreeLeaf$1<T
|
|
|
758
758
|
while (true) {
|
|
759
759
|
const t: Option<SetTreeLeaf$1<T>> = t_mut, n: T = n_mut;
|
|
760
760
|
if (t != null) {
|
|
761
|
-
const t2: SetTreeLeaf$1<T> =
|
|
761
|
+
const t2: SetTreeLeaf$1<T> = value_2(t);
|
|
762
762
|
if (t2 instanceof SetTreeNode$1) {
|
|
763
763
|
const tn = t2 as SetTreeNode$1<T>;
|
|
764
764
|
t_mut = SetTreeNode$1__get_Right<T>(tn);
|
|
@@ -778,7 +778,7 @@ export function SetTreeModule_maximumElementAux<T>(t_mut: Option<SetTreeLeaf$1<T
|
|
|
778
778
|
|
|
779
779
|
export function SetTreeModule_maximumElementOpt<T>(t: Option<SetTreeLeaf$1<T>>): Option<T> {
|
|
780
780
|
if (t != null) {
|
|
781
|
-
const t2: SetTreeLeaf$1<T> =
|
|
781
|
+
const t2: SetTreeLeaf$1<T> = value_2(t);
|
|
782
782
|
if (t2 instanceof SetTreeNode$1) {
|
|
783
783
|
const tn = t2 as SetTreeNode$1<T>;
|
|
784
784
|
return some(SetTreeModule_maximumElementAux<T>(SetTreeNode$1__get_Right<T>(tn), SetTreeLeaf$1__get_Key<T>(tn)));
|
|
@@ -798,7 +798,7 @@ export function SetTreeModule_minimumElement<$a>(s: Option<SetTreeLeaf$1<$a>>):
|
|
|
798
798
|
throw new Exception("Set contains no elements");
|
|
799
799
|
}
|
|
800
800
|
else {
|
|
801
|
-
return
|
|
801
|
+
return value_2(matchValue);
|
|
802
802
|
}
|
|
803
803
|
}
|
|
804
804
|
|
|
@@ -808,7 +808,7 @@ export function SetTreeModule_maximumElement<$a>(s: Option<SetTreeLeaf$1<$a>>):
|
|
|
808
808
|
throw new Exception("Set contains no elements");
|
|
809
809
|
}
|
|
810
810
|
else {
|
|
811
|
-
return
|
|
811
|
+
return value_2(matchValue);
|
|
812
812
|
}
|
|
813
813
|
}
|
|
814
814
|
|
|
@@ -834,7 +834,7 @@ export function SetTreeModule_collapseLHS<T>(stack_mut: FSharpList<Option<SetTre
|
|
|
834
834
|
const x: Option<SetTreeLeaf$1<T>> = head(stack);
|
|
835
835
|
const rest: FSharpList<Option<SetTreeLeaf$1<T>>> = tail(stack);
|
|
836
836
|
if (x != null) {
|
|
837
|
-
const x2: SetTreeLeaf$1<T> =
|
|
837
|
+
const x2: SetTreeLeaf$1<T> = value_2(x);
|
|
838
838
|
if (x2 instanceof SetTreeNode$1) {
|
|
839
839
|
const xn = x2 as SetTreeNode$1<T>;
|
|
840
840
|
stack_mut = ofArrayWithTail([SetTreeNode$1__get_Left<T>(xn), SetTreeLeaf$1_$ctor_2B595<T>(SetTreeLeaf$1__get_Key<T>(xn)), SetTreeNode$1__get_Right<T>(xn)], rest);
|
|
@@ -875,7 +875,7 @@ export function SetTreeModule_current<$a>(i: SetTreeModule_SetIterator$1<$a>): $
|
|
|
875
875
|
return SetTreeModule_alreadyFinished<$a>();
|
|
876
876
|
}
|
|
877
877
|
else if (head(matchValue) != null) {
|
|
878
|
-
const t: SetTreeLeaf$1<$a> =
|
|
878
|
+
const t: SetTreeLeaf$1<$a> = value_2(head(matchValue));
|
|
879
879
|
return SetTreeLeaf$1__get_Key<$a>(t);
|
|
880
880
|
}
|
|
881
881
|
else {
|
|
@@ -892,7 +892,7 @@ export function SetTreeModule_moveNext<T>(i: SetTreeModule_SetIterator$1<T>): bo
|
|
|
892
892
|
const matchValue: FSharpList<Option<SetTreeLeaf$1<T>>> = i.stack;
|
|
893
893
|
if (!isEmpty_1(matchValue)) {
|
|
894
894
|
if (head(matchValue) != null) {
|
|
895
|
-
const t: SetTreeLeaf$1<T> =
|
|
895
|
+
const t: SetTreeLeaf$1<T> = value_2(head(matchValue));
|
|
896
896
|
if (t instanceof SetTreeNode$1) {
|
|
897
897
|
throw new Exception("Please report error: Set iterator, unexpected stack for moveNext");
|
|
898
898
|
}
|
|
@@ -946,8 +946,8 @@ export function SetTreeModule_compareStacks<T>(comparer_mut: IComparer<T>, l1_mu
|
|
|
946
946
|
if (!isEmpty_1(l2)) {
|
|
947
947
|
if (head(l2) != null) {
|
|
948
948
|
if (head(l1) != null) {
|
|
949
|
-
const x1_3: SetTreeLeaf$1<T> =
|
|
950
|
-
const x2_3: SetTreeLeaf$1<T> =
|
|
949
|
+
const x1_3: SetTreeLeaf$1<T> = value_2(head(l1));
|
|
950
|
+
const x2_3: SetTreeLeaf$1<T> = value_2(head(l2));
|
|
951
951
|
if (x1_3 instanceof SetTreeNode$1) {
|
|
952
952
|
const x1n_2 = x1_3 as SetTreeNode$1<T>;
|
|
953
953
|
if (SetTreeNode$1__get_Left<T>(x1n_2) == null) {
|
|
@@ -971,13 +971,13 @@ export function SetTreeModule_compareStacks<T>(comparer_mut: IComparer<T>, l1_mu
|
|
|
971
971
|
if (head(l1) != null) {
|
|
972
972
|
matchResult = 0;
|
|
973
973
|
t1_6 = tail(l1);
|
|
974
|
-
x1_4 =
|
|
974
|
+
x1_4 = value_2(head(l1));
|
|
975
975
|
}
|
|
976
976
|
else if (!isEmpty_1(l2)) {
|
|
977
977
|
if (head(l2) != null) {
|
|
978
978
|
matchResult = 1;
|
|
979
979
|
t2_6 = tail(l2);
|
|
980
|
-
x2_4 =
|
|
980
|
+
x2_4 = value_2(head(l2));
|
|
981
981
|
}
|
|
982
982
|
else {
|
|
983
983
|
matchResult = 2;
|
|
@@ -991,7 +991,7 @@ export function SetTreeModule_compareStacks<T>(comparer_mut: IComparer<T>, l1_mu
|
|
|
991
991
|
if (head(l2) != null) {
|
|
992
992
|
matchResult = 1;
|
|
993
993
|
t2_6 = tail(l2);
|
|
994
|
-
x2_4 =
|
|
994
|
+
x2_4 = value_2(head(l2));
|
|
995
995
|
}
|
|
996
996
|
else {
|
|
997
997
|
matchResult = 2;
|
|
@@ -1053,13 +1053,13 @@ export function SetTreeModule_compareStacks<T>(comparer_mut: IComparer<T>, l1_mu
|
|
|
1053
1053
|
if (head(l1) != null) {
|
|
1054
1054
|
matchResult_1 = 0;
|
|
1055
1055
|
t1_7 = tail(l1);
|
|
1056
|
-
x1_5 =
|
|
1056
|
+
x1_5 = value_2(head(l1));
|
|
1057
1057
|
}
|
|
1058
1058
|
else if (!isEmpty_1(l2)) {
|
|
1059
1059
|
if (head(l2) != null) {
|
|
1060
1060
|
matchResult_1 = 1;
|
|
1061
1061
|
t2_7 = tail(l2);
|
|
1062
|
-
x2_5 =
|
|
1062
|
+
x2_5 = value_2(head(l2));
|
|
1063
1063
|
}
|
|
1064
1064
|
else {
|
|
1065
1065
|
matchResult_1 = 2;
|
|
@@ -1073,7 +1073,7 @@ export function SetTreeModule_compareStacks<T>(comparer_mut: IComparer<T>, l1_mu
|
|
|
1073
1073
|
if (head(l2) != null) {
|
|
1074
1074
|
matchResult_1 = 1;
|
|
1075
1075
|
t2_7 = tail(l2);
|
|
1076
|
-
x2_5 =
|
|
1076
|
+
x2_5 = value_2(head(l2));
|
|
1077
1077
|
}
|
|
1078
1078
|
else {
|
|
1079
1079
|
matchResult_1 = 2;
|
|
@@ -1136,13 +1136,13 @@ export function SetTreeModule_compareStacks<T>(comparer_mut: IComparer<T>, l1_mu
|
|
|
1136
1136
|
if (head(l1) != null) {
|
|
1137
1137
|
matchResult_2 = 0;
|
|
1138
1138
|
t1_8 = tail(l1);
|
|
1139
|
-
x1_6 =
|
|
1139
|
+
x1_6 = value_2(head(l1));
|
|
1140
1140
|
}
|
|
1141
1141
|
else if (!isEmpty_1(l2)) {
|
|
1142
1142
|
if (head(l2) != null) {
|
|
1143
1143
|
matchResult_2 = 1;
|
|
1144
1144
|
t2_8 = tail(l2);
|
|
1145
|
-
x2_6 =
|
|
1145
|
+
x2_6 = value_2(head(l2));
|
|
1146
1146
|
}
|
|
1147
1147
|
else {
|
|
1148
1148
|
matchResult_2 = 2;
|
|
@@ -1156,7 +1156,7 @@ export function SetTreeModule_compareStacks<T>(comparer_mut: IComparer<T>, l1_mu
|
|
|
1156
1156
|
if (head(l2) != null) {
|
|
1157
1157
|
matchResult_2 = 1;
|
|
1158
1158
|
t2_8 = tail(l2);
|
|
1159
|
-
x2_6 =
|
|
1159
|
+
x2_6 = value_2(head(l2));
|
|
1160
1160
|
}
|
|
1161
1161
|
else {
|
|
1162
1162
|
matchResult_2 = 2;
|
|
@@ -1213,19 +1213,19 @@ export function SetTreeModule_compareStacks<T>(comparer_mut: IComparer<T>, l1_mu
|
|
|
1213
1213
|
}
|
|
1214
1214
|
}
|
|
1215
1215
|
else {
|
|
1216
|
-
const x2: SetTreeLeaf$1<T> =
|
|
1216
|
+
const x2: SetTreeLeaf$1<T> = value_2(head(l2));
|
|
1217
1217
|
let matchResult_3: int32 = (undefined as any), t1_2: FSharpList<Option<SetTreeLeaf$1<T>>> = (undefined as any), x1: SetTreeLeaf$1<T> = (undefined as any), t2_2: FSharpList<Option<SetTreeLeaf$1<T>>> = (undefined as any), x2_1: SetTreeLeaf$1<T> = (undefined as any);
|
|
1218
1218
|
if (!isEmpty_1(l1)) {
|
|
1219
1219
|
if (head(l1) != null) {
|
|
1220
1220
|
matchResult_3 = 0;
|
|
1221
1221
|
t1_2 = tail(l1);
|
|
1222
|
-
x1 =
|
|
1222
|
+
x1 = value_2(head(l1));
|
|
1223
1223
|
}
|
|
1224
1224
|
else if (!isEmpty_1(l2)) {
|
|
1225
1225
|
if (head(l2) != null) {
|
|
1226
1226
|
matchResult_3 = 1;
|
|
1227
1227
|
t2_2 = tail(l2);
|
|
1228
|
-
x2_1 =
|
|
1228
|
+
x2_1 = value_2(head(l2));
|
|
1229
1229
|
}
|
|
1230
1230
|
else {
|
|
1231
1231
|
matchResult_3 = 2;
|
|
@@ -1239,7 +1239,7 @@ export function SetTreeModule_compareStacks<T>(comparer_mut: IComparer<T>, l1_mu
|
|
|
1239
1239
|
if (head(l2) != null) {
|
|
1240
1240
|
matchResult_3 = 1;
|
|
1241
1241
|
t2_2 = tail(l2);
|
|
1242
|
-
x2_1 =
|
|
1242
|
+
x2_1 = value_2(head(l2));
|
|
1243
1243
|
}
|
|
1244
1244
|
else {
|
|
1245
1245
|
matchResult_3 = 2;
|
|
@@ -1283,19 +1283,19 @@ export function SetTreeModule_compareStacks<T>(comparer_mut: IComparer<T>, l1_mu
|
|
|
1283
1283
|
}
|
|
1284
1284
|
}
|
|
1285
1285
|
else if (head(l1) != null) {
|
|
1286
|
-
const x1_1: SetTreeLeaf$1<T> =
|
|
1286
|
+
const x1_1: SetTreeLeaf$1<T> = value_2(head(l1));
|
|
1287
1287
|
let matchResult_4: int32 = (undefined as any), t1_4: FSharpList<Option<SetTreeLeaf$1<T>>> = (undefined as any), x1_2: SetTreeLeaf$1<T> = (undefined as any), t2_4: FSharpList<Option<SetTreeLeaf$1<T>>> = (undefined as any), x2_2: SetTreeLeaf$1<T> = (undefined as any);
|
|
1288
1288
|
if (!isEmpty_1(l1)) {
|
|
1289
1289
|
if (head(l1) != null) {
|
|
1290
1290
|
matchResult_4 = 0;
|
|
1291
1291
|
t1_4 = tail(l1);
|
|
1292
|
-
x1_2 =
|
|
1292
|
+
x1_2 = value_2(head(l1));
|
|
1293
1293
|
}
|
|
1294
1294
|
else if (!isEmpty_1(l2)) {
|
|
1295
1295
|
if (head(l2) != null) {
|
|
1296
1296
|
matchResult_4 = 1;
|
|
1297
1297
|
t2_4 = tail(l2);
|
|
1298
|
-
x2_2 =
|
|
1298
|
+
x2_2 = value_2(head(l2));
|
|
1299
1299
|
}
|
|
1300
1300
|
else {
|
|
1301
1301
|
matchResult_4 = 2;
|
|
@@ -1309,7 +1309,7 @@ export function SetTreeModule_compareStacks<T>(comparer_mut: IComparer<T>, l1_mu
|
|
|
1309
1309
|
if (head(l2) != null) {
|
|
1310
1310
|
matchResult_4 = 1;
|
|
1311
1311
|
t2_4 = tail(l2);
|
|
1312
|
-
x2_2 =
|
|
1312
|
+
x2_2 = value_2(head(l2));
|
|
1313
1313
|
}
|
|
1314
1314
|
else {
|
|
1315
1315
|
matchResult_4 = 2;
|
|
@@ -1399,7 +1399,7 @@ export function SetTreeModule_toList<T>(t: Option<SetTreeLeaf$1<T>>): FSharpList
|
|
|
1399
1399
|
while (true) {
|
|
1400
1400
|
const t$0027: Option<SetTreeLeaf$1<T>> = t$0027_mut, acc: FSharpList<T> = acc_mut;
|
|
1401
1401
|
if (t$0027 != null) {
|
|
1402
|
-
const t2: SetTreeLeaf$1<T> =
|
|
1402
|
+
const t2: SetTreeLeaf$1<T> = value_2(t$0027);
|
|
1403
1403
|
if (t2 instanceof SetTreeNode$1) {
|
|
1404
1404
|
const tn = t2 as SetTreeNode$1<T>;
|
|
1405
1405
|
t$0027_mut = SetTreeNode$1__get_Left<T>(tn);
|
|
@@ -1944,12 +1944,44 @@ export function isProperSubsetOf<T>(s1: ISet<T>, s2: Iterable<T>): boolean {
|
|
|
1944
1944
|
}
|
|
1945
1945
|
|
|
1946
1946
|
export function isProperSupersetOf<T>(s1: ISet<T>, s2: Iterable<T>): boolean {
|
|
1947
|
-
const s2_1:
|
|
1948
|
-
if (
|
|
1949
|
-
return forAll_1<T>((
|
|
1947
|
+
const s2_1: ISet<T> = newMutableSetWith<T>(s1, s2);
|
|
1948
|
+
if (s1.size > s2_1.size) {
|
|
1949
|
+
return forAll_1<T>((value: T): boolean => s1.has(value), s2_1.values());
|
|
1950
1950
|
}
|
|
1951
1951
|
else {
|
|
1952
1952
|
return false;
|
|
1953
1953
|
}
|
|
1954
1954
|
}
|
|
1955
1955
|
|
|
1956
|
+
export function symmetricExceptWith<T>(s1: ISet<T>, s2: Iterable<T>): void {
|
|
1957
|
+
const s2_1: ISet<T> = newMutableSetWith<T>(s1, s2);
|
|
1958
|
+
iterate_1<T>((x: T): void => {
|
|
1959
|
+
if (s1.has(x)) {
|
|
1960
|
+
s1.delete(x);
|
|
1961
|
+
}
|
|
1962
|
+
else {
|
|
1963
|
+
s1.add(x);
|
|
1964
|
+
}
|
|
1965
|
+
}, s2_1.values());
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1968
|
+
export function overlaps<T>(s1: ISet<T>, s2: Iterable<T>): boolean {
|
|
1969
|
+
return exists_1<T>((value: T): boolean => s1.has(value), s2);
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
export function setEquals<T>(s1: ISet<T>, s2: Iterable<T>): boolean {
|
|
1973
|
+
const s2_1: ISet<T> = newMutableSetWith<T>(s1, s2);
|
|
1974
|
+
if (s1.size === s2_1.size) {
|
|
1975
|
+
return forAll_1<T>((value: T): boolean => s2_1.has(value), s1.values());
|
|
1976
|
+
}
|
|
1977
|
+
else {
|
|
1978
|
+
return false;
|
|
1979
|
+
}
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
export function copyToArray<T>(s1: ISet<T>, target: MutableArray<T>, sourceIndex: int32, targetIndex: int32, count_1: int32): void {
|
|
1983
|
+
iterateIndexed<T>((index: int32, value: T): void => {
|
|
1984
|
+
setItem(target, targetIndex + index, value);
|
|
1985
|
+
}, truncate<T>(count_1, skip<T>(sourceIndex, s1.values())));
|
|
1986
|
+
}
|
|
1987
|
+
|
package/String.ts
CHANGED
|
@@ -86,6 +86,19 @@ export function endsWith(str: string, pattern: string, ic: boolean | StringCompa
|
|
|
86
86
|
return false;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
export function contains(str: string, pattern: string, ic: boolean | StringComparison) {
|
|
90
|
+
if (ic === StringComparison.Ordinal) { // fast path
|
|
91
|
+
return str.includes(pattern);
|
|
92
|
+
}
|
|
93
|
+
const len = pattern.length;
|
|
94
|
+
for (let i = 0; i <= str.length - len; i++) {
|
|
95
|
+
if (cmp(str.slice(i, i + len), pattern, ic) === 0) {
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
|
|
89
102
|
export function indexOfAny(str: string, anyOf: string[], ...args: number[]) {
|
|
90
103
|
if (str == null || str === "") {
|
|
91
104
|
return -1;
|
package/package.json
CHANGED