nuxtseo-shared 5.3.4 → 5.3.6

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.
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.16.0"
6
6
  },
7
- "version": "5.3.4",
7
+ "version": "5.3.6",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
package/dist/server.d.mts CHANGED
@@ -1,7 +1,6 @@
1
- import { H3Event } from 'h3';
2
- import { NitroRouteRules } from 'nitropack';
1
+ import { NitroRuntimeConfig, NitroRouteRules } from 'nitropack';
3
2
 
4
3
  declare function withoutQuery(path: string): string;
5
- declare function createNitroRouteRuleMatcher(e?: H3Event): (pathOrUrl: string) => NitroRouteRules;
4
+ declare function createNitroRouteRuleMatcher(runtimeConfig: NitroRuntimeConfig): (pathOrUrl: string) => NitroRouteRules;
6
5
 
7
6
  export { createNitroRouteRuleMatcher, withoutQuery };
package/dist/server.d.ts CHANGED
@@ -1,7 +1,6 @@
1
- import { H3Event } from 'h3';
2
- import { NitroRouteRules } from 'nitropack';
1
+ import { NitroRuntimeConfig, NitroRouteRules } from 'nitropack';
3
2
 
4
3
  declare function withoutQuery(path: string): string;
5
- declare function createNitroRouteRuleMatcher(e?: H3Event): (pathOrUrl: string) => NitroRouteRules;
4
+ declare function createNitroRouteRuleMatcher(runtimeConfig: NitroRuntimeConfig): (pathOrUrl: string) => NitroRouteRules;
6
5
 
7
6
  export { createNitroRouteRuleMatcher, withoutQuery };
package/dist/server.mjs CHANGED
@@ -1,5 +1,4 @@
1
1
  import { defu } from 'defu';
2
- import { useRuntimeConfig } from 'nitropack/runtime';
3
2
  import { toRouteMatcher, createRouter } from 'radix3';
4
3
  import { withoutTrailingSlash, parseURL, withoutBase } from 'ufo';
5
4
 
@@ -7,11 +6,8 @@ function withoutQuery(path) {
7
6
  const queryIndex = path.indexOf("?");
8
7
  return queryIndex === -1 ? path : path.slice(0, queryIndex);
9
8
  }
10
- let cachedRouteRuleMatcher;
11
- function createNitroRouteRuleMatcher(e) {
12
- if (!import.meta.dev && !e && cachedRouteRuleMatcher)
13
- return cachedRouteRuleMatcher;
14
- const { nitro, app } = useRuntimeConfig(e);
9
+ function createNitroRouteRuleMatcher(runtimeConfig) {
10
+ const { nitro, app } = runtimeConfig;
15
11
  const _routeRulesMatcher = toRouteMatcher(
16
12
  createRouter({
17
13
  routes: Object.fromEntries(
@@ -19,15 +15,12 @@ function createNitroRouteRuleMatcher(e) {
19
15
  )
20
16
  })
21
17
  );
22
- const matcher = (pathOrUrl) => {
18
+ return (pathOrUrl) => {
23
19
  const path = pathOrUrl[0] === "/" ? pathOrUrl : parseURL(pathOrUrl, app.baseURL).pathname;
24
20
  return defu({}, ..._routeRulesMatcher.matchAll(
25
21
  withoutBase(withoutTrailingSlash(withoutQuery(path)), app.baseURL)
26
22
  ).reverse());
27
23
  };
28
- if (!import.meta.dev && !e)
29
- cachedRouteRuleMatcher = matcher;
30
- return matcher;
31
24
  }
32
25
 
33
26
  export { createNitroRouteRuleMatcher, withoutQuery };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxtseo-shared",
3
3
  "type": "module",
4
- "version": "5.3.4",
4
+ "version": "5.3.6",
5
5
  "description": "Shared utilities for Nuxt SEO modules.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",