UNPKG

@onereach/channel-transformer

Version:

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

14 lines (12 loc) 347 B
import { TextType } from '../../../generic/types'; import { IGenericText } from '../../../generic/types'; export const transformText = (text: string, textType?: TextType): IGenericText => { const result: IGenericText = { type: 'text', props: { value: text, ...(textType && { type: textType }) } }; return result; };