MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / processTheSearch

Function processTheSearch

assets/js/WikiSearch.js:27–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25
26// Procedural
27const processTheSearch = async () => {
28 clearStatsLine();
29 const searchTerm = getSearchTerm();
30 if (searchTerm === "") return; //TODO:
31 const resultArray = await retrieveSearchResults(searchTerm);
32 if (resultArray.length) buildSearchResults(resultArray);
33 setStatsLine(resultArray.length);
34};
35
36const setSearchFocus = () => {
37 document.getElementById("search").focus();

Callers 1

submitTheSearchFunction · 0.85

Calls 5

clearStatsLineFunction · 0.85
getSearchTermFunction · 0.85
retrieveSearchResultsFunction · 0.85
buildSearchResultsFunction · 0.85
setStatsLineFunction · 0.85

Tested by

no test coverage detected