(string: string)
| 782 | const escapedSpaceCharacters = /(?: |\\t|\\n|\\f|\\r)+/g |
| 783 | |
| 784 | export function parseSrcset(string: string): ImageCandidate[] { |
| 785 | const matches = string |
| 786 | .trim() |
| 787 | .replace(escapedSpaceCharacters, ' ') |
| 788 | .replace(/\r?\n/, '') |
| 789 | .replace(/,\s+/, ', ') |
| 790 | .replaceAll(/\s+/g, ' ') |
| 791 | .matchAll(imageCandidateRegex) |
| 792 | return Array.from(matches, ({ groups }) => ({ |
| 793 | url: groups?.url?.trim() ?? '', |
| 794 | descriptor: groups?.descriptor?.trim() ?? '', |
| 795 | })).filter(({ url }) => !!url) |
| 796 | } |
| 797 | |
| 798 | export function processSrcSet( |
| 799 | srcs: string, |
no outgoing calls
no test coverage detected