lib/types/index.js
function getDataTypeNameByCode(item) {
  if (!item || typeof item.code !== 'number') {
    throw new errors.ArgumentError('Invalid signature type definition');
  }
  const typeName = _dataTypesByCode[item.code];
  if (!typeName) {
    throw new errors.ArgumentError(util.format('Type with code %d not found', item.code));
  }
  if (!item.info) {
    return typeName;
  }
  if (util.isArray(item.info)) {
    return (typeName +
      '<' +
      item.info.map(function (t) {
        return getDataTypeNameByCode(t);
      }).join(', ') +
      '>');
  }
  if (typeof item.info.code === 'number') {
    return typeName + '<' + getDataTypeNameByCode(item.info) + '>';
  }
  return typeName;
}
function getDataTypeNameByCode(item) {
  if (!item || typeof item.code !== 'number') {
    throw new errors.ArgumentError('Invalid signature type definition');
  }
  const typeName = _dataTypesByCode[item.code];
  if (!typeName) {
    throw new errors.ArgumentError(util.format('Type with code %d not found', item.code));
  }
  if (!item.info) {
    return typeName;
  }
  if (util.isArray(item.info)) {
    return (typeName +
      '<' +
      item.info.map(function (t) {
        return getDataTypeNameByCode(t);
      }).join(', ') +
      '>');
  }
  if (typeof item.info.code === 'number') {
    return typeName + '<' + getDataTypeNameByCode(item.info) + '>';
  }
  return typeName;
}
function getDataTypeNameByCode ( item ) { if ( ! item || typeof item . code !== 'number' ) { throw new errors . ArgumentError ( 'Invalid signature type definition' ) ; } const typeName = _dataTypesByCode [ item . code ] ; if ( ! typeName ) { throw new errors . ArgumentError ( util . format ( 'Type with code %d not found' , item . code ) ) ; } if ( ! item . info ) { return typeName ; } if ( util . isArray ( item . info ) ) { return ( typeName + '<' + item . info . map ( function ( t ) { return getDataTypeNameByCode ( t ) ; } ) . join ( ', ' ) + '>' ) ; } if ( typeof item . info . code === 'number' ) { return typeName + '<' + getDataTypeNameByCode ( item . info ) + '>' ; } return typeName ; }
Gets the data type name for a given type definition
@internal
@ignore
@throws {ArgumentError}
Gets the data type name for a given type definition