MCPcopy
hub / github.com/tailwindlabs/tailwindcss / processSrcSet

Function processSrcSet

packages/@tailwindcss-node/src/urls.ts:162–172  ·  view source on GitHub ↗
(
  srcs: string,
  replacer: (arg: ImageCandidate) => Promise<string>,
)

Source from the content-addressed store, hash-verified

160}
161
162function processSrcSet(
163 srcs: string,
164 replacer: (arg: ImageCandidate) => Promise<string>,
165): Promise<string> {
166 return Promise.all(
167 parseSrcset(srcs).map(async ({ url, descriptor }) => ({
168 url: await replacer({ url, descriptor }),
169 descriptor,
170 })),
171 ).then(joinSrcset)
172}
173
174function parseSrcset(string: string): ImageCandidate[] {
175 const matches = string

Callers 1

rewriteCssImageSetFunction · 0.85

Calls 2

parseSrcsetFunction · 0.85
replacerFunction · 0.85

Tested by

no test coverage detected