mirror of
https://github.com/wassname/talk.git
synced 2026-07-28 11:27:05 +08:00
[next] Embed: Defer login/logout until ready (#2123)
* feat: Embed defer login/-out until ready * fix: make remove work with lazy render * fix: typo * fix: another typo * fix: test * chore: replace query-string for querystringify * fix: types * chore: small refactor * feat: added webpack analzyer * chore: rename compile -> generate * fix: fix scripts and improve bundle size * fix: lodash webpack plugin
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import qs from "query-string";
|
||||
import { parseQuery, stringifyQuery } from "talk-common/utils";
|
||||
|
||||
import buildURL from "./buildURL";
|
||||
import parseURL from "./parseURL";
|
||||
|
||||
export default function modifyQuery(url: string, params: {}) {
|
||||
const parsed = parseURL(url);
|
||||
const query = qs.parse(parsed.search);
|
||||
parsed.search = qs.stringify({ ...query, ...params });
|
||||
const query = parseQuery(parsed.search);
|
||||
parsed.search = stringifyQuery({ ...query, ...params });
|
||||
return buildURL(parsed);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import qs from "query-string";
|
||||
import { parseQuery } from "talk-common/utils";
|
||||
|
||||
export default function parseQueryHash(hash: string): Record<string, string> {
|
||||
return qs.parse(hash);
|
||||
let normalized = hash;
|
||||
if (normalized[0] === "#") {
|
||||
normalized = normalized.substr(1);
|
||||
}
|
||||
return parseQuery(normalized);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user