UNPKG

@onereach/channel-transformer

Version:

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

18 lines (15 loc) 398 B
import { IGenericSection, IGenericImage } from '../../../generic/types'; import { IOutputImage } from '../../types'; export const transformOutputImage = (msg: IOutputImage): IGenericSection => { const image: IGenericImage = { type: 'image', props: { url: msg.value } }; const result: IGenericSection = { type: 'section', children: [image] }; return result; };