mirror of
https://github.com/nttgin/BGPalerter.git
synced 2024-05-19 06:50:08 +00:00
removed debug comments
This commit is contained in:
@@ -120,22 +120,20 @@ export default class InputYml extends Input {
|
|||||||
};
|
};
|
||||||
|
|
||||||
validate = (fileContent) => {
|
validate = (fileContent) => {
|
||||||
let prefixesError, optionsError = [];
|
let prefixesError;
|
||||||
|
let optionsError;
|
||||||
|
|
||||||
const options = fileContent.options;
|
const options = fileContent.options;
|
||||||
|
|
||||||
// if (options && options.monitorASns) {
|
if (options && options.monitorASns) {
|
||||||
// optionsError = Object
|
optionsError = Object
|
||||||
// .keys(options.monitorASns)
|
.keys(options.monitorASns)
|
||||||
// .map(asn => {
|
.map(asn => {
|
||||||
// console.log(new AS("2914").isValid());
|
if (!new AS(asn).isValid()) {
|
||||||
// if (!new AS(asn).isValid()) {
|
return "Not a valid AS number in monitorASns";
|
||||||
// return "Not a valid AS number in monitorASns";
|
}
|
||||||
// }
|
});
|
||||||
// });
|
}
|
||||||
//
|
|
||||||
// console.log(optionsError);
|
|
||||||
// }
|
|
||||||
|
|
||||||
prefixesError = Object
|
prefixesError = Object
|
||||||
.keys(fileContent)
|
.keys(fileContent)
|
||||||
@@ -201,13 +199,16 @@ export default class InputYml extends Input {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
})
|
});
|
||||||
.filter(i => i != null)
|
|
||||||
|
const errors = [...prefixesError, ...optionsError].filter(i => i != null);
|
||||||
|
|
||||||
|
errors
|
||||||
.map(error => {
|
.map(error => {
|
||||||
throw new Error(error);
|
throw new Error(error);
|
||||||
});
|
});
|
||||||
|
|
||||||
return [...prefixesError, ...optionsError].length === 0;
|
return errors.length === 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
_validateRegex = (regex) => {
|
_validateRegex = (regex) => {
|
||||||
|
Reference in New Issue
Block a user