import VueRouter, { RawLocation } from 'vue-router';

function pushRoute(router: VueRouter, route: RawLocation, targetBlank = false) {
  if (targetBlank) {
    const url = router.resolve(route);
    window.open(url.href, '_blank');
  } else {
    router.push(route);
  }
}

export { pushRoute };
