Files
common/packages/x-fetch/src/node.ts
T
2021-01-03 11:20:22 +01:00

9 lines
264 B
TypeScript

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