t-comm
Version:
专业、稳定、纯粹的工具库
26 lines (21 loc) • 792 B
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var tslib_es6 = require('../tslib.es6-01322ba9.js');
var string_string = require('../string/string.js');
function getPagesJsonCondition(componentConfig) {
var allList = Object.values(componentConfig).reduce(function (acc, item) {
return tslib_es6.__spreadArray(tslib_es6.__spreadArray([], acc, true), item.list || [], true);
}, []).filter(function (item) {
return !item.demoRedirect;
}).map(function (item) {
return {
name: item.name,
path: ['pages', item.subPackage || 'press', string_string.hyphenate(item.name), string_string.hyphenate(item.name)].join('/')
};
});
return {
current: 0,
list: allList
};
}
exports.getPagesJsonCondition = getPagesJsonCondition;