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

uri.js ➔ join   A

Complexity

Conditions 2
Paths 4

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
c 0
b 0
f 0
nc 4
nop 1
dl 0
loc 5
rs 9.4285

1 Function

Rating   Name   Duplication   Size   Complexity  
A uri.js ➔ ... ➔ ??? 0 1 1
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
}