DefinitelyTyped/route-parser/route-parser-tests.ts
2017-01-19 21:05:02 -08:00

6 lines
184 B
TypeScript

import * as Route from 'route-parser';
const route = new Route('/users/:id');
const matched = route.match('/users/42'); // => { id: '42' }
const reversed = route.reverse({ id: 42 });