Folder for multifile and multi data res

Change the use of folder and now use multiFile as option type value.
Return a JS object instead of a json string
return a data array in response
This commit is contained in:
Luis Tejeda
2022-06-06 17:14:08 -05:00
parent 4ccfa86271
commit 0a81fd8a96
6 changed files with 134 additions and 79 deletions

View File

@@ -4854,15 +4854,17 @@ module.exports = {
let bundleData = getBundleContentAndComponents(root, inputData, origin);
return bundleData;
});
let bundledFile = data[0].fileContent;
bundledFile.components = data[0].components;
if (format === parse.YAML_FORMAT) {
bundledFile = parse.toYAML(bundledFile);
}
else if (format === parse.JSON_FORMAT) {
bundledFile = parse.toJSON(bundledFile, 2);
}
return { rootFile: { path: parsedRootFiles[0].fileName }, bundledContent: bundledFile };
let bundleData = data.map((contentAndComponents) => {
let bundledFile = contentAndComponents.fileContent;
bundledFile.components = contentAndComponents.components;
if (format === parse.YAML_FORMAT) {
bundledFile = parse.toYAML(bundledFile);
}
return { rootFile: { path: parsedRootFiles[0].fileName }, bundledContent: bundledFile };
});
return bundleData;
},
/**