Sfoglia il codice sorgente

Exports fetch as non-default

main
Eric Amodio 2 anni fa
parent
commit
95224527d8
3 ha cambiato i file con 7 aggiunte e 6 eliminazioni
  1. +4
    -2
      src/env/browser/fetch.ts
  2. +2
    -3
      src/env/node/fetch.ts
  3. +1
    -1
      src/premium/github/github.ts

+ 4
- 2
src/env/browser/fetch.ts Vedi File

@ -1,5 +1,7 @@
export default globalThis.fetch;
const fetch = globalThis.fetch;
export { fetch };
declare type _BodyInit = BodyInit;
declare type _RequestInit = RequestInit;
export type { _BodyInit as BodyInit, _RequestInit as RequestInit };
declare type _Response = Response;
export type { _BodyInit as BodyInit, _RequestInit as RequestInit, _Response as Response };

+ 2
- 3
src/env/node/fetch.ts Vedi File

@ -1,5 +1,4 @@
import fetch from 'node-fetch';
// eslint-disable-next-line import/no-default-export
export default fetch;
export type { BodyInit, RequestInit } from 'node-fetch';
export { fetch };
export type { BodyInit, RequestInit, Response } from 'node-fetch';

+ 1
- 1
src/premium/github/github.ts Vedi File

@ -2,7 +2,7 @@ import { Octokit } from '@octokit/core';
import { GraphqlResponseError } from '@octokit/graphql';
import { RequestError } from '@octokit/request-error';
import type { Endpoints, OctokitResponse, RequestParameters } from '@octokit/types';
import fetch from '@env/fetch';
import { fetch } from '@env/fetch';
import { isWeb } from '@env/platform';
import {
AuthenticationError,

Caricamento…
Annulla
Salva