Use zod fatal support.
This commit is contained in:
+1
-1
@@ -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",
|
||||||
|
|||||||
@@ -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
@@ -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,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user