Explorar el Código

Fixes typings for getProxyAgent

main
Eric Amodio hace 2 años
padre
commit
2e68712353
Se han modificado 2 ficheros con 5 adiciones y 4 borrados
  1. +3
    -2
      src/env/browser/fetch.ts
  2. +2
    -2
      src/plus/gitlab/gitlab.ts

+ 3
- 2
src/env/browser/fetch.ts Ver fichero

@ -1,9 +1,10 @@
const fetch = globalThis.fetch;
export { fetch, fetch as insecureFetch };
import type { HttpsProxyAgent } from 'https-proxy-agent';
declare global {
interface RequestInit {
agent?: undefined;
agent?: HttpsProxyAgent | undefined;
}
}
@ -12,7 +13,7 @@ declare type _RequestInit = RequestInit;
declare type _Response = Response;
export type { _BodyInit as BodyInit, _RequestInit as RequestInit, _Response as Response };
export function getProxyAgent(_strictSSL?: boolean): undefined {
export function getProxyAgent(_strictSSL?: boolean): HttpsProxyAgent | undefined {
return undefined;
}

+ 2
- 2
src/plus/gitlab/gitlab.ts Ver fichero

@ -682,7 +682,7 @@ $search: String!
rsp = await fetchMethod(`${baseUrl ?? 'https://gitlab.com/api'}/graphql`, {
method: 'POST',
headers: { authorization: `Bearer ${token}`, 'content-type': 'application/json' },
agent: agent as any,
agent: agent,
body: JSON.stringify({ query: query, variables: variables }),
});
@ -734,7 +734,7 @@ $search: String!
try {
rsp = await fetchMethod(url, {
headers: { authorization: `Bearer ${token}`, 'content-type': 'application/json' },
agent: agent as any,
agent: agent,
...options,
});

Cargando…
Cancelar
Guardar