Review fixes

This commit is contained in:
Nithin David Thomas
2024-02-15 21:45:38 +05:30
parent e0b60eb3b6
commit 90a6a9d058
5 changed files with 16 additions and 8 deletions
@@ -6,10 +6,12 @@ export const findMatchingOption = (value, options, defaultValue) => {
};
export const findCompanySizeMatch = (options, size) => {
if (!size) return undefined;
if (Number.isNaN(size)) return undefined;
return (
options.find(option => {
const upperLimit = option.value.split('-')[1]?.split('+')[0];
return size < (upperLimit ? Number(upperLimit) : Infinity);
})?.value || this.companySizeOptions[0].value
})?.value || options[0].value
);
};