UNPKG

736 BJavaScriptView Raw
1"use strict";
2
3module.exports = function(config) {
4 let moduleConfig = config.moduleConfiguration;
5
6 let collectionMap = {};
7 let collectionPaths = [];
8 let collections = moduleConfig.collections;
9 let collectionNames = Object.keys(collections);
10 collectionNames.forEach(function(collectionName) {
11 var collection = collections[collectionName];
12 var fullPath = collectionName;
13 if (collection.group) {
14 fullPath = collection.group + '/' + fullPath;
15 }
16 collectionPaths.push(fullPath);
17 collectionMap[fullPath] = collectionName;
18 });
19
20 moduleConfig.collectionMap = collectionMap;
21 moduleConfig.collectionPaths = collectionPaths;
22
23 // console.log('moduleConfig', moduleConfig);
24
25 return moduleConfig;
26};