Simplify JS code a little bit

This commit is contained in:
Guillaume Gomez 2023-12-15 16:56:11 +01:00
parent 4d1bd0db7f
commit 028a3135c8

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())