UNPKG

@onereach/channel-transformer

Version:

Convert data model between different channels (Slack, Microsoft Teams, Generic...)

13 lines (11 loc) 360 B
import { IGenericOptions } from '../../../generic/types'; import { IOption } from '../../types'; export const transformMenuOptions = (options: Array<IOption>): Array<IGenericOptions> => { return options.map((item: IOption) => { return { key: item.value || item.label, value: item.value, label: item.label || item.value }; }); };