@onereach/channel-transformer
Version:
Convert data model between different channels (Slack, Microsoft Teams, Generic...)
21 lines (16 loc) • 460 B
text/typescript
import { IGenericText } from "../../../generic/types";
import { IMSTeamsMessage } from "../../types";
export const transformText = ( { props }: IGenericText ) => {
const { type = "plain"} = props;
const isPlain = type === "plain";
const contentType = isPlain
? "text"
: props.type as any;
return {
type: "text",
value: {
contentType,
content: props?.value || ""
}
};
} ;