()
| 5 | if (typeof window === 'undefined' || !window.location) { |
| 6 | return; |
| 7 | } |
| 8 | const url = new URL(window.location.href); |
| 9 | const anchor = url.searchParams.get('anchor'); |
| 10 | const redirected = url.searchParams.get('redirected'); |
| 11 | if (anchor && !redirected) { |
| 12 | url.searchParams.set('redirected', '1'); |
| 13 | // If we get here with an anchor query param, it means something in the |
| 14 | // api docs app is continuing to link to it (sometimes in the markdown) |
| 15 | // Force full reload to get netlify redirects |
| 16 | window.location.replace(url.toString()); |
nothing calls this directly
no outgoing calls
no test coverage detected