Home / Function/ fromModule() — astro Function Reference

fromModule() — astro Function Reference

Architecture documentation for the fromModule() function in data-store.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  6a6d9079_941e_e9bb_9299_6752c713dce4["fromModule()"]
  ac7e948d_1024_ae45_2ea1_742b83aa21b5["ImmutableDataStore"]
  6a6d9079_941e_e9bb_9299_6752c713dce4 -->|defined in| ac7e948d_1024_ae45_2ea1_742b83aa21b5
  870f3dbd_a127_94fc_201e_63ec494e65e9["dataStoreSingleton()"]
  870f3dbd_a127_94fc_201e_63ec494e65e9 -->|calls| 6a6d9079_941e_e9bb_9299_6752c713dce4
  07ad6235_cde0_7a74_fa45_64692b970316["fromMap()"]
  6a6d9079_941e_e9bb_9299_6752c713dce4 -->|calls| 07ad6235_cde0_7a74_fa45_64692b970316
  style 6a6d9079_941e_e9bb_9299_6752c713dce4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/content/data-store.ts lines 90–101

	static async fromModule() {
		try {
			// @ts-expect-error - this is a virtual module
			const data = await import('astro:data-layer-content');
			if (data.default instanceof Map) {
				return ImmutableDataStore.fromMap(data.default);
			}
			const map = devalue.unflatten(data.default);
			return ImmutableDataStore.fromMap(map);
		} catch {}
		return new ImmutableDataStore();
	}

Subdomains

Calls

Frequently Asked Questions

What does fromModule() do?
fromModule() is a function in the astro codebase, defined in packages/astro/src/content/data-store.ts.
Where is fromModule() defined?
fromModule() is defined in packages/astro/src/content/data-store.ts at line 90.
What does fromModule() call?
fromModule() calls 1 function(s): fromMap.
What calls fromModule()?
fromModule() is called by 1 function(s): dataStoreSingleton.

Analyze Your Own Codebase

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

Try Supermodel Free