UNPKG

dvf-client-js

Version:

<img src="https://avatars1.githubusercontent.com/u/56512535?s=200&v=4" align="right" />

17 lines (13 loc) 343 B
const { get } = require('request-promise') const _ = require('lodash') module.exports = async (dvf, endpoint, qs = {}, headers = {}) => { const url = dvf.config.api + endpoint const options = { uri: url, headers, // removes null and undefined values qs: _.omitBy(qs, _.isNil), json: true } return get(options) }