litestar-vite-plugin 0.6.1 → 0.6.2

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.
@@ -4,4 +4,4 @@ declare global {
4
4
  [key: string]: string;
5
5
  };
6
6
  }
7
- export declare function route(routeName: string, ...args: any[]): string | null;
7
+ export declare function route(routeName: string, ...args: any[]): string;
@@ -14,12 +14,12 @@ export function route(routeName, ...args) {
14
14
  let url = globalThis.routes[routeName];
15
15
  if (!url) {
16
16
  console.error(`URL '${routeName}' not found in routes.`);
17
- return null; // Return null to indicate failure
17
+ return "#"; // Return "#" to indicate failure
18
18
  }
19
19
  const argTokens = url.match(/<(\w+:?)?\w+>/g);
20
20
  if (!argTokens && args.length > 0) {
21
21
  console.error(`Invalid URL lookup: URL '${routeName}' does not expect arguments.`);
22
- return null;
22
+ return "#";
23
23
  }
24
24
  try {
25
25
  if (typeof args[0] === "object" && !Array.isArray(args[0])) {
@@ -50,7 +50,7 @@ export function route(routeName, ...args) {
50
50
  }
51
51
  catch (error) {
52
52
  console.error(error.message);
53
- return null; // Return null to indicate failure
53
+ return "#";
54
54
  }
55
55
  return url;
56
56
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "litestar-vite-plugin",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "type": "module",
5
5
  "description": "Litestar plugin for Vite.",
6
6
  "keywords": [