All files / packages/core/src/utilities hasNaNValues.ts

75% Statements 3/4
50% Branches 1/2
100% Functions 2/2
66.66% Lines 2/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13              22x 66x        
/**
 * A function that checks if there is a value in the array that is NaN.
 * or if the input is a number it just checks if it is NaN.
 * @param input - The input to check if it is NaN.
 * @returns - True if the input is NaN, false otherwise.
 */
export default function hasNaNValues(input: number[] | number): boolean {
  Eif (Array.isArray(input)) {
    return input.some((value) => Number.isNaN(value));
  }
  return Number.isNaN(input);
}