@emsipl/react-select-search
Version:
Fork of https://github.com/tbleckert/react-select-search
18 lines (15 loc) • 415 B
JavaScript
;
exports.__esModule = true;
exports["default"] = getOption;
function getOption(value, defaultOptions) {
if (Array.isArray(value)) {
return value.map(function (singleValue) {
return defaultOptions.find(function (option) {
return option.value === singleValue;
});
});
}
return defaultOptions.find(function (option) {
return option.value === value;
}) || null;
}