Passed
Push — qa ( 51c08a...d8d47e )
by Roy
01:29
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 16
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 Function

Rating   Name   Duplication   Size   Complexity  
A show-paths.ts ➔ objectEntries 0 13 2
1
import osPaths from '../src';
2
3
/* eslint-disable functional/immutable-data , security/detect-object-injection, 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
		const value = obj[key];
11
		const val = typeof value === 'function' ? value() : value;
12
		map[key] = val;
13
	});
14
	return map;
15
}
16
17
console.log({ osPaths });
18
console.log(objectEntries(osPaths));
19
20
process.env.TMPDIR = process.env.TEMP = process.env.TMP = 'temp';
21
console.log(objectEntries(osPaths));
22
23
/* eslint-enable functional/immutable-data , security/detect-object-injection, security-node/detect-crlf */
24