@stephenchenorg/astro 3.0.0 → 3.1.0
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.
|
@@ -2,7 +2,7 @@ export function seoMeta(options, modelMeta) {
|
|
|
2
2
|
return {
|
|
3
3
|
title: modelMeta?.title || options.title,
|
|
4
4
|
seo_title: modelMeta?.seo_title || options.seo_title || null,
|
|
5
|
-
seo_description: modelMeta?.seo_description || options.description || null,
|
|
5
|
+
seo_description: modelMeta?.seo_description || options.seo_description || options.description || null,
|
|
6
6
|
seo_keyword: modelMeta?.seo_keyword || options.seo_keyword || null,
|
|
7
7
|
seo_json_ld: modelMeta?.seo_json_ld || options.seo_json_ld || null,
|
|
8
8
|
seo_head: modelMeta?.seo_head || options.seo_head,
|
|
@@ -6,6 +6,7 @@ declare global {
|
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
export interface QueryParamsUrlOptions {
|
|
9
|
+
clear?: boolean;
|
|
9
10
|
transformParams?: (params: Record<string, any>) => Record<string, any>;
|
|
10
11
|
}
|
|
11
12
|
export declare function queryParamsUrl(additionalParams: Record<string, any>, urlConfig?: UrlConfig, options?: QueryParamsUrlOptions): string;
|
package/dist/query-params/url.js
CHANGED
|
@@ -6,14 +6,20 @@ export function queryParamsUrl(additionalParams, urlConfig = {
|
|
|
6
6
|
params: {},
|
|
7
7
|
defaultParams: {}
|
|
8
8
|
}, options = {}) {
|
|
9
|
-
const {
|
|
9
|
+
const {
|
|
10
|
+
clear = false,
|
|
11
|
+
transformParams
|
|
12
|
+
} = options;
|
|
10
13
|
const config = typeof window !== "undefined" ? urlConfigStore.get() : urlConfig;
|
|
11
|
-
let params =
|
|
12
|
-
if (
|
|
13
|
-
params =
|
|
14
|
+
let params = {};
|
|
15
|
+
if (!clear) {
|
|
16
|
+
params = mergeUrlParams(config.params, additionalParams);
|
|
17
|
+
if (transformParams) {
|
|
18
|
+
params = transformParams(params);
|
|
19
|
+
}
|
|
20
|
+
params = cleanParams(params, config.defaultParams || {});
|
|
14
21
|
}
|
|
15
|
-
const
|
|
16
|
-
const queryString = qs.stringify(cleanedParams, {
|
|
22
|
+
const queryString = qs.stringify(params, {
|
|
17
23
|
skipEmptyString: true,
|
|
18
24
|
skipNull: true,
|
|
19
25
|
sort: false
|