From 8e0ade0a6afa8aa026b762b16d0cceff1ec997d3 Mon Sep 17 00:00:00 2001 From: Tatyana Kostromskaya <32135588+takost@users.noreply.github.com> Date: Mon, 9 Oct 2023 15:44:21 +0000 Subject: [PATCH] define type for function --- packages/github/src/internal/utils.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/github/src/internal/utils.ts b/packages/github/src/internal/utils.ts index 67f37de6..fb4a0225 100644 --- a/packages/github/src/internal/utils.ts +++ b/packages/github/src/internal/utils.ts @@ -1,7 +1,7 @@ import * as http from 'http' import * as httpClient from '@actions/http-client' import {OctokitOptions} from '@octokit/core/dist-types/types' -import {ProxyAgent, fetch as undiciFetch} from 'undici' +import {ProxyAgent, fetch} from 'undici' export function getAuthString( token: string, @@ -28,10 +28,10 @@ export function getProxyAgentDispatcher( return hc.getAgentDispatcher(destinationUrl) } -export function getProxyFetch(destinationUrl): any { +export function getProxyFetch(destinationUrl): typeof fetch { const httpDispatcher = getProxyAgentDispatcher(destinationUrl) - const proxyFetch: typeof undiciFetch = (url, opts) => { - return undiciFetch(url, { + const proxyFetch = (url, opts) => { + return fetch(url, { ...opts, dispatcher: httpDispatcher })