Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (href)
usedAssets.add(href);
});
$('img, iframe[data-internal=true]').each(function() {
const src = $(this).attr('src');
if (src)
usedAssets.add(src);
});
});
});
const allAssets = new Set(fs.readdirSync(assetsPath));
const unusedAssets = difference(allAssets, usedAssets);
const missingAssets = difference(usedAssets, allAssets);
if (missingAssets.size)
console.warning('Missing assets!', missingAssets);
return unusedAssets;
};
if (href)
usedAssets.add(href);
});
$('img, iframe[data-internal=true]').each(function() {
const src = $(this).attr('src');
if (src)
usedAssets.add(src);
});
});
});
const allAssets = new Set(fs.readdirSync(assetsPath));
const unusedAssets = difference(allAssets, usedAssets);
const missingAssets = difference(usedAssets, allAssets);
if (missingAssets.size)
console.warning('Missing assets!', missingAssets);
return unusedAssets;
};