type ProxyHostOptions = { host : string ; } ; export const proxyHost = ( prevFetch , options ) : typeof fetch => ( ... args ) => { const request = new Request ( ... args ) ; const url = new URL ( request . url ) ; url . host = options . host ; return prevFetch ( new Request ( url . toString ( ) , request ) ) ; } ;