<commit_before>import $ from 'jquery';
import _ from 'lodash';
import utils from 'bigcommerce/stencil-utils';
import stencilDropdown from './stencil-dropdown'

function hideDropdown($searchDiv) {
    $searchDiv.removeClass('is-open f-open-dropdown').attr('style', 'top: 0px').attr('aria-hidden', 'true');
}

function showDropdown($searchDiv, event) {
    $searchDiv.addClass('is-open f-open-dropdown').attr('style', 'top: 49px;').attr('aria-hidden', 'false');
    event.stopPropagation();
}

export default function () {
    let $quickSearchResults = $('.quickSearchResults');
    let $quickSearchDiv = $('#quickSearch');

    stencilDropdown.bind($('[data-search="quickSearch"]'), $quickSearchDiv, 'top: 49px;');

    //stagger searching for 200ms after last input
    let doSearch = _.debounce((searchQuery) => {
        utils.api.search.search(searchQuery, {template: 'search/quick-results'}, (err, response) => {
            if (err) {
                throw new Error(err);
            }
            $quickSearchResults.html(response);
        });
    }, 200);

    utils.hooks.on('search-quick', (event) => {
        let searchQuery = $(event.currentTarget).val();

        // server will only perform search with at least 3 characters
        if (searchQuery.length < 3) {
            return;
        }

        doSearch(searchQuery);
    });
}
<commit_msg>BIG-19732 * removed un-needed functions * renamed function<commit_after>import $ from 'jquery';
import _ from 'lodash';
import utils from 'bigcommerce/stencil-utils';
import stencilDropDown from './stencil-dropdown'

export default function () {
    let $quickSearchResults = $('.quickSearchResults');
    let $quickSearchDiv = $('#quickSearch');

    stencilDropDown.bind($('[data-search="quickSearch"]'), $quickSearchDiv, 'top: 49px;');

    //stagger searching for 200ms after last input
    let doSearch = _.debounce((searchQuery) => {
        utils.api.search.search(searchQuery, {template: 'search/quick-results'}, (err, response) => {
            if (err) {
                throw new Error(err);
            }
            $quickSearchResults.html(response);
        });
    }, 200);

    utils.hooks.on('search-quick', (event) => {
        let searchQuery = $(event.currentTarget).val();

        // server will only perform search with at least 3 characters
        if (searchQuery.length < 3) {
            return;
        }

        doSearch(searchQuery);
    });
}

{'fraction_non_alphanumeric': 0.15252152521525214, 'fraction_numerical': 0.011480114801148012, 'mean_word_length': 2.993453355155483, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3000900', 'n_tokens_mistral': 732, 'n_tokens_neox': 692, 'n_words': 159}