'use strict';

const setValueFromRequest = (filter, req, prefix) => {
    const value = req.query[`${prefix}${filter.name}`];
    const option = filter.options.find((opt) => opt.value === value);
    let requestfilterValue = value;
    let requestOptionValue;
    if (option) {
        requestfilterValue = option.text || value;
        requestOptionValue = value;
    }
    return {
        requestfilterValue,
        requestOptionValue,
    };
};
const getDisplayValue = (filter, value) => {
    const option = filter.staticOptions?.find((opt) => opt.name === value);
    return option ? option.display : value;
};
var AutocompleteUtils = {
    setValueFromRequest,
    getDisplayValue,
};

module.exports = AutocompleteUtils;
//# sourceMappingURL=utils.js.map
