@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
29 lines • 1.29 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateFeatures = validateFeatures;
exports.retrieveArchiveName = retrieveArchiveName;
const path_1 = __importDefault(require("path"));
const feature_1 = require("../../statistics/features/feature");
function validateFeatures(features) {
for (const feature of features) {
if (feature === 'all') {
if (features.length > 1) {
console.error(`Feature "all" must be the only feature given, got ${features.join(', ')}`);
process.exit(1);
}
}
else if (!feature_1.allFeatureNames.has(feature)) {
console.error(`Feature ${feature} is unknown, supported are ${[...feature_1.allFeatureNames].join(', ')} or "all"`);
process.exit(1);
}
}
return features[0] === 'all' ? feature_1.allFeatureNames : new Set(features);
}
function retrieveArchiveName(p) {
const basepath = path_1.default.normalize(p);
return `${basepath.endsWith(path_1.default.sep) ? basepath.substring(0, basepath.length - 1) : basepath}.tar.gz`;
}
//# sourceMappingURL=features.js.map