0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

chore(website): addons update codeql (#4321)

This commit is contained in:
Marc Bernard 2023-12-24 14:45:09 -05:00 committed by GitHub
parent 7b579b3337
commit 0f3df248f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,9 +13,14 @@ import path from 'path';
// @ts-ignore
item.description = d.description;
// remove html tags from description (e.g. <h1...>)
item.description = item.description.replace(/<[^>]*>?/gm, '');
// CodeQL js/incomplete-multi-character-sanitization
let previous;
do {
previous = item.description;
item.description = item.description.replace(/<[^>]*>?/gm, '');
} while (item.description !== previous);
// remove markdown links from description (e.g. [link](url))
item.description = item.description.replace(/\[(.*?)\]\(.*?\)/gm, '$1');
item.description = item.description.trim().replace(/\[(.*?)\]\(.*?\)/gm, '$1');
item.url = `https://www.npmjs.org/${item.name}`;
item.registry = `https://registry.npmjs.org/${item.name}`;
item.bundled = typeof item.bundled === 'boolean' ? item.bundled : false;