function getType(element) {

  if ('waypoints' in element) {
    return 'connection';
  }

  if ('x' in element) {
    return 'shape';
  }

  return 'root';
}
Get the element's type

@param {Element} element

@return {'connection' | 'shape' | 'root'}