MCPcopy
hub / github.com/vitejs/vite / processSrcSet

Function processSrcSet

packages/vite/src/node/utils.ts:798–808  ·  view source on GitHub ↗
(
  srcs: string,
  replacer: (arg: ImageCandidate) => Promise<string>,
)

Source from the content-addressed store, hash-verified

796}
797
798export function processSrcSet(
799 srcs: string,
800 replacer: (arg: ImageCandidate) => Promise<string>,
801): Promise<string> {
802 return Promise.all(
803 parseSrcset(srcs).map(async ({ url, descriptor }) => ({
804 url: await replacer({ url, descriptor }),
805 descriptor,
806 })),
807 ).then(joinSrcset)
808}
809
810export function processSrcSetSync(
811 srcs: string,

Callers 2

handlerFunction · 0.90
rewriteCssImageSetFunction · 0.90

Calls 2

parseSrcsetFunction · 0.85
replacerFunction · 0.85

Tested by

no test coverage detected