(href)
| 69 | } |
| 70 | |
| 71 | export function getAnchorProps(href) { |
| 72 | if (href.startsWith('v3:') || href.startsWith('react-aria:')) { |
| 73 | let url = new URL(href); |
| 74 | return {href: getBaseUrl(url.protocol.slice(0, -1)) + '/' + url.pathname}; |
| 75 | } |
| 76 | |
| 77 | if ( |
| 78 | !/^http/.test(href) || |
| 79 | /localhost|reactspectrum\.blob\.core\.windows\.net|react-spectrum\.(corp\.)?adobe\.com|^#/.test( |
| 80 | href |
| 81 | ) |
| 82 | ) { |
| 83 | return {}; |
| 84 | } |
| 85 | |
| 86 | if (/^\//.test(href)) { |
| 87 | return {}; |
| 88 | } |
| 89 | |
| 90 | return {target: '_blank', rel: 'noreferrer'}; |
| 91 | } |
no test coverage detected