diff --git a/packages/markers/src/common/problem-marker.ts b/packages/markers/src/common/problem-marker.ts index 1c0493dbffb61..219e64db8469d 100644 --- a/packages/markers/src/common/problem-marker.ts +++ b/packages/markers/src/common/problem-marker.ts @@ -16,6 +16,7 @@ import { Marker } from './marker'; import { Diagnostic } from '@theia/core/shared/vscode-languageserver-protocol'; +import { isObject } from '@theia/core/lib/common'; export const PROBLEM_KIND = 'problem'; @@ -24,7 +25,7 @@ export interface ProblemMarker extends Marker { } export namespace ProblemMarker { - export function is(node: Marker): node is ProblemMarker { - return 'kind' in node && node.kind === PROBLEM_KIND; + export function is(node: unknown): node is ProblemMarker { + return isObject>(node) && node.kind === PROBLEM_KIND; } }