Home / Function/ toAttributeString() — astro Function Reference

toAttributeString() — astro Function Reference

Architecture documentation for the toAttributeString() function in util.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  18707fa5_5c92_baf5_b50a_c1f739e143b2["toAttributeString()"]
  05241a8b_1820_8286_5770_4da18477ecde["util.ts"]
  18707fa5_5c92_baf5_b50a_c1f739e143b2 -->|defined in| 05241a8b_1820_8286_5770_4da18477ecde
  6a8bccff_747d_4ec9_706f_71a3b71d7341["handleBooleanAttribute()"]
  6a8bccff_747d_4ec9_706f_71a3b71d7341 -->|calls| 18707fa5_5c92_baf5_b50a_c1f739e143b2
  f16d0d52_160f_152d_f7fe_a1fd178b948b["addAttribute()"]
  f16d0d52_160f_152d_f7fe_a1fd178b948b -->|calls| 18707fa5_5c92_baf5_b50a_c1f739e143b2
  style 18707fa5_5c92_baf5_b50a_c1f739e143b2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/runtime/server/render/util.ts lines 24–27

export const toAttributeString = (value: any, shouldEscape = true) =>
	shouldEscape
		? String(value).replace(AMPERSAND_REGEX, '&').replace(DOUBLE_QUOTE_REGEX, '"')
		: value;

Domain

Subdomains

Frequently Asked Questions

What does toAttributeString() do?
toAttributeString() is a function in the astro codebase, defined in packages/astro/src/runtime/server/render/util.ts.
Where is toAttributeString() defined?
toAttributeString() is defined in packages/astro/src/runtime/server/render/util.ts at line 24.
What calls toAttributeString()?
toAttributeString() is called by 2 function(s): addAttribute, handleBooleanAttribute.

Analyze Your Own Codebase

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

Try Supermodel Free