UNPKG

@ozen-ui/kit

Version:

React component library

13 lines (12 loc) 564 B
import { isArray } from '../../../utils/array'; import { isString } from '../../../utils/isString'; export var toAutocompleteListCardValue = function (value) { var _a, _b; if (isArray(value)) { return ((_a = value === null || value === void 0 ? void 0 : value.map(function (value) { return (isString(value) ? value : value.id); })) !== null && _a !== void 0 ? _a : []); } if (isString(value)) { return value; } return ((_b = value === null || value === void 0 ? void 0 : value.id) !== null && _b !== void 0 ? _b : null); };