mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
e840de27ed
Feels dangerous, but it's very handy.
9 lines
231 B
TypeScript
9 lines
231 B
TypeScript
import { assert } from 'tsafe';
|
|
import { z } from 'zod';
|
|
|
|
assert(!Object.hasOwn(z.ZodType.prototype, 'is'));
|
|
|
|
z.ZodType.prototype.is = function (val: unknown): val is z.infer<typeof this> {
|
|
return this.safeParse(val).success;
|
|
};
|