src/types.js
function str2num(type) {
  switch (String(type)) {
    case 'byte':
      return types.BYTE;
    case 'char':
      return types.CHAR;
    case 'short':
      return types.SHORT;
    case 'int':
      return types.INT;
    case 'float':
      return types.FLOAT;
    case 'double':
      return types.DOUBLE;
      /* istanbul ignore next */
    default:
      return -1;
  }
}
function str2num(type) {
  switch (String(type)) {
    case 'byte':
      return types.BYTE;
    case 'char':
      return types.CHAR;
    case 'short':
      return types.SHORT;
    case 'int':
      return types.INT;
    case 'float':
      return types.FLOAT;
    case 'double':
      return types.DOUBLE;
      /* istanbul ignore next */
    default:
      return -1;
  }
}
function str2num ( type ) { switch ( String ( type ) ) { case 'byte' : return types . BYTE ; case 'char' : return types . CHAR ; case 'short' : return types . SHORT ; case 'int' : return types . INT ; case 'float' : return types . FLOAT ; case 'double' : return types . DOUBLE ; /* istanbul ignore next */ default : return - 1 ; } }
Reverse search of num2str
@ignore
@param {string} type - string that represents the type
@return {number} - parsed value of the type
Reverse search of num2str