url-interpolator is a copycat of the angularjs url interpolation system
npm i url-interpolator
import interpolator from "url-interpolator";
const params = {projectId: "myidproject", userId: "myiduser"};
const url = interpolator("https://my-app.com/api/projects/:projectId/users/:userId", params);
console.log(url); // https://my-app.com/api/projects/myidproject/users/myiduser
import interpolator from "url-interpolator";
const params = {projectId: "myidproject"};
const url = interpolator("https://my-app.com/api/projects/:projectId/users/:userId", params);
console.log(url); // https://my-app.com/api/projects/myidproject/users/:userId
npm run build
npm run test