eddev 2.0.0-beta.87 → 2.0.0-beta.88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useMemo } from "react";
3
- import { parseURL, resolveURL, withoutTrailingSlash, withTrailingSlash } from "ufo";
3
+ import { parseURL, resolveURL, withoutTrailingSlash } from "ufo";
4
4
  import { useIsSSR } from "../hooks/useIsSSR.js";
5
5
  import { useRouter } from "../hooks/useRouter.js";
6
- import { isSameOrigin } from "../utils.js";
6
+ import { addTrailingSlash, isSameOrigin } from "../utils.js";
7
7
  import { useRoute } from "../hooks/useRoute.js";
8
8
  import { useRouterState } from "../hooks/useRouterState.js";
9
9
  export const Link = forwardRef(({ preferBack, as, ...props }, ref) => {
@@ -17,7 +17,7 @@ export const Link = forwardRef(({ preferBack, as, ...props }, ref) => {
17
17
  else {
18
18
  const router = useRouter();
19
19
  const state = useLinkState(props.href ?? "");
20
- return (_jsx(Comp, { ref: ref, "data-active": state.active ?? undefined, "data-child-active": state.childActive ?? undefined, "data-pending": state.pending ?? undefined, ...props, href: withTrailingSlash(props.href ?? undefined, true), onMouseEnter: (e) => {
20
+ return (_jsx(Comp, { ref: ref, "data-active": state.active ?? undefined, "data-child-active": state.childActive ?? undefined, "data-pending": state.pending ?? undefined, ...props, href: addTrailingSlash(props.href), onMouseEnter: (e) => {
21
21
  if (props.onMouseEnter) {
22
22
  props.onMouseEnter(e);
23
23
  }
@@ -14,4 +14,5 @@ export declare function stringifyRouteLink(route: RouteLink): string;
14
14
  export declare function parseQuery(query: string): Record<string, string | string[]>;
15
15
  export declare function stringifyQuery(query: any): string;
16
16
  export declare function getRouteMeta(data: RouteData): RouteMeta;
17
+ export declare function addTrailingSlash(path?: string | null): string;
17
18
  export {};
@@ -119,3 +119,9 @@ export function getRouteMeta(data) {
119
119
  tags: data.meta?.head ?? [],
120
120
  };
121
121
  }
122
+ export function addTrailingSlash(path) {
123
+ if (path?.match(/\./)) {
124
+ return path;
125
+ }
126
+ return withTrailingSlash(path ?? undefined, true);
127
+ }
@@ -1 +1 @@
1
- export declare const VERSION = "2.0.0-beta.87";
1
+ export declare const VERSION = "2.0.0-beta.88";
@@ -1 +1 @@
1
- export const VERSION = "2.0.0-beta.87";
1
+ export const VERSION = "2.0.0-beta.88";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eddev",
3
- "version": "2.0.0-beta.87",
3
+ "version": "2.0.0-beta.88",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",