Completed
Push — master ( a4aa47...fee80d )
by Vitaly
01:55
created

src/uri.js   A

Complexity

Total Complexity 9
Complexity/F 3

Size

Lines of Code 16
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
c 1
b 0
f 0
nc 1
dl 0
loc 16
rs 10
wmc 9
mnd 2
bc 4
fnc 3
bpm 1.3333
cpm 3
noi 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
A uri.js ➔ join 0 5 2
B uri.js ➔ query 0 8 6
1
import { join as pathJoin } from 'path';
2
3
export function join(...args) {
4
5
    args = args.filter( arg => arg === 0 || Boolean(arg) ).map(String);
6
    return args.length ? `${pathJoin(...args)}` : '/';
7
}
8
9
export function query(queryObject) {
10
    for (let param in queryObject) {
11
        if (queryObject.hasOwnProperty(param) && (queryObject[param] === undefined || queryObject[param] === '' || queryObject[param] === null) ) {
12
            delete queryObject[param];
13
        }
14
    }
15
    return queryObject;
16
}