Home / Function/ mapObject() — astro Function Reference

mapObject() — astro Function Reference

Architecture documentation for the mapObject() function in utils.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  8f3f1324_cc32_00c5_4fe2_665c637372fb["mapObject()"]
  95e69b07_9c8c_ee50_db4b_fc142c3918a7["utils.ts"]
  8f3f1324_cc32_00c5_4fe2_665c637372fb -->|defined in| 95e69b07_9c8c_ee50_db4b_fc142c3918a7
  style 8f3f1324_cc32_00c5_4fe2_665c637372fb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/db/src/core/utils.ts lines 54–61

export function mapObject<T, U = T>(
	item: Record<string, T>,
	callback: (key: string, value: T) => U,
): Record<string, U> {
	return Object.fromEntries(
		Object.entries(item).map(([key, value]) => [key, callback(key, value)]),
	);
}

Domain

Subdomains

Frequently Asked Questions

What does mapObject() do?
mapObject() is a function in the astro codebase, defined in packages/db/src/core/utils.ts.
Where is mapObject() defined?
mapObject() is defined in packages/db/src/core/utils.ts at line 54.

Analyze Your Own Codebase

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

Try Supermodel Free