( srcs: string, replacer: (arg: ImageCandidate) => Promise<string>, )
| 160 | } |
| 161 | |
| 162 | function 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 | |
| 174 | function parseSrcset(string: string): ImageCandidate[] { |
| 175 | const matches = string |
no test coverage detected