@directus/update-check
Advanced tools
Comparing version 11.0.4 to 11.0.5
@@ -50,19 +50,19 @@ // src/index.ts | ||
var instance = Axios.create(); | ||
var axios = setupCache(instance, { storage: cache }); | ||
var axios = cache ? setupCache(instance, { storage: cache }) : instance; | ||
async function updateCheck(currentVersion) { | ||
let response; | ||
let packageManifest; | ||
try { | ||
response = await axios.get("https://registry.npmjs.org/directus", { | ||
const response = await axios.get("https://registry.npmjs.org/directus", { | ||
headers: { accept: "application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*" }, | ||
timeout: 8e3 | ||
}); | ||
packageManifest = response.data; | ||
} catch { | ||
return; | ||
} | ||
const packageManifest = response.data; | ||
const latestVersion = packageManifest["dist-tags"]["latest"]; | ||
if (!latestVersion || gte(currentVersion, latestVersion)) { | ||
const latestVersion = packageManifest?.["dist-tags"]?.["latest"]; | ||
const versions = packageManifest?.versions; | ||
if (!latestVersion || !versions || gte(currentVersion, latestVersion)) | ||
return; | ||
} | ||
const allVersions = Object.keys(packageManifest.versions).filter((version) => !prerelease(version)); | ||
const allVersions = Object.keys(versions).filter((version) => !prerelease(version)); | ||
const indexOfCurrent = allVersions.indexOf(currentVersion); | ||
@@ -69,0 +69,0 @@ const indexOfLatest = allVersions.indexOf(latestVersion); |
{ | ||
"name": "@directus/update-check", | ||
"version": "11.0.4", | ||
"version": "11.0.5", | ||
"description": "Check if an update for Directus is available", | ||
@@ -24,4 +24,4 @@ "homepage": "https://directus.io", | ||
"dependencies": { | ||
"axios": "1.6.2", | ||
"axios-cache-interceptor": "1.3.3", | ||
"axios": "1.6.7", | ||
"axios-cache-interceptor": "1.5.1", | ||
"boxen": "7.1.1", | ||
@@ -34,9 +34,9 @@ "chalk": "5.3.0", | ||
"@npm/types": "1.0.2", | ||
"@types/node": "18.19.3", | ||
"@types/node": "18.19.12", | ||
"@types/semver": "7.5.6", | ||
"@vitest/coverage-v8": "1.1.0", | ||
"@vitest/coverage-v8": "1.2.2", | ||
"strip-ansi": "7.1.0", | ||
"tsup": "8.0.1", | ||
"typescript": "5.3.3", | ||
"vitest": "1.1.0", | ||
"vitest": "1.2.2", | ||
"@directus/tsconfig": "1.0.1" | ||
@@ -43,0 +43,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6070
+ Addedaxios@1.6.7(transitive)
+ Addedaxios-cache-interceptor@1.5.1(transitive)
- Removedaxios@1.6.2(transitive)
- Removedaxios-cache-interceptor@1.3.3(transitive)
Updatedaxios@1.6.7