feat: minimum age
Node.js CI / CI (push) Failing after 8s
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 57s

This commit is contained in:
2026-02-03 18:58:40 -08:00
parent efac4cf32b
commit bc572cdf76
5 changed files with 190 additions and 7 deletions
+10 -2
View File
@@ -6,7 +6,7 @@
import { Logger } from "@nhcarrigan/logger";
import semver from "semver";
import type { NpmService } from "./npmService.js";
import { NpmService } from "./npmService.js";
import type {
DependencyType,
DependencyUpdate,
@@ -151,7 +151,15 @@ class DependencyAnalyzerService {
return null;
}
const latestVersion = packageInfo["dist-tags"].latest;
// Use mature version (at least 10 days old) instead of dist-tags.latest
const latestVersion = NpmService.getLatestMatureVersion(
packageInfo,
10,
);
if (latestVersion === null) {
return null;
}
const cleanCurrentVersion = cleanVersion(currentVersion);
if (shouldUpdate(cleanCurrentVersion, latestVersion)) {