Passed
Push — master ( 68056d...2f3a19 )
by Dmytro
01:52
created

tests/utils.js   A

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 18
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 10
mnd 0
bc 0
fnc 2
dl 0
loc 18
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
rs 10

2 Functions

Rating   Name   Duplication   Size   Complexity  
A utils.js ➔ resolve 0 3 1
A utils.js ➔ load 0 11 1
1
import path from 'path';
2
import { entry } from './constants';
3
4
export function load(relPath) {
5
    const absPath = path.resolve(entry, relPath);
6
7
    delete require.cache[require.resolve(absPath)];
8
    // eslint-disable-next-line security/detect-non-literal-require
9
    const result =  require(absPath);
10
11
    delete require.cache[require.resolve(absPath)];
12
13
    return result;
14
}
15
16
export function resolve(relPath) {
17
    return require.resolve(path.join(entry, relPath));
18
}
19