"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const lodash_1 = require("../../utils/lodash"); const assert_1 = tslib_1.__importDefault(require("assert")); /** * 合并引入模块中的checker和common * @param modules * @returns */ function combineBaseModules(...modules) { // 合并模块中的checker/common return modules.map((module) => { const checkers = require(`${module}/lib/checkers`).default; const common = require(`${module}/lib/configuration`).default; (0, assert_1.default)(checkers instanceof Array, `${module}模块中的checkers不是数组`); (0, assert_1.default)(typeof common === 'object', `${module}模块中的common配置不是对象`); return { checkers, common, }; }).reduce((prev, current) => ({ checkers: (0, lodash_1.mergeConcatArray)(prev.checkers, current.checkers), common: (0, lodash_1.mergeConcatArray)(prev.common, current.common), })); } exports.default = combineBaseModules;