t-comm
Version:
专业、稳定、纯粹的工具库
22 lines (19 loc) • 669 B
JavaScript
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
import { hyphenate } from '../string/string.mjs';
function getPagesJsonCondition(componentConfig) {
var allList = Object.values(componentConfig).reduce(function (acc, item) {
return [].concat(_toConsumableArray(acc), _toConsumableArray(item.list || []));
}, []).filter(function (item) {
return !item.demoRedirect;
}).map(function (item) {
return {
name: item.name,
path: ['pages', item.subPackage || 'press', hyphenate(item.name), hyphenate(item.name)].join('/')
};
});
return {
current: 0,
list: allList
};
}
export { getPagesJsonCondition };