Replace unneeded use of regex with a simple if

This commit is contained in:
Guillaume Gomez 2022-03-22 11:22:09 +01:00
parent 699ae365df
commit f9251eef68

View File

@ -564,7 +564,10 @@ window.initSearch = function(rawSearchIndex) {
try {
parseInput(query, parserState);
if (parserState.typeFilter !== null) {
var typeFilter = parserState.typeFilter.replace(/^const$/, "constant");
var typeFilter = parserState.typeFilter;
if (typeFilter === "const") {
typeFilter = "constant";
}
query.typeFilter = itemTypeFromName(typeFilter);
}
} catch (err) {