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;
};