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

mapEntries() — drizzle-orm Function Reference

Architecture documentation for the mapEntries() function in global.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  e1545488_d3d6_a971_9398_55e765af330c["mapEntries()"]
  8f03c4cf_4fdf_b056_3b24_d493cab0cc81["global.ts"]
  e1545488_d3d6_a971_9398_55e765af330c -->|defined in| 8f03c4cf_4fdf_b056_3b24_d493cab0cc81
  c7a398db_43c9_7771_09b7_73bc09e703e8["applyPgSnapshotsDiff()"]
  c7a398db_43c9_7771_09b7_73bc09e703e8 -->|calls| e1545488_d3d6_a971_9398_55e765af330c
  a5972ffc_ff1b_9523_2495_5373af710e65["applyMysqlSnapshotsDiff()"]
  a5972ffc_ff1b_9523_2495_5373af710e65 -->|calls| e1545488_d3d6_a971_9398_55e765af330c
  d4992b27_bf78_8099_5134_750cef1c518c["applySingleStoreSnapshotsDiff()"]
  d4992b27_bf78_8099_5134_750cef1c518c -->|calls| e1545488_d3d6_a971_9398_55e765af330c
  d9097b7e_1e27_d29f_7732_f2fa1447f2b8["applySqliteSnapshotsDiff()"]
  d9097b7e_1e27_d29f_7732_f2fa1447f2b8 -->|calls| e1545488_d3d6_a971_9398_55e765af330c
  55569cde_7638_9cfc_9dcd_34636d975ec3["applyLibSQLSnapshotsDiff()"]
  55569cde_7638_9cfc_9dcd_34636d975ec3 -->|calls| e1545488_d3d6_a971_9398_55e765af330c
  style e1545488_d3d6_a971_9398_55e765af330c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-kit/src/global.ts lines 37–48

export const mapEntries = <T>(
	obj: Record<string, T>,
	map: (key: string, value: T) => [string, T],
): Record<string, T> => {
	const result = Object.fromEntries(
		Object.entries(obj).map(([key, val]) => {
			const [newKey, newVal] = map(key, val);
			return [newKey, newVal];
		}),
	);
	return result;
};

Domain

Subdomains

Frequently Asked Questions

What does mapEntries() do?
mapEntries() is a function in the drizzle-orm codebase, defined in drizzle-kit/src/global.ts.
Where is mapEntries() defined?
mapEntries() is defined in drizzle-kit/src/global.ts at line 37.
What calls mapEntries()?
mapEntries() is called by 5 function(s): applyLibSQLSnapshotsDiff, applyMysqlSnapshotsDiff, applyPgSnapshotsDiff, applySingleStoreSnapshotsDiff, applySqliteSnapshotsDiff.

Analyze Your Own Codebase

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

Try Supermodel Free