Files
common/packages/x-fetch/src/node.ts
T
Jaco Greeff 86f17113e3 Dependency version checks (#904)
* Dependency version checks

* Add depndecy detection for all

* Cleanup util detectPackage

* Single detectPackage

* Update packages/hw-ledger/src/detectPackage.ts

* Update packages/util/src/detectPackage.ts

* non-indexed imports
2021-02-27 13:46:07 +01:00

15 lines
369 B
TypeScript

// Copyright 2017-2021 @polkadot/x-fetch authors & contributors
// SPDX-License-Identifier: Apache-2.0
import nodeFetch from 'node-fetch';
import { xglobal } from '@polkadot/x-global';
export { packageInfo } from './packageInfo';
export const fetch = (
typeof xglobal.fetch === 'undefined'
? nodeFetch as unknown as typeof global.fetch
: xglobal.fetch
);