style: prefer const for originalSrc

This commit is contained in:
yanlong.wang 2025-02-17 17:43:23 +08:00
parent 008dcbaf22
commit 92f636474d
No known key found for this signature in database
GPG Key ID: C0A623C0BADF9F37

View File

@ -231,7 +231,7 @@ export class SnapshotFormatter extends AsyncService {
if (imageRetention === 'alt') { if (imageRetention === 'alt') {
return alt ? `(Image ${++imgIdx}: ${alt})` : ''; return alt ? `(Image ${++imgIdx}: ${alt})` : '';
} }
let originalSrc = (node.getAttribute('src') || '').trim(); const originalSrc = (node.getAttribute('src') || '').trim();
let linkPreferredSrc = originalSrc; let linkPreferredSrc = originalSrc;
const maybeSrcSet: string = (node.getAttribute('srcset') || '').trim(); const maybeSrcSet: string = (node.getAttribute('srcset') || '').trim();
if (!linkPreferredSrc && maybeSrcSet) { if (!linkPreferredSrc && maybeSrcSet) {