UNPKG

tmdb-interface

Version:

This is a Node.js wrapper of TMDB API. We apply chain-style design on it, which make it more semantic and functional.

13 lines (12 loc) 356 B
const querystring = require('querystring') module.exports = (self) => { return (path, query) => { let url = '' if (Object.keys(query).length === 0) { url = `/${self.version}${path}` } else { url = `/${self.version}${path}?${querystring.stringify(query)}` } return url } }