Home / Function/ parseAuthor() — vite Function Reference

parseAuthor() — vite Function Reference

Architecture documentation for the parseAuthor() function in acknowledgements.data.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  15e14359_4c4c_e47c_5c7b_a51bc2275a03["parseAuthor()"]
  217bc23a_2c54_8ca5_016d_7cb941ca23b7["acknowledgements.data.ts"]
  15e14359_4c4c_e47c_5c7b_a51bc2275a03 -->|defined in| 217bc23a_2c54_8ca5_016d_7cb941ca23b7
  c7fe79cf_90ff_1266_2969_1631fc185db0["readPackageInfo()"]
  c7fe79cf_90ff_1266_2969_1631fc185db0 -->|calls| 15e14359_4c4c_e47c_5c7b_a51bc2275a03
  style 15e14359_4c4c_e47c_5c7b_a51bc2275a03 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

docs/_data/acknowledgements.data.ts lines 172–193

function parseAuthor(author: PackageJson['author']): {
  name?: string
  url?: string
} {
  if (!author) return {}
  if (typeof author === 'object') {
    return { name: author.name, url: author.url }
  }
  // Parse string format: "Name <email> (url)" or "Name (url)" or "Name <email>" or "Name"
  let str = author
  let url: string | undefined
  const urlMatch = str.match(/\(([^)]+)\)$/)
  if (urlMatch) {
    url = urlMatch[1]
    str = str.slice(0, urlMatch.index).trim()
  }
  const emailIndex = str.indexOf('<')
  if (emailIndex !== -1) {
    str = str.slice(0, emailIndex).trim()
  }
  return { name: str || author, url }
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does parseAuthor() do?
parseAuthor() is a function in the vite codebase, defined in docs/_data/acknowledgements.data.ts.
Where is parseAuthor() defined?
parseAuthor() is defined in docs/_data/acknowledgements.data.ts at line 172.
What calls parseAuthor()?
parseAuthor() is called by 1 function(s): readPackageInfo.

Analyze Your Own Codebase

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

Try Supermodel Free