From 3bbcf830a6d238e9f3c013ca9a5f75333f843605 Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 21 Jun 2024 20:26:49 +0200 Subject: [PATCH] fix type issue --- index.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/index.ts b/index.ts index 11a7538..25cc157 100755 --- a/index.ts +++ b/index.ts @@ -611,7 +611,18 @@ function selectTag(tags: string[], oldRef: string, useGreatest: boolean) { } } -async function checkUrlDep(key: string, dep: Dep, useGreatest: boolean) { +type CheckResult = { + key: string, + newRange: string, + user: string, + repo: string, + oldRef: string, + newRef: string, + newDate?: string, + newTag?: string, +}; + +async function checkUrlDep(key: string, dep: Dep, useGreatest: boolean): Promise { const stripped = dep.old.replace(stripRe, ""); const [_, user, repo, oldRef] = partsRe.exec(stripped) || []; if (!user || !repo || !oldRef) return; @@ -991,8 +1002,7 @@ async function main() { }), {concurrency}); for (const res of (results || []).filter(Boolean)) { - // @ts-expect-error - const {key, newRange, user, repo, oldRef, newRef, newDate} = res; + const {key, newRange, user, repo, oldRef, newRef, newDate} = res as CheckResult; deps[mode][key] = { // @ts-expect-error old: maybeUrlDeps[key].old,