Home / Function/ createArrayAttribute() — astro Function Reference

createArrayAttribute() — astro Function Reference

Architecture documentation for the createArrayAttribute() function in rehype-images-to-component.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  b413aeb8_4b11_f20f_2320_5284bf013dec["createArrayAttribute()"]
  315ab74a_5989_663f_988a_f9092ffec496["rehype-images-to-component.ts"]
  b413aeb8_4b11_f20f_2320_5284bf013dec -->|defined in| 315ab74a_5989_663f_988a_f9092ffec496
  96fae009_1947_4b99_49f6_41ff2c0e5601["getImageComponentAttributes()"]
  96fae009_1947_4b99_49f6_41ff2c0e5601 -->|calls| b413aeb8_4b11_f20f_2320_5284bf013dec
  style b413aeb8_4b11_f20f_2320_5284bf013dec fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/integrations/mdx/src/rehype-images-to-component.ts lines 12–41

function createArrayAttribute(name: string, values: (string | number)[]): MdxJsxAttribute {
	return {
		type: 'mdxJsxAttribute',
		name: name,
		value: {
			type: 'mdxJsxAttributeValueExpression',
			value: name,
			data: {
				estree: {
					type: 'Program',
					body: [
						{
							type: 'ExpressionStatement',
							expression: {
								type: 'ArrayExpression',
								elements: values.map((value) => ({
									type: 'Literal',
									value: value,
									raw: String(value),
								})),
							},
						},
					],
					sourceType: 'module',
					comments: [],
				},
			},
		},
	};
}

Domain

Subdomains

Frequently Asked Questions

What does createArrayAttribute() do?
createArrayAttribute() is a function in the astro codebase, defined in packages/integrations/mdx/src/rehype-images-to-component.ts.
Where is createArrayAttribute() defined?
createArrayAttribute() is defined in packages/integrations/mdx/src/rehype-images-to-component.ts at line 12.
What calls createArrayAttribute()?
createArrayAttribute() is called by 1 function(s): getImageComponentAttributes.

Analyze Your Own Codebase

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

Try Supermodel Free