function assertUnitNameIsValid(name) {
    for (var i = 0; i < name.length; i++) {
      var _c = name.charAt(i);

      var isValidAlpha = function isValidAlpha(p) {
        return /^[a-zA-Z]$/.test(p);
      };

      var _isDigit = function _isDigit(c) {
        return c >= '0' && c <= '9';
      };

      if (i === 0 && !isValidAlpha(_c)) {
        throw new Error('Invalid unit name (must begin with alpha character): "' + name + '"');
      }

      if (i > 0 && !(isValidAlpha(_c) || _isDigit(_c))) {
        throw new Error('Invalid unit name (only alphanumeric characters are allowed): "' + name + '"');
      }
    }
  }
Retrieve the right convertor function corresponding with the type
of provided exampleValue.

@param {string} type   A string 'number', 'BigNumber', or 'Fraction'
                       In case of an unknown type,
@return {Function}