mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2026-07-16 01:47:20 +02:00
9f8d3d3bc8
Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
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;
|
|
};
|