Skip to content

Commit 4fc09a7

Browse files
committed
main.js(isDisplayed): coerce truthy values to boolean
1 parent d89457d commit 4fc09a7

File tree

1 file changed

+2
-3
lines changed
  • src/librustdoc/html/static/js

1 file changed

+2
-3
lines changed

src/librustdoc/html/static/js/main.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,10 @@ function preLoadCss(cssUrl) {
305305
window.searchState.timeout = null;
306306
}
307307
},
308-
// @ts-expect-error
309308
isDisplayed: () => {
310309
const outputElement = window.searchState.outputElement();
311-
return outputElement &&
312-
outputElement.parentElement &&
310+
return !!outputElement &&
311+
!!outputElement.parentElement &&
313312
outputElement.parentElement.id === ALTERNATIVE_DISPLAY_ID;
314313
},
315314
// Sets the focus on the search bar at the top of the page

0 commit comments

Comments
 (0)