@sasjs/cli
Version:
Command line interface for SASjs
31 lines (30 loc) • 1.21 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getFileInputs = void 0;
var utils_1 = require("@sasjs/utils");
/**
* Returns list of Inputs and populates Map of Nodes
* @param {string} fileName- Name of the file from which Inputs need to extract
* @param {string} fileContent- Contents of the file from which Inputs need to extract
* @param {Map} paramNodes- Map for params(Inputs/Outputs)
*/
function getFileInputs(fileName, fileContent, paramNodes) {
var fileInputs = (0, utils_1.getList)(utils_1.DependencyHeader.DataInput, fileContent)
.map(function (input) { return input.toUpperCase(); })
.filter(function (input) { return !input.endsWith('.DLL'); });
fileInputs.forEach(function (inputParam) {
inputParam = inputParam.toUpperCase();
var paramNode = paramNodes.get(inputParam);
if (paramNode) {
paramNode.edges.push(fileName);
paramNodes.set(inputParam, paramNode);
}
else
paramNodes.set(inputParam, {
edges: [fileName],
label: inputParam
});
});
return fileInputs;
}
exports.getFileInputs = getFileInputs;