import { HttpRequestConfig } from "../interface/http-request-config" ; export function createQueryPath ( config ) { return `${ getParams ( config ) }${ getQueryParams ( config ) }` ; } function getParams ( config ) { let params = '' ; if ( config && config . params && config . params . length > 0 ) params = `/${ config . params . join ( '/' ) }` ; return params ; } function getQueryParams ( config ) { let queryParams = '?' ; if ( config && config . queryParams ) Object . keys ( config . queryParams ) . forEach ( key => { queryParams += `${ key }=${ config . queryParams [ key ] }&` ; } ) ; return queryParams . slice ( 0 , queryParams . length - 1 ) ; }