aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/History.ts
diff options
context:
space:
mode:
authoraidahosa1 <aisosa_idahosa@brown.edu>2024-09-17 09:29:33 -0400
committeraidahosa1 <aisosa_idahosa@brown.edu>2024-09-17 09:29:33 -0400
commit1568898125218538a93666cf5d83b9cf01739b49 (patch)
tree0c05f094cec54aeee2286548fc89080336004d90 /src/client/util/History.ts
parent2b4288efa2f21db46addd19c8884f80dba835f2d (diff)
parentc36607691e0b7f5c04f3209a64958f5e51ddd785 (diff)
Merge branch 'master' into aisosa-starter
Diffstat (limited to 'src/client/util/History.ts')
-rw-r--r--src/client/util/History.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/util/History.ts b/src/client/util/History.ts
index 52d0223d5..0d0c056a4 100644
--- a/src/client/util/History.ts
+++ b/src/client/util/History.ts
@@ -85,7 +85,7 @@ export namespace HistoryUtil {
const parsers: { [type: string]: (pathname: string[], opts: qs.ParsedQuery) => ParsedUrl | undefined } = {};
const stringifiers: { [type: string]: (state: ParsedUrl) => string } = {};
- type ParserValue = true | 'none' | 'json' | ((value: string) => any);
+ type ParserValue = true | 'none' | 'json' | ((value: string) => string | null | (string | null)[]);
type Parser = {
[key: string]: ParserValue;
@@ -106,7 +106,7 @@ export namespace HistoryUtil {
return value;
}
parsers[type] = (pathname, opts) => {
- const current: any = { type };
+ const current: DocUrl & { [key: string]: null | (string | null)[] | string } = { type: 'doc', docId: '' };
for (const required in requiredFields) {
if (!(required in opts)) {
return undefined;
@@ -148,7 +148,7 @@ export namespace HistoryUtil {
path = customStringifier(state, path);
}
const queryObj = OmitKeys(state, keys).extract;
- const query: any = {};
+ const query: { [key: string]: string | null } = {};
Object.keys(queryObj).forEach(key => {
query[key] = queryObj[key] === null ? null : JSON.stringify(queryObj[key]);
});