code: function strToNumber(value) {
      // Convert strings to numbers
      if (typeof value === 'string' && !isNaN(Number(value) - parseFloat(value))) {
          return Number(value);
      }
      if (typeof value !== 'number') {
          throw new Error(value + " is not a number");
      }
      return value;
  }
docs: Transforms a string into a number (if needed).