Total Complexity | 2 |
Complexity/F | 2 |
Lines of Code | 19 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Coverage | 100% |
Changes | 0 |
1 | import localFetch from '@hckrnews/local-fetch' |
||
2 | import fetch from 'node-fetch' |
||
3 | import isRemote from './is-remote.js' |
||
4 | |||
5 | 1 | const autoFetch = (location, options) => { |
|
6 | 4 | if (isRemote(location)) { |
|
7 | 1 | return fetch(location, options) |
|
8 | } |
||
9 | |||
10 | 3 | return localFetch(location) |
|
11 | } |
||
12 | |||
13 | export default autoFetch |
||
14 | export { |
||
15 | localFetch, |
||
16 | fetch, |
||
17 | autoFetch, |
||
18 | isRemote |
||
19 | } |
||
20 |