Passed
Push — qa ( 02107d...51c08a )
by Roy
01:37
created

eg/show-paths.ts   A

Complexity

Total Complexity 2
Complexity/F 2

Size

Lines of Code 22
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 17
mnd 1
bc 1
fnc 1
dl 0
loc 22
rs 10
bpm 1
cpm 2
noi 0
c 0
b 0
f 0
1
import osPaths from '../src';
2
3
/* eslint-disable security-node/detect-crlf */
4
5
// eslint-disable-next-line @typescript-eslint/no-explicit-any
6
function objectEntries(obj: any) {
7
	// eslint-disable-next-line @typescript-eslint/no-explicit-any
8
	const map: any = {};
9
	Object.keys(obj).forEach((key) => {
10
		// eslint-disable-next-line security/detect-object-injection
11
		const value = obj[key];
12
		const val = typeof value === 'function' ? value() : value;
13
		// eslint-disable-next-line functional/immutable-data , security/detect-object-injection
14
		map[key] = val;
15
	});
16
	return map;
17
}
18
19
console.log({ osPaths });
20
console.log(objectEntries(osPaths));
21
22
// eslint-disable-next-line functional/immutable-data
23
process.env.TMPDIR = process.env.TEMP = process.env.TMP = 'temp';
24
console.log(objectEntries(osPaths));
25
26
/* eslint-enable security-node/detect-crlf */
27