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

isConfig() — drizzle-orm Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  3437f80b_2630_14e6_b704_2b2528d0234f["isConfig()"]
  99737bc3_a631_a054_9291_f966c791930f["utils.ts"]
  3437f80b_2630_14e6_b704_2b2528d0234f -->|defined in| 99737bc3_a631_a054_9291_f966c791930f
  style 3437f80b_2630_14e6_b704_2b2528d0234f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/utils.ts lines 286–338

export function isConfig(data: any): boolean {
	if (typeof data !== 'object' || data === null) return false;

	if (data.constructor.name !== 'Object') return false;

	if ('logger' in data) {
		const type = typeof data['logger'];
		if (
			type !== 'boolean' && (type !== 'object' || typeof data['logger']['logQuery'] !== 'function')
			&& type !== 'undefined'
		) return false;

		return true;
	}

	if ('schema' in data) {
		const type = typeof data['schema'];
		if (type !== 'object' && type !== 'undefined') return false;

		return true;
	}

	if ('casing' in data) {
		const type = typeof data['casing'];
		if (type !== 'string' && type !== 'undefined') return false;

		return true;
	}

	if ('mode' in data) {
		if (data['mode'] !== 'default' || data['mode'] !== 'planetscale' || data['mode'] !== undefined) return false;

		return true;
	}

	if ('connection' in data) {
		const type = typeof data['connection'];
		if (type !== 'string' && type !== 'object' && type !== 'undefined') return false;

		return true;
	}

	if ('client' in data) {
		const type = typeof data['client'];
		if (type !== 'object' && type !== 'function' && type !== 'undefined') return false;

		return true;
	}

	if (Object.keys(data).length === 0) return true;

	return false;
}

Domain

Subdomains

Frequently Asked Questions

What does isConfig() do?
isConfig() is a function in the drizzle-orm codebase, defined in drizzle-orm/src/utils.ts.
Where is isConfig() defined?
isConfig() is defined in drizzle-orm/src/utils.ts at line 286.

Analyze Your Own Codebase

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

Try Supermodel Free