UNPKG

@mui/x-data-grid

Version:

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

27 lines (22 loc) 647 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getValueFromOption = getValueFromOption; exports.getValueFromValueOptions = getValueFromValueOptions; function getValueFromOption(option) { if (typeof option === 'object' && option !== null) { return option.value; } return option; } 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); }