function groupSectionData(data) {
    return data.reduce((acc, curr) => {
        if (!curr || typeof curr !== 'object' || !('section' in curr)) {
            return acc;
        }
        const sectionIndex = acc.findIndex(sectionData => sectionData.section === curr.section);
        if (sectionIndex === -1) {
            acc.push({
                section: curr.section,
                data: [curr],
            });
            return acc;
        }
        acc[sectionIndex].data.push(curr);
        return acc;
    }, []);
}
export = groupSectionData;
module.exports = groupSectionData;
//# sourceMappingURL=groupSectionData.js.map