Home / Function/ serializeAttrs() — vite Function Reference

serializeAttrs() — vite Function Reference

Architecture documentation for the serializeAttrs() function in html.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  24fc56d4_8620_bda4_27c9_602d39b84eea["serializeAttrs()"]
  f8fe0737_718a_5509_b722_473f207d5906["html.ts"]
  24fc56d4_8620_bda4_27c9_602d39b84eea -->|defined in| f8fe0737_718a_5509_b722_473f207d5906
  a15e31f8_dfca_e732_f0ff_80da09431f9a["serializeTag()"]
  a15e31f8_dfca_e732_f0ff_80da09431f9a -->|calls| 24fc56d4_8620_bda4_27c9_602d39b84eea
  style 24fc56d4_8620_bda4_27c9_602d39b84eea fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/node/plugins/html.ts lines 1567–1577

function serializeAttrs(attrs: HtmlTagDescriptor['attrs']): string {
  let res = ''
  for (const key in attrs) {
    if (typeof attrs[key] === 'boolean') {
      res += attrs[key] ? ` ${key}` : ``
    } else {
      res += ` ${key}="${escapeHtml(attrs[key])}"`
    }
  }
  return res
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does serializeAttrs() do?
serializeAttrs() is a function in the vite codebase, defined in packages/vite/src/node/plugins/html.ts.
Where is serializeAttrs() defined?
serializeAttrs() is defined in packages/vite/src/node/plugins/html.ts at line 1567.
What calls serializeAttrs()?
serializeAttrs() is called by 1 function(s): serializeTag.

Analyze Your Own Codebase

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

Try Supermodel Free