Merge master

This commit is contained in:
Pieter Vander Vennet 2024-07-28 02:38:24 +02:00
commit 1b01f75905
186 changed files with 4169 additions and 2235 deletions

View file

@ -386,7 +386,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
* Null/Undefined is returned as is. If an emtpy array is given, a new empty array will be returned
*/
public static Dedup(arr: NonNullable<string[]>): NonNullable<string[]>
public static Dedup(arr: undefined):undefined
public static Dedup(arr: undefined): undefined
public static Dedup(arr: string[] | undefined): string[] | undefined
public static Dedup(arr: string[]): string[] {
if (arr === undefined || arr === null) {
@ -1273,9 +1273,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
return track[str2.length][str1.length]
}
public static MapToObj<V>(
d: Map<string, V>
): Record<string, V>;
public static MapToObj<V>(d: Map<string, V>): Record<string, V>
public static MapToObj<V, T>(
d: Map<string, V>,
onValue: (t: V, key: string) => T
@ -1287,7 +1285,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
const o = {}
const keys = Array.from(d.keys())
keys.sort()
onValue ??= (v => <any> v)
onValue ??= (v) => <any>v
for (const key of keys) {
o[key] = onValue(d.get(key), key)
}