"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validDataSource = void 0;
const validDataSource = (dataSourceInfo) => {
    if (!dataSourceInfo || !Array.isArray(dataSourceInfo.columns)) {
        throw `We can't find any columns in your configuration`;
    }
    if (!dataSourceInfo.columns.length) {
        throw 'You should have at least one column';
    }
    const allStringColumns = dataSourceInfo.columns.reduce((acc, col) => {
        if (!col || typeof col !== 'string') {
            return false;
        }
        return acc;
    }, true);
    if (!allStringColumns) {
        throw `Some of your columns are not strings`;
    }
    if (!Array.isArray(dataSourceInfo.data)) {
        throw `We can't find the data array in your configuration`;
    }
    return true;
};
exports.validDataSource = validDataSource;
