remove local ref in path

remove the local reference in path
This commit is contained in:
Luis Tejeda
2022-04-25 16:33:19 -05:00
committed by Erik Mendoza
parent d4c2b9d331
commit ef829769c1
5 changed files with 127 additions and 16 deletions

View File

@@ -4845,7 +4845,17 @@ module.exports = {
};
},
mapRootFiles(rootFiles, inputData, origin) {
/**
*
* @description Takes in root files, input data and origin process every root
* to find related files
* @param {object} rootFiles - rootFile:{path:string}
* @param {array} inputData - [{path:string}]}
* @param {string} origin - process origin
*
* @returns {object} root files information and data input
*/
mapProcessRelatedFiles(rootFiles, inputData, origin) {
let data = rootFiles.map((root) => {
let { relatedFiles, missingRelatedFiles } = getRelatedFiles(root, inputData, origin);
return {
@@ -4856,6 +4866,14 @@ module.exports = {
return data;
},
/**
*
* @description Takes in a folder and identifies the related files from the
* root file perspective (using $ref property)
* @param {string} inputRelatedFiles - {rootFile:{path:string}, data: [{path:string}]}
*
* @returns {object} root files information and data input
*/
processRelatedFiles(inputRelatedFiles) {
let version = inputRelatedFiles.specificationVersion ? inputRelatedFiles.specificationVersion : '3.0.0',
res = {
@@ -4871,7 +4889,7 @@ module.exports = {
}
};
if (inputRelatedFiles.rootFiles && inputRelatedFiles.rootFiles.length > 0) {
res.output.data = this.mapRootFiles(inputRelatedFiles.rootFiles, inputRelatedFiles.data,
res.output.data = this.mapProcessRelatedFiles(inputRelatedFiles.rootFiles, inputRelatedFiles.data,
inputRelatedFiles.origin);
}
return res;