/* eslint-disable @typescript-eslint/no-namespace */ import * as nls from '@vscode-alt/monaco-editor/esm/vs/nls'; import { equalsIgnoreCase } from '@vscode-alt/monaco-editor/esm/vs/base/common/strings'; enum Severity { Ignore = 'Ignore', Info = 'Info', Warning = 'Warning', Error = 'Error', } namespace Severity { const _error = 'error'; const _warning = 'warning'; const _warn = 'warn'; const _info = 'info'; /** * Parses 'error', 'warning', 'warn', 'info' in call casings * and falls back to ignore. */ export function fromValue(value: string): Severity { if (!value) { return Severity.Ignore; } if (equalsIgnoreCase(_error, value)) { return Severity.Error; } if (equalsIgnoreCase(_warning, value) || equalsIgnoreCase(_warn, value)) { return Severity.Warning; } if (equalsIgnoreCase(_info, value)) { return Severity.Info; } return Severity.Ignore; } } export { Severity };