@onereach/channel-transformer
Version:
Convert data model between different channels (Slack, Microsoft Teams, Generic...)
13 lines (11 loc) • 497 B
text/typescript
import { getKeyValue } from '../../../helpers/get-key-value';
import { getErrorObject } from '../../../helpers/get-error-object';
import { transformText } from './items/text';
import { transformSection } from './items/section';
export const methods: {[key: string]: Function} = {
text: transformText,
section: transformSection
};
export const getMethods = (type: string): Function => {
return getKeyValue(methods)(type) || getErrorObject({ type, message: 'Generic to MS-Teams' });
};