Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Object.getOwnPropertyNames(severities).forEach( key => {
let value: string = severities[key];
let severity: ValidationProblemSeverity = ValidationProblemSeverity.low;
switch (value) {
case "ignore": severity = ValidationProblemSeverity.ignore; break;
case "low": severity = ValidationProblemSeverity.low; break;
case "medium": severity = ValidationProblemSeverity.medium; break;
case "high": severity = ValidationProblemSeverity.high; break;
}
rval[key] = severity;
});
return rval;
low(): ValidationProblemSeverity { return ValidationProblemSeverity.low; }
public lookupSeverity(rule: ValidationRuleMetaData): ValidationProblemSeverity {
if (this.severities[rule.code] !== undefined) {
return this.severities[rule.code];
}
return ValidationProblemSeverity.low;
}
public iconFor(problem: ValidationProblem): string {
switch (problem.severity) {
case ValidationProblemSeverity.low:
return "pficon-info";
case ValidationProblemSeverity.medium:
return "pficon-warning-triangle-o";
case ValidationProblemSeverity.high:
return "pficon-error-circle-o";
default:
return "pficon-info";
}
}
public iconFor(problem: ValidationProblem): string {
switch (problem.severity) {
case ValidationProblemSeverity.low:
return "pficon-info";
case ValidationProblemSeverity.medium:
return "pficon-warning-triangle-o";
case ValidationProblemSeverity.high:
return "pficon-error-circle-o";
default:
return "";
}
}
Object.getOwnPropertyNames(severities).forEach( key => {
let value: string = severities[key];
let severity: ValidationProblemSeverity = ValidationProblemSeverity.low;
switch (value) {
case "ignore": severity = ValidationProblemSeverity.ignore; break;
case "low": severity = ValidationProblemSeverity.low; break;
case "medium": severity = ValidationProblemSeverity.medium; break;
case "high": severity = ValidationProblemSeverity.high; break;
}
rval[key] = severity;
});
return rval;
public iconFor(problem: ValidationProblem): string {
switch (problem.severity) {
case ValidationProblemSeverity.low:
return "pficon-info";
case ValidationProblemSeverity.medium:
return "pficon-warning-triangle-o";
case ValidationProblemSeverity.high:
return "pficon-error-circle-o";
default:
return "";
}
}