waze-api
Version:
Node.js wrapper for waze.
20 lines (19 loc) • 631 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.stringifyQueryParams = exports.generateParams = void 0;
const querystring_1 = require("querystring");
const generateParams = (opts) => {
const res = [];
if (!opts.hideAlerts)
res.push("alerts");
if (!opts.hideUsers)
res.push("users");
if (!opts.hideTraffic)
res.push("traffic");
return res;
};
exports.generateParams = generateParams;
const stringifyQueryParams = (types) => {
return (0, querystring_1.stringify)({ types: types.join(",") });
};
exports.stringifyQueryParams = stringifyQueryParams;