Home / Function/ isSpecifierImported() — astro Function Reference

isSpecifierImported() — astro Function Reference

Architecture documentation for the isSpecifierImported() function in vite-plugin-mdx-postprocess.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  21a3b591_b826_af88_df86_c38ee83330f7["isSpecifierImported()"]
  1d16286a_a608_ecf0_1939_33200eaee4a0["vite-plugin-mdx-postprocess.ts"]
  21a3b591_b826_af88_df86_c38ee83330f7 -->|defined in| 1d16286a_a608_ecf0_1939_33200eaee4a0
  5fd6f1f4_38c0_593a_0f60_5635d6ac94c7["injectUnderscoreFragmentImport()"]
  5fd6f1f4_38c0_593a_0f60_5635d6ac94c7 -->|calls| 21a3b591_b826_af88_df86_c38ee83330f7
  208f74e4_5dbd_d2b1_4880_e0fe1c61ec8d["annotateContentExport()"]
  208f74e4_5dbd_d2b1_4880_e0fe1c61ec8d -->|calls| 21a3b591_b826_af88_df86_c38ee83330f7
  style 21a3b591_b826_af88_df86_c38ee83330f7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/integrations/mdx/src/vite-plugin-mdx-postprocess.ts lines 142–156

function isSpecifierImported(
	code: string,
	imports: readonly ImportSpecifier[],
	specifierRegex: RegExp,
	source: string,
) {
	for (const imp of imports) {
		if (imp.n !== source) continue;

		const importStatement = code.slice(imp.ss, imp.se);
		if (specifierRegex.test(importStatement)) return true;
	}

	return false;
}

Domain

Subdomains

Frequently Asked Questions

What does isSpecifierImported() do?
isSpecifierImported() is a function in the astro codebase, defined in packages/integrations/mdx/src/vite-plugin-mdx-postprocess.ts.
Where is isSpecifierImported() defined?
isSpecifierImported() is defined in packages/integrations/mdx/src/vite-plugin-mdx-postprocess.ts at line 142.
What calls isSpecifierImported()?
isSpecifierImported() is called by 2 function(s): annotateContentExport, injectUnderscoreFragmentImport.

Analyze Your Own Codebase

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

Try Supermodel Free