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

assertEitherPackage() — drizzle-orm Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  77ec095b_ef6d_6d73_1c2c_4c187bceeb8e["assertEitherPackage()"]
  34140e39_ad92_a121_09b2_e3e2624fd021["utils.ts"]
  77ec095b_ef6d_6d73_1c2c_4c187bceeb8e -->|defined in| 34140e39_ad92_a121_09b2_e3e2624fd021
  1667b582_3430_eb68_88ed_3f551edd5fa5["err()"]
  77ec095b_ef6d_6d73_1c2c_4c187bceeb8e -->|calls| 1667b582_3430_eb68_88ed_3f551edd5fa5
  style 77ec095b_ef6d_6d73_1c2c_4c187bceeb8e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-kit/src/cli/utils.ts lines 51–75

export const assertEitherPackage = async (
	...pkgs: string[]
): Promise<string[]> => {
	const availables = [] as string[];
	for (let i = 0; i < pkgs.length; i++) {
		try {
			const it = pkgs[i];
			await import(it);
			availables.push(it);
		} catch (e) {}
	}

	if (availables.length > 0) {
		return availables;
	}

	err(
		`Please install one of those packages are needed: ${
			pkgs
				.map((it) => `'${it}'`)
				.join(' or ')
		}`,
	);
	process.exit(1);
};

Domain

Subdomains

Calls

Frequently Asked Questions

What does assertEitherPackage() do?
assertEitherPackage() is a function in the drizzle-orm codebase, defined in drizzle-kit/src/cli/utils.ts.
Where is assertEitherPackage() defined?
assertEitherPackage() is defined in drizzle-kit/src/cli/utils.ts at line 51.
What does assertEitherPackage() call?
assertEitherPackage() calls 1 function(s): err.

Analyze Your Own Codebase

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

Try Supermodel Free