Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function asDiagnostic(diagnostic) {
let result = new code.Diagnostic(asRange(diagnostic.range), diagnostic.message, asDiagnosticSeverity(diagnostic.severity));
if (Is.number(diagnostic.code) || Is.string(diagnostic.code)) {
result.code = diagnostic.code;
}
if (diagnostic.source) {
result.source = diagnostic.source;
}
if (diagnostic.relatedInformation) {
result.relatedInformation = asRelatedInformation(diagnostic.relatedInformation);
}
return result;
}
function asRelatedInformation(relatedInformation) {