All files / src/utils conversions.js

100% Statements 12/12
100% Branches 3/3
100% Functions 1/1
100% Lines 12/12

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 141x   1x 1x 1x 1x 1x 1x 39x 3x 3x 36x 36x  
// src/utils/validityChecks
 
/**
 * Convert an string to number
 * @param {any} input Input to convert to a number
 * @returns {number} A float/number that represent input
 */
export function convertToNumber(input) {
  if (isNaN(input)) {
    throw new TypeError('Every value of the column array must be a number!');
  }
  return parseFloat(input);
}