瀏覽代碼

Exports fetch as non-default

main
Eric Amodio 2 年之前
父節點
當前提交
95224527d8
共有 3 個文件被更改,包括 7 次插入6 次删除
  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 查看文件

@ -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 查看文件

@ -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 查看文件

@ -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,

Loading…
取消
儲存