Home / Function/ unwrapBaseZ4ObjectSchema() — astro Function Reference

unwrapBaseZ4ObjectSchema() — astro Function Reference

Architecture documentation for the unwrapBaseZ4ObjectSchema() function in server.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  ac44fab6_84c7_f30e_2f76_3f805b6e5054["unwrapBaseZ4ObjectSchema()"]
  12df90c3_b0fe_d858_b821_5011b6067fdb["server.ts"]
  ac44fab6_84c7_f30e_2f76_3f805b6e5054 -->|defined in| 12df90c3_b0fe_d858_b821_5011b6067fdb
  258b6bef_aced_8d2a_aea4_de1c127c32ab["parseFormInput()"]
  258b6bef_aced_8d2a_aea4_de1c127c32ab -->|calls| ac44fab6_84c7_f30e_2f76_3f805b6e5054
  style ac44fab6_84c7_f30e_2f76_3f805b6e5054 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/actions/runtime/server.ts lines 349–366

function unwrapBaseZ4ObjectSchema(schema: z.$ZodType, unparsedInput: FormData) {
	if (schema instanceof z.$ZodPipe) {
		return unwrapBaseZ4ObjectSchema(schema._zod.def.in, unparsedInput);
	}
	if (schema instanceof z.$ZodDiscriminatedUnion) {
		const typeKey = schema._zod.def.discriminator;
		const typeValue = unparsedInput.get(typeKey);
		if (typeof typeValue !== 'string') return schema;

		const objSchema = schema._zod.def.options.find((option) =>
			(option as any).def.shape[typeKey].values.has(typeValue),
		);
		if (!objSchema) return schema;

		return objSchema;
	}
	return schema;
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does unwrapBaseZ4ObjectSchema() do?
unwrapBaseZ4ObjectSchema() is a function in the astro codebase, defined in packages/astro/src/actions/runtime/server.ts.
Where is unwrapBaseZ4ObjectSchema() defined?
unwrapBaseZ4ObjectSchema() is defined in packages/astro/src/actions/runtime/server.ts at line 349.
What calls unwrapBaseZ4ObjectSchema()?
unwrapBaseZ4ObjectSchema() is called by 1 function(s): parseFormInput.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free