mirror of
https://github.com/certd/certd.git
synced 2026-07-24 12:37:35 +08:00
chore: 完善第三方依赖动态加载
This commit is contained in:
@@ -38,9 +38,7 @@ export class NpmRegistryResolver {
|
||||
|
||||
const candidates = (config?.candidates || []).filter(Boolean);
|
||||
const probes = await Promise.allSettled(candidates.map(registryUrl => this.probe(registryUrl)));
|
||||
const okList = probes
|
||||
.map(item => (item.status === "fulfilled" ? item.value : null))
|
||||
.filter((item): item is RegistryProbeResult => !!item && item.ok);
|
||||
const okList = probes.map(item => (item.status === "fulfilled" ? item.value : null)).filter((item): item is RegistryProbeResult => !!item && item.ok);
|
||||
|
||||
if (okList.length > 0) {
|
||||
okList.sort((a, b) => a.elapsedMs - b.elapsedMs);
|
||||
|
||||
Reference in New Issue
Block a user