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
+1 -1
View File
@@ -24,7 +24,7 @@
"lit": "^2.0.2", "lit": "^2.0.2",
"quick-lru": "github:sindresorhus/quick-lru", "quick-lru": "github:sindresorhus/quick-lru",
"screenfull": "^5.1.0", "screenfull": "^5.1.0",
"zod": "^3.10.0" "zod": "^3.11.6"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.15.8", "@babel/core": "^7.15.8",
+2
View File
@@ -368,6 +368,8 @@ export class FrigateCard extends LitElement {
return []; return [];
} }
contenders.push(this._getParseErrorPathString(issue.path)); 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) => { type: z.string().superRefine((val, ctx) => {
if (!val.match(/^custom:(?!frigate-card).+/)) { if (!val.match(/^custom:(?!frigate-card).+/)) {
ctx.addIssue({ ctx.addIssue({
code: z.ZodIssueCode.invalid_type, code: z.ZodIssueCode.custom,
expected: 'string', message: "Frigate-card custom elements must match specific schemas",
received: 'string', fatal: true,
}); });
} }
}), }),