Completed
Push — next ( 5faad2...98c60d )
by Roy
02:24 queued 50s
created

src/index.ts   A

Complexity

Total Complexity 2
Complexity/F 2

Size

Lines of Code 25
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 25
rs 10
bpm 1
cpm 2
noi 0
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A index.ts ➔ get 0 2 2
1
// spell-checker:ignore maint rivy
2
import { OSPathsAdaptionBuilder_ } from './lib/OSPaths';
3
import { adapter } from './platform-adapters/node';
4
5
const default_ = OSPathsAdaptionBuilder_(adapter);
6
export default default_;
7
8
const haveModuleExports_ = typeof module === 'object' && module.exports;
9
// ## maint ~ [2020-12-23; rivy] `else` clause *is* tested, but coverage is not visible via `nyc` (currently unable to instrument ESM/.mjs correctly)
10
/* istanbul ignore else */
11
if (haveModuleExports_) {
12
	// enables direct require from CJS (eg, `const module = require('...');`), but generally disables any other exports
13
	// * skipped for ESM (missing `module.exports`)
14
	// * added non-enumerable '_esm!' property (as a hack) to allow full access to all exports (for testing, ...)
15
	// eslint-disable-next-line functional/immutable-data
16
	module.exports = default_;
17
	// add a non-enumerable '_esm!' property (really a hack) to allow full access to all exports (for testing, ...)
18
	Object.defineProperty(module.exports, '_esm!', {
19
		get() {
20
			return exports;
21
		},
22
		enumerable: false,
23
	});
24
}
25