Skip to content

Commit

Permalink
Rename var srcset → item to avoid conflict with srcset module
Browse files Browse the repository at this point in the history
  • Loading branch information
maltsev committed Feb 5, 2024
1 parent 75b6af1 commit cf74521
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/modules/minifyUrls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,12 @@ export default async function minifyUrls(tree, options, moduleOptions) {
try {
const parsedSrcset = srcset.parseSrcset(attrValue, { strict: true });

node.attrs[attrName] = srcset.stringifySrcset(parsedSrcset.map(srcset => {
node.attrs[attrName] = srcset.stringifySrcset(parsedSrcset.map(item => {
if (relateUrlInstance) {
srcset.url = relateUrlInstance.relate(srcset.url);
item.url = relateUrlInstance.relate(item.url);
}

return srcset;
return item;
}));
} catch (e) {
// srcset will throw an Error for invalid srcset.
Expand Down

0 comments on commit cf74521

Please sign in to comment.