UNPKG

384 BJavaScriptView Raw
1import getOptionProperty from './getOptionProperty';
2
3function getIsOnlyResult(props) {
4 var allowNew = props.allowNew,
5 highlightOnlyResult = props.highlightOnlyResult,
6 results = props.results;
7
8 if (!highlightOnlyResult || allowNew) {
9 return false;
10 }
11
12 return results.length === 1 && !getOptionProperty(results[0], 'disabled');
13}
14
15export default getIsOnlyResult;
\No newline at end of file