Home / Function/ parseSrcset() — tailwindcss Function Reference

parseSrcset() — tailwindcss Function Reference

Architecture documentation for the parseSrcset() function in urls.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  01fb3c91_8ac9_b821_5f67_d6eaa3ebdb66["parseSrcset()"]
  a65fed37_70d1_b4de_106e_109bf26e45fc["processSrcSet()"]
  a65fed37_70d1_b4de_106e_109bf26e45fc -->|calls| 01fb3c91_8ac9_b821_5f67_d6eaa3ebdb66
  style 01fb3c91_8ac9_b821_5f67_d6eaa3ebdb66 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/@tailwindcss-node/src/urls.ts lines 174–186

function parseSrcset(string: string): ImageCandidate[] {
  const matches = string
    .trim()
    .replace(escapedSpaceCharactersRE, ' ')
    .replace(/\r?\n/, '')
    .replace(/,\s+/, ', ')
    .replaceAll(/\s+/g, ' ')
    .matchAll(imageCandidateRE)
  return Array.from(matches, ({ groups }) => ({
    url: groups?.url?.trim() ?? '',
    descriptor: groups?.descriptor?.trim() ?? '',
  })).filter(({ url }) => !!url)
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does parseSrcset() do?
parseSrcset() is a function in the tailwindcss codebase.
What calls parseSrcset()?
parseSrcset() is called by 1 function(s): processSrcSet.

Analyze Your Own Codebase

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

Try Supermodel Free