Use zod fatal support.

This commit is contained in:
Dermot Duffy
2021-10-30 01:52:07 -07:00
parent d97a03f94c
commit ffdcf2f058
3 changed files with 6 additions and 4 deletions
+2
View File
@@ -368,6 +368,8 @@ export class FrigateCard extends LitElement {
return [];
}
contenders.push(this._getParseErrorPathString(issue.path));
} else if (issue.code != 'custom') {
contenders.push(this._getParseErrorPathString(issue.path));
}
}
}
+3 -3
View File
@@ -213,9 +213,9 @@ const customSchema = z
type: z.string().superRefine((val, ctx) => {
if (!val.match(/^custom:(?!frigate-card).+/)) {
ctx.addIssue({
code: z.ZodIssueCode.invalid_type,
expected: 'string',
received: 'string',
code: z.ZodIssueCode.custom,
message: "Frigate-card custom elements must match specific schemas",
fatal: true,
});
}
}),