Passed
Pull Request — main (#1)
by Pieter Epeüs
03:34 queued 51s
created

src/index.js   A

Complexity

Total Complexity 2
Complexity/F 2

Size

Lines of Code 19
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 13
mnd 1
bc 1
fnc 1
dl 0
loc 19
ccs 4
cts 4
cp 1
rs 10
bpm 1
cpm 2
noi 0
c 0
b 0
f 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