* For any given array of numbers, convert them to BigInts * @param inputArray The array of numbers to be converted * @returns The array of BigInts
(inputArray: bigint[] | number[])
| 6 | * @returns The array of BigInts |
| 7 | */ |
| 8 | function toBigIntArray(inputArray: bigint[] | number[]): bigint[] { |
| 9 | let outputArray: bigint[] = []; |
| 10 | if (typeof inputArray[0] === "bigint") { |
| 11 | return inputArray as bigint[]; |
| 12 | } |
| 13 | else if (typeof inputArray[0] === "number") { |
| 14 | for (let i = 0; i < inputArray.length; i++) { |
| 15 | outputArray.push(BigInt(inputArray[i])); |
| 16 | } |
| 17 | } |
| 18 | return outputArray; |
| 19 | } |
| 20 | |
| 21 | /** |
| 22 | * This function checks if the input array is a valid array of bigints or numbers |
no outgoing calls
no test coverage detected