* Checks if array is 1D * @param arr The array
(arr: ArrayType1D | ArrayType2D)
| 367 | * @param arr The array |
| 368 | */ |
| 369 | is1DArray(arr: ArrayType1D | ArrayType2D): boolean { |
| 370 | if ( |
| 371 | typeof arr[0] == "number" || |
| 372 | typeof arr[0] == "string" || |
| 373 | typeof arr[0] == "boolean" || |
| 374 | arr[0] === null |
| 375 | ) { |
| 376 | return true; |
| 377 | } else { |
| 378 | return false; |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | /** |
| 383 | * Converts an array to an object using array index as object keys |
no outgoing calls
no test coverage detected