Home / Function/ expectSchemaShape() — drizzle-orm Function Reference

expectSchemaShape() — drizzle-orm Function Reference

Architecture documentation for the expectSchemaShape() function in utils.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  13da7f47_c488_1c05_a7ef_a5bccb3b8a71["expectSchemaShape()"]
  a613cfae_0db3_657f_d051_120c70da7539["utils.ts"]
  13da7f47_c488_1c05_a7ef_a5bccb3b8a71 -->|defined in| a613cfae_0db3_657f_d051_120c70da7539
  style 13da7f47_c488_1c05_a7ef_a5bccb3b8a71 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-zod/tests/utils.ts lines 4–13

export function expectSchemaShape<T extends z.ZodObject<z.ZodRawShape>>(t: TaskContext, expected: T) {
	return {
		from(actual: T) {
			expect(Object.keys(actual.shape)).toStrictEqual(Object.keys(expected.shape));
			for (const key in Object.keys(actual.shape)) {
				expect(actual.shape[key]?._zod.def).toStrictEqual(expected.shape[key]?._zod.def);
			}
		},
	};
}

Domain

Subdomains

Frequently Asked Questions

What does expectSchemaShape() do?
expectSchemaShape() is a function in the drizzle-orm codebase, defined in drizzle-zod/tests/utils.ts.
Where is expectSchemaShape() defined?
expectSchemaShape() is defined in drizzle-zod/tests/utils.ts at line 4.

Analyze Your Own Codebase

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

Try Supermodel Free