(rawUrl)
| 23 | return text; |
| 24 | } |
| 25 | function normalizeJdImageUrl(rawUrl) { |
| 26 | if (!rawUrl || typeof rawUrl !== 'string') |
| 27 | return ''; |
| 28 | let url = rawUrl.trim(); |
| 29 | if (!url) |
| 30 | return ''; |
| 31 | if (url.startsWith('//')) |
| 32 | url = `https:${url}`; |
| 33 | if (!/^https?:\/\//.test(url)) |
| 34 | return ''; |
| 35 | return url; |
| 36 | } |
| 37 | function normalizeJdImageSize(url) { |
| 38 | return normalizeJdImageUrl(url) |
| 39 | .replace(/\/pcpubliccms\/s\d+x\d+_jfs\//, '/pcpubliccms/jfs/') |
no outgoing calls
no test coverage detected