import { IProxy , ProxyList , ProxyStorage } from '@verdaccio/proxy' ; import { Config , Versions } from '@verdaccio/types' ; /**
 * Set up the Up Storage for each link.
 */ export function setupUpLinks ( config ) { const uplinks = { } ; for ( const uplinkName in config . uplinks ) { if ( Object . prototype . hasOwnProperty . call ( config . uplinks , uplinkName ) ) { const proxy = new ProxyStorage ( config . uplinks [ uplinkName ] , config ) ; proxy . upname = uplinkName ; uplinks [ uplinkName ] = proxy ; } } return uplinks ; } export function updateVersionsHiddenUpLink ( versions , upLink ) { for ( const i in versions ) { if ( Object . prototype . hasOwnProperty . call ( versions , i ) ) { const version = versions [ i ] ; version [ Symbol . for ( '__verdaccio_uplink' ) ] = upLink . upname ; } } }