@mintlify/common
Version:
Commonly shared code within Mintlify
8 lines (7 loc) • 363 B
JavaScript
export const getEnumValues = (value) => {
if (!Array.isArray(value === null || value === void 0 ? void 0 : value.enum)) {
return undefined;
}
const enumValues = value.enum.filter((option) => typeof option === 'string' || typeof option === 'number' || typeof option === 'boolean');
return enumValues.length > 0 ? enumValues : undefined;
};