ag-common 0.0.289 → 0.0.291
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.
|
@@ -64,15 +64,17 @@ export interface IStateCommon<TRequest extends IRequestCommon> extends IInitialS
|
|
|
64
64
|
* @param param0
|
|
65
65
|
* @returns
|
|
66
66
|
*/
|
|
67
|
-
export declare const getClientOrServerReqHref: ({ href, query, forceServer, userAgent, }: {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
export declare const getClientOrServerReqHref: ({ url: { href, query }, forceServer, userAgent, }: {
|
|
68
|
+
url: {
|
|
69
|
+
/**
|
|
70
|
+
* parse querystring keyvalues
|
|
71
|
+
*/
|
|
72
|
+
query?: Record<string, string> | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* full url
|
|
75
|
+
*/
|
|
76
|
+
href?: string | undefined;
|
|
77
|
+
};
|
|
76
78
|
/**
|
|
77
79
|
* if true, wont use window location. default false
|
|
78
80
|
*/
|
|
@@ -23,7 +23,7 @@ const calculateServerHref = ({ host, pathname, }) => {
|
|
|
23
23
|
* @param param0
|
|
24
24
|
* @returns
|
|
25
25
|
*/
|
|
26
|
-
const getClientOrServerReqHref = ({ href, query, forceServer = false, userAgent, }) => {
|
|
26
|
+
const getClientOrServerReqHref = ({ url: { href, query }, forceServer = false, userAgent, }) => {
|
|
27
27
|
if (typeof window !== 'undefined' && !forceServer) {
|
|
28
28
|
href = window.location.href;
|
|
29
29
|
}
|
|
@@ -66,8 +66,10 @@ const getServerReq = ({ defaultHost, pathname, query, headers, }) => {
|
|
|
66
66
|
? undefined
|
|
67
67
|
: (0, object_1.castStringlyObject)(query);
|
|
68
68
|
const ret = (0, exports.getClientOrServerReqHref)({
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
url: {
|
|
70
|
+
href,
|
|
71
|
+
query: parsedQuery,
|
|
72
|
+
},
|
|
71
73
|
forceServer: true,
|
|
72
74
|
userAgent: (_a = headers['user-agent']) === null || _a === void 0 ? void 0 : _a.toLowerCase(),
|
|
73
75
|
});
|