Skip to content

Commit f5efd2a

Browse files
committed
main.js(isDisplayed): coerce truthy values to boolean
1 parent 6622111 commit f5efd2a

File tree

1 file changed

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

1 file changed

+2
-3
lines changed

Diff for: src/librustdoc/html/static/js/main.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,10 @@ function preLoadCss(cssUrl) {
302302
window.searchState.timeout = null;
303303
}
304304
},
305-
// @ts-expect-error
306305
isDisplayed: () => {
307306
const outputElement = window.searchState.outputElement();
308-
return outputElement &&
309-
outputElement.parentElement &&
307+
return !!outputElement &&
308+
!!outputElement.parentElement &&
310309
outputElement.parentElement.id === ALTERNATIVE_DISPLAY_ID;
311310
},
312311
// Sets the focus on the search bar at the top of the page

0 commit comments

Comments
 (0)