Passed
Push — master ( c34dd2...060fe5 )
by Roy
02:17
created

eg/show-paths.cjs.js   A

Complexity

Total Complexity 3
Complexity/F 1.5

Size

Lines of Code 21
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 13
mnd 1
bc 1
fnc 2
dl 0
loc 21
bpm 0.5
cpm 1.5
noi 0
c 0
b 0
f 0
rs 10

1 Function

Rating   Name   Duplication   Size   Complexity  
A show-paths.cjs.js ➔ objectEntries 0 9 3
1
/* eslint-env es6, node */
2
'use strict';
3
4
const osPaths = require('../dist/cjs/index.js');
5
6
/* eslint-disable no-console , functional/immutable-data , security/detect-object-injection, security-node/detect-crlf */
7
8
function objectEntries(obj) {
9
	const map = {};
10
	Object.keys(obj).forEach((key) => {
11
		const value = obj[key];
12
		const val = typeof value === 'function' ? value() : value;
13
		map[key] = val;
14
	});
15
	return map;
16
}
17
18
console.log({ osPaths });
19
console.log(objectEntries(osPaths));
20
21
process.env.TMPDIR = process.env.TEMP = process.env.TMP = 'temp';
22
console.log(objectEntries(osPaths));
23
24
/* eslint-enable no-console, functional/immutable-data , security/detect-object-injection , security-node/detect-crlf */
25