Skip to content

Commit

Permalink
rename external to absolute
Browse files Browse the repository at this point in the history
  • Loading branch information
upreeti committed Dec 16, 2024
1 parent 739eeec commit 158922c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/ui/link/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ const Link = forwardRef<HTMLButtonElement | HTMLAnchorElement, LinkProps>(
)) ||
''
: to;
const IS_EXTERNAL_LINK_REGEX = /^(?:(http|https):\/\/)/;
const IS_ABSOLUTE_LINK_REGEX = /^(?:(http|https):\/\/)/;
const staticBasePath =
(href != null && !IS_EXTERNAL_LINK_REGEX.test(href)) || typeof to === 'string' ? routeAttributes.basePath : '';
(href != null && !IS_ABSOLUTE_LINK_REGEX.test(href)) || typeof to === 'string' ? routeAttributes.basePath : '';

Check warning on line 77 in src/ui/link/index.tsx

View workflow job for this annotation

GitHub Actions / build (20.x)

Replace `·typeof·to·===·'string'·?·routeAttributes.basePath` with `⏎······typeof·to·===·'string'⏎········?·routeAttributes.basePath⏎·······`

const triggerPrefetch = useCallback(() => {
// ignore if async route not ready yet
Expand Down
2 changes: 1 addition & 1 deletion src/ui/link/test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe('<Link />', () => {
);
});

it('should not add basePath for external links', () => {
it('should not add basePath for absolute links', () => {
renderInRouter(
'my link',
{
Expand Down

0 comments on commit 158922c

Please sign in to comment.