Fix contract input handling

This commit is contained in:
Snarling
2022-08-02 11:11:49 -04:00
parent 39cf0cb57f
commit b700b0246b
3 changed files with 9 additions and 29 deletions
-10
View File
@@ -1,10 +0,0 @@
export function isArray(arr: unknown): arr is unknown[] {
return Array.isArray(arr);
}
// Checks whether an array is a 2D array.
// For this, a 2D array is an array which contains only other arrays.
// If one element in the array is a number or string, it is NOT a 2D array
export function is2DArray(arr: unknown): arr is unknown[][] {
return isArray(arr) && arr.every((u) => isArray(u));
}