An utility package for creating typed url addresses
npm install --save-dev @valueadd/typed-urls
Based on provided value urlFactory
will indicate whether any params are expected. It will throw an error in case they are.
import { urlFactory } from '@valueadd/typed-urls';
const url = urlFactory('http://api-domain/users/:id');
console.log(url.url({ id: '1234' }));