Rollup merge of #118986 - GuillaumeGomez:simplify-js-inline, r=notriddle

Simplify JS code a little bit

As mentioned, JS code can be simplified a little bit.

r? ``@notriddle``
This commit is contained in:
Matthias Krüger 2023-12-15 20:19:55 +01:00 committed by GitHub
commit b377babd2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -328,8 +328,8 @@ pub(super) fn write_shared(
v.push_str(
r#"\
]'));
if (typeof window !== 'undefined' && window.initSearch) {window.initSearch(searchIndex)};
if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex};
if (typeof exports !== 'undefined') exports.searchIndex = searchIndex;
else if (window.initSearch) window.initSearch(searchIndex);
"#,
);
Ok(v.into_bytes())