agent updates
This commit is contained in:
@@ -36,8 +36,8 @@ const Logger = require("./logger");
|
||||
|
||||
class ValidationUtils {
|
||||
constructor(IloggerEnabled, IloggerLevel) {
|
||||
const loggerEnabled = IloggerEnabled || true;
|
||||
const loggerLevel = IloggerLevel || "warn";
|
||||
const loggerEnabled = IloggerEnabled ?? true;
|
||||
const loggerLevel = IloggerLevel ?? "warn";
|
||||
this.logger = new Logger(loggerEnabled, loggerLevel, 'ValidationUtils');
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ class ValidationUtils {
|
||||
continue;
|
||||
}
|
||||
|
||||
if("default" in v){
|
||||
if(v && typeof v === "object" && "default" in v){
|
||||
//put the default value in the object
|
||||
newObj[k] = v.default;
|
||||
continue;
|
||||
@@ -496,6 +496,11 @@ class ValidationUtils {
|
||||
return fieldSchema.default;
|
||||
}
|
||||
|
||||
if (typeof configValue !== "string") {
|
||||
this.logger.warn(`${name}.${key} is not a valid enum string. Using default value.`);
|
||||
return fieldSchema.default;
|
||||
}
|
||||
|
||||
const validValues = rules.values.map(e => e.value.toLowerCase());
|
||||
|
||||
//remove caps
|
||||
|
||||
Reference in New Issue
Block a user