Passed
Branch master (c3a882)
by Dmytro
01:26
created

tests/entry.js   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 12
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

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

1 Function

Rating   Name   Duplication   Size   Complexity  
A entry.js ➔ _load 0 3 1
1
/* eslint-disable security/detect-non-literal-require */
2
import path from 'path';
3
4
const isBuild = process.env.BUILD && [ '1', 'true' ].includes(process.env.BUILD);
5
const entry = process.env.ENTRY && path.resolve(process.env.ENTRY)
6
|| isBuild && path.resolve(__dirname, '../lib')
7
|| path.resolve(__dirname, '../src');
8
9
module.exports = require(entry);
10
11
export function _load(relPath) {
12
    return require(path.join(entry, relPath));
13
}
14