Home / Function/ getExportConstComponentObjectKeys() — astro Function Reference

getExportConstComponentObjectKeys() — astro Function Reference

Architecture documentation for the getExportConstComponentObjectKeys() function in rehype-optimize-static.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  615fc232_626d_b894_3598_dd4e7bbb6051["getExportConstComponentObjectKeys()"]
  36422914_2d7c_adeb_c777_76a007e3cb87["rehype-optimize-static.ts"]
  615fc232_626d_b894_3598_dd4e7bbb6051 -->|defined in| 36422914_2d7c_adeb_c777_76a007e3cb87
  d6e3dc2a_c11c_d2d3_2b99_f6aee60fd384["rehypeOptimizeStatic()"]
  d6e3dc2a_c11c_d2d3_2b99_f6aee60fd384 -->|calls| 615fc232_626d_b894_3598_dd4e7bbb6051
  style 615fc232_626d_b894_3598_dd4e7bbb6051 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/integrations/mdx/src/rehype-optimize-static.ts lines 253–270

function getExportConstComponentObjectKeys(node: RootContentMap['mdxjsEsm']) {
	const exportNamedDeclaration = node.data?.estree?.body[0];
	if (exportNamedDeclaration?.type !== 'ExportNamedDeclaration') return;

	const variableDeclaration = exportNamedDeclaration.declaration;
	if (variableDeclaration?.type !== 'VariableDeclaration') return;

	const variableInit = variableDeclaration.declarations[0]?.init;
	if (variableInit?.type !== 'ObjectExpression') return;

	const keys: string[] = [];
	for (const propertyNode of variableInit.properties) {
		if (propertyNode.type === 'Property' && propertyNode.key.type === 'Identifier') {
			keys.push(propertyNode.key.name);
		}
	}
	return keys;
}

Domain

Subdomains

Frequently Asked Questions

What does getExportConstComponentObjectKeys() do?
getExportConstComponentObjectKeys() is a function in the astro codebase, defined in packages/integrations/mdx/src/rehype-optimize-static.ts.
Where is getExportConstComponentObjectKeys() defined?
getExportConstComponentObjectKeys() is defined in packages/integrations/mdx/src/rehype-optimize-static.ts at line 253.
What calls getExportConstComponentObjectKeys()?
getExportConstComponentObjectKeys() is called by 1 function(s): rehypeOptimizeStatic.

Analyze Your Own Codebase

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

Try Supermodel Free