lib/utils.ts
last analyzed

Complexity

Total Complexity 0
Complexity/F 0

Size

Lines of Code 13
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 0
eloc 6
mnd 0
bc 0
fnc 0
dl 0
loc 13
ccs 12
cts 12
cp 1
bpm 0
cpm 0
noi 0
c 0
b 0
f 0
1 1
/**
2 1
 * test if val is a function
3 1
 */
4 1
const isFunction = (val: unknown): val is Function => typeof val === 'function';
5 1
6 1
/**
7 1
 * prevent output undefined
8 1
 */
9 1
// eslint-disable-next-line @typescript-eslint/no-base-to-string, @typescript-eslint/strict-boolean-expressions, @typescript-eslint/prefer-nullish-coalescing
10 2
const safeString = (st?: Object): string => (st || '').toString();
11 1
12
export { isFunction, safeString };
13