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 +1 -1
- package/dist/server.d.mts +2 -3
- package/dist/server.d.ts +2 -3
- package/dist/server.mjs +3 -10
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/server.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
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(
|
|
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 {
|
|
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(
|
|
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
|
-
|
|
11
|
-
|
|
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
|
-
|
|
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 };
|