MCPcopy
hub / github.com/colinhacks/zod / setKey

Method setKey

packages/zod/src/v3/types.ts:2737–2742  ·  view source on GitHub ↗
(
    key: Key,
    schema: Schema
  )

Source from the content-addressed store, hash-verified

2735 // }
2736
2737 setKey<Key extends string, Schema extends ZodTypeAny>(
2738 key: Key,
2739 schema: Schema
2740 ): ZodObject<T & { [k in Key]: Schema }, UnknownKeys, Catchall> {
2741 return this.augment({ [key]: schema }) as any;
2742 }
2743 // merge<Incoming extends AnyZodObject>(
2744 // merging: Incoming
2745 // ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {

Callers 1

object.test.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected