From f2616eef3386f0fcf312d375a7dd17949df64e50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20T=C3=B8mmer=C3=A5s?= Date: Tue, 9 Dec 2025 15:34:35 +0100 Subject: [PATCH] fix: add missing return type to validation result `Promise` is not a valid return type for async keywords, making it difficult to write these without wrestling with TypeScript. --- src/Keyword.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Keyword.ts b/src/Keyword.ts index daebb023..fb9c3594 100644 --- a/src/Keyword.ts +++ b/src/Keyword.ts @@ -36,7 +36,7 @@ export type JsonSchemaValidatorParams = { pointer?: string; data: unknown; node: export interface JsonSchemaValidator { toJSON?: () => string; order?: number; - (options: JsonSchemaValidatorParams): undefined | ValidationResult | ValidationResult[]; + (options: JsonSchemaValidatorParams): undefined | Promise | ValidationResult | ValidationResult[]; } export type Keyword = {