UNPKG

@mui/x-data-grid

Version:

The community edition of the data grid component (MUI X).

18 lines (16 loc) 469 B
export function getValueFromOption(option) { if (typeof option === 'object' && option !== null) { return option.value; } return option; } export function getValueFromValueOptions(value, valueOptions) { if (valueOptions === undefined) { return undefined; } const result = valueOptions.find(option => { const optionValue = getValueFromOption(option); return String(optionValue) === String(value); }); return getValueFromOption(result); }