mirror of https://github.com/cupcakearmy/zod.git
Adds getters to Map for key + value (#2356)
This commit is contained in:
parent
a3c525658b
commit
4f75cbc682
|
@ -3441,6 +3441,12 @@ export class ZodMap<
|
|||
ZodMapDef<Key, Value>,
|
||||
Map<Key["_input"], Value["_input"]>
|
||||
> {
|
||||
get keySchema() {
|
||||
return this._def.keyType;
|
||||
}
|
||||
get valueSchema() {
|
||||
return this._def.valueType;
|
||||
}
|
||||
_parse(input: ParseInput): ParseReturnType<this["_output"]> {
|
||||
const { status, ctx } = this._processInputParams(input);
|
||||
if (ctx.parsedType !== ZodParsedType.map) {
|
||||
|
|
|
@ -3441,6 +3441,12 @@ export class ZodMap<
|
|||
ZodMapDef<Key, Value>,
|
||||
Map<Key["_input"], Value["_input"]>
|
||||
> {
|
||||
get keySchema() {
|
||||
return this._def.keyType;
|
||||
}
|
||||
get valueSchema() {
|
||||
return this._def.valueType;
|
||||
}
|
||||
_parse(input: ParseInput): ParseReturnType<this["_output"]> {
|
||||
const { status, ctx } = this._processInputParams(input);
|
||||
if (ctx.parsedType !== ZodParsedType.map) {
|
||||
|
|
Loading…
Reference in New Issue