"use strict"; // FIXME: Publish this some day, and switch to it instead of the `make-url` package (which has a magic API) module.exports = function makeURL(template, options) { return template.replace(/:([^\/]+)/gi, (_, property) => { if (options[property] != null) { return encodeURIComponent(options[property]); } else { throw new Error(`Missing property: ${property}`); } }); };