import { getMethods } from "../methods";
import { IGenericWrapper } from "../../../generic/types";

export const transformSection = ({ children }: IGenericWrapper) => {
    return children.reduce((acc, child) => {
        const result = getMethods(child.type)(child);

        Array.isArray(result) ? acc.push(...result) : acc.push(result);
        return acc;
    }, []);
};