More tests

This commit is contained in:
pietervdvn 2022-04-06 03:18:17 +02:00
parent 9d961b3672
commit 5857471be3

View file

@ -237,6 +237,11 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
return result; return result;
} }
/**
* Utils.Identical([1,2], [1,2]) // => true
* Utils.Identical([1,2,3], [1,2,4}]) // => false
* Utils.Identical([1,2], [1,2,3]) // => false
*/
public static Identical<T>(t1: T[], t2: T[], eq?: (t: T, t0: T) => boolean): boolean { public static Identical<T>(t1: T[], t2: T[], eq?: (t: T, t0: T) => boolean): boolean {
if (t1.length !== t2.length) { if (t1.length !== t2.length) {
return false return false
@ -250,6 +255,9 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
return true; return true;
} }
/**
* Utils.MergeTags({k0:"v0","common":"0"},{k1:"v1", common: "1"}) // => {k0: "v0", k1:"v1", common: "1"}
*/
public static MergeTags(a: any, b: any) { public static MergeTags(a: any, b: any) {
const t = {}; const t = {};
for (const k in a) { for (const k in a) {