9 lines
264 B
TypeScript
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;
|