Passed
Push — qa ( fc007d...9c72f0 )
by Roy
01:22
created

show-paths.ts ➔ objectEntries   A

Complexity

Conditions 2

Size

Total Lines 12
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 12
rs 9.9
c 0
b 0
f 0
cc 2
1
import osPaths from '../src';
2
3
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4
function objectEntries(obj: any) {
5
	// eslint-disable-next-line @typescript-eslint/no-explicit-any
6
	const map: any = {};
7
	Object.keys(obj).forEach((key) => {
8
		const value = obj[key];
9
		const val = typeof value === 'function' ? value() : value;
10
		// eslint-disable-next-line functional/immutable-data
11
		map[key] = val;
12
	});
13
	return map;
14
}
15
16
console.log({ osPaths });
17
console.log(objectEntries(osPaths));
18
19
// eslint-disable-next-line functional/immutable-data
20
process.env.TMPDIR = process.env.TEMP = process.env.TMP = 'temp';
21
console.log(objectEntries(osPaths));
22