mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 11:01:15 +00:00
17 lines
356 B
TypeScript
17 lines
356 B
TypeScript
import { z } from 'zod';
|
|
|
|
// Monkey-patch zod to support aliases
|
|
declare module 'zod' {
|
|
interface ZodType {
|
|
alias<T extends ZodType>(this: T, aliasName: string): T;
|
|
}
|
|
interface ZodTypeDef {
|
|
_alias: string;
|
|
}
|
|
}
|
|
|
|
z.ZodType.prototype.alias = function <T extends z.ZodType>(this: T, aliasName: string) {
|
|
this._def._alias = aliasName;
|
|
return this;
|
|
};
|