Skip to content

Commit a9c8816

Browse files
committed
Improve error types
1 parent f948ef1 commit a9c8816

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

annotations/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export type Annotator = (value: Json, options?: OutputFormat | ValidationOptions
1515
export const interpret: (compiledSchema: CompiledSchema, value: JsonNode, options?: OutputFormat | ValidationOptions) => JsonNode;
1616

1717
export class ValidationError extends Error {
18-
public output: Output;
18+
public output: Output & { valid: false };
1919

2020
public constructor(output: Output);
2121
}

lib/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const setShouldValidateSchema: (isEnabled: boolean) => void;
5656
export const getShouldValidateSchema: () => boolean;
5757

5858
export class InvalidSchemaError extends Error {
59-
public output: Output;
59+
public output: Output & { valid: false };
6060

6161
public constructor(output: Output);
6262
}

0 commit comments

Comments
 (0)