summaryrefslogtreecommitdiff
path: root/ext/js/display/display-history.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2024-02-24 23:47:57 -0500
committerGitHub <noreply@github.com>2024-02-25 04:47:57 +0000
commit73169f06dff767020718a5715eba97d3575ba7e1 (patch)
tree99d458f9d2ca74e67dbb4bccd148ef549f7ce2cf /ext/js/display/display-history.js
parenta21948daf6210f67955ae4f98a81e21b8cf9f1f2 (diff)
Turn on @typescript-eslint/no-unsafe-argument (#728)24.2.26.0
Diffstat (limited to 'ext/js/display/display-history.js')
-rw-r--r--ext/js/display/display-history.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/js/display/display-history.js b/ext/js/display/display-history.js
index 67690219..bc4f1539 100644
--- a/ext/js/display/display-history.js
+++ b/ext/js/display/display-history.js
@@ -37,9 +37,15 @@ export class DisplayHistory extends EventDispatcher {
this._historyMap = new Map();
const historyState = history.state;
- const {id, state} = isObject(historyState) ? historyState : {id: null, state: null};
+ const {id, state} = (
+ typeof historyState === 'object' && historyState !== null ?
+ historyState :
+ {id: null, state: null}
+ );
+ /** @type {?import('display-history').EntryState} */
+ const stateObject = typeof state === 'object' || state === null ? state : null;
/** @type {import('display-history').Entry} */
- this._current = this._createHistoryEntry(id, location.href, state, null, null);
+ this._current = this._createHistoryEntry(id, location.href, stateObject, null, null);
}
/** @type {?import('display-history').EntryState} */