| 2042 | } |
| 2043 | |
| 2044 | export class ZodUndefined extends ZodType<undefined, ZodUndefinedDef, undefined> { |
| 2045 | _parse(input: ParseInput): ParseReturnType<this["_output"]> { |
| 2046 | const parsedType = this._getType(input); |
| 2047 | if (parsedType !== ZodParsedType.undefined) { |
| 2048 | const ctx = this._getOrReturnCtx(input); |
| 2049 | addIssueToContext(ctx, { |
| 2050 | code: ZodIssueCode.invalid_type, |
| 2051 | expected: ZodParsedType.undefined, |
| 2052 | received: ctx.parsedType, |
| 2053 | }); |
| 2054 | return INVALID; |
| 2055 | } |
| 2056 | return OK(input.data); |
| 2057 | } |
| 2058 | params?: RawCreateParams; |
| 2059 | |
| 2060 | static create = (params?: RawCreateParams): ZodUndefined => { |
| 2061 | return new ZodUndefined({ |
| 2062 | typeName: ZodFirstPartyTypeKind.ZodUndefined, |
| 2063 | ...processCreateParams(params), |
| 2064 | }); |
| 2065 | }; |
| 2066 | } |
| 2067 | |
| 2068 | /////////////////////////////////////// |
| 2069 | /////////////////////////////////////// |
nothing calls this directly
no test coverage detected