Total Complexity | 9 |
Complexity/F | 3 |
Lines of Code | 16 |
Function Count | 3 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
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 | } |