Skip to content

Commit fd4c343

Browse files
committed
refactor(npm): remove unused outdated function
1 parent c98f616 commit fd4c343

1 file changed

Lines changed: 0 additions & 21 deletions

File tree

packages/opencode/src/npm/index.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import semver from "semver"
21
import z from "zod"
32
import { NamedError } from "@opencode-ai/util/error"
43
import { Global } from "../global"
@@ -41,26 +40,6 @@ export namespace Npm {
4140
return result
4241
}
4342

44-
export async function outdated(pkg: string, cachedVersion: string): Promise<boolean> {
45-
const response = await fetch(`https://registry.npmjs.org/${pkg}`)
46-
if (!response.ok) {
47-
log.warn("Failed to resolve latest version, using cached", { pkg, cachedVersion })
48-
return false
49-
}
50-
51-
const data = (await response.json()) as { "dist-tags"?: { latest?: string } }
52-
const latestVersion = data?.["dist-tags"]?.latest
53-
if (!latestVersion) {
54-
log.warn("No latest version found, using cached", { pkg, cachedVersion })
55-
return false
56-
}
57-
58-
const range = /[\s^~*xX<>|=]/.test(cachedVersion)
59-
if (range) return !semver.satisfies(latestVersion, cachedVersion)
60-
61-
return semver.lt(cachedVersion, latestVersion)
62-
}
63-
6443
export async function add(pkg: string) {
6544
const dir = directory(pkg)
6645
await using _ = await Flock.acquire(`npm-install:${Filesystem.resolve(dir)}`)

0 commit comments

Comments
 (0)