| 2007 | } |
| 2008 | |
| 2009 | export class ZodSymbol extends ZodType<symbol, ZodSymbolDef, symbol> { |
| 2010 | _parse(input: ParseInput): ParseReturnType<this["_output"]> { |
| 2011 | const parsedType = this._getType(input); |
| 2012 | if (parsedType !== ZodParsedType.symbol) { |
| 2013 | const ctx = this._getOrReturnCtx(input); |
| 2014 | addIssueToContext(ctx, { |
| 2015 | code: ZodIssueCode.invalid_type, |
| 2016 | expected: ZodParsedType.symbol, |
| 2017 | received: ctx.parsedType, |
| 2018 | }); |
| 2019 | return INVALID; |
| 2020 | } |
| 2021 | |
| 2022 | return OK(input.data); |
| 2023 | } |
| 2024 | |
| 2025 | static create = (params?: RawCreateParams): ZodSymbol => { |
| 2026 | return new ZodSymbol({ |
| 2027 | typeName: ZodFirstPartyTypeKind.ZodSymbol, |
| 2028 | ...processCreateParams(params), |
| 2029 | }); |
| 2030 | }; |
| 2031 | } |
| 2032 | |
| 2033 | //////////////////////////////////////////// |
| 2034 | //////////////////////////////////////////// |
nothing calls this directly
no test coverage detected