Notify the user when we modified the package versions

This commit is contained in:
Sander Declerck 2025-11-13 17:10:22 +01:00
parent dc6f37b3ec
commit 59fa76a42f
No known key found for this signature in database
3 changed files with 26 additions and 0 deletions

View file

@ -1,6 +1,8 @@
import { getMinimumPackageAgeHours } from "../../../config/settings.js";
import { ui } from "../../../environment/userInteraction.js";
let hasSuppressedVersions = false;
/**
* @param {NodeJS.Dict<string | string[]>} headers
*/
@ -100,6 +102,8 @@ export function modifyNpmInfoResponse(body, headers) {
* @param {string} version
*/
function deleteVersionFromJson(json, version) {
hasSuppressedVersions = true;
ui.writeVerbose(
`Safe-chain: ${version} is newer than ${getMinimumPackageAgeHours()} hours and was removed (minimumPackageAgeInHours setting).`
);
@ -152,3 +156,10 @@ function getMostRecentTag(tagList) {
return current;
}
/**
* @returns {boolean}
*/
export function getHasSuppressedVersions() {
return hasSuppressedVersions;
}