blob: 096167422fbf5d6e3823becb989f50cdcbdf9b70 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
module.exports.formatScripts = scripts => {
const _scripts = {};
for (const scriptType in scripts) {
const currentScripts = scripts[scriptType];
for (const scriptName in currentScripts) {
const scriptPath = currentScripts[scriptName];
_scripts[scriptPath] = _scripts[scriptPath] || {};
_scripts[scriptPath][scriptType] = _scripts[scriptPath][scriptType] || [];
_scripts[scriptPath][scriptType].push(scriptName);
}
}
return _scripts;
};
|