UNPKG

@onereach/channel-transformer

Version:

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

12 lines (9 loc) 362 B
import { IGenericSection } from '../../../generic/types/section'; import { IOutboundMessage } from '../../types/index'; import { getMethods } from '../methods'; export const transformSection = ({ children }: IGenericSection) => { const result:Array<IOutboundMessage> = children.map(item => { return getMethods(item.type)(item); }); return result; };