Path-To-RegExp dependency in demo is outdated
blakeembrey opened this issue · comments
The dependency on path-to-regexp is currently outdated, is it possible to rebuild? https://github.com/component/path-to-regexp/issues/36
+1. I found certain regression bugs in live demo which I thought was apparent in the actual library.
@dashed Interesting, we might have to recreate the repo elsewhere at the moment. Did the issues actually exist still?
@blakeembrey This is the case I tried. I'm unsure of other cases.
For the demo: http://forbeslindesay.github.io/express-route-tester/
Route /:foo(\d+)/:bar(\d+)
doesn't seem to work in the demo for input /2014/10
.
The regex generated is /^\/(?:(\d(.+)))\/(?:(\d(.+)))\/?$/i
, which is not correct.
But works fine in the library as of v1.0.1
:
var
pathToRegexp = require('path-to-regexp'),
keys = [],
re = pathToRegexp('/:foo(\\d+)/:bar(\\d+)', keys),
result = re.exec('/2014/10');
console.log(re);
/*
{ /^\/(\d+)\/(\d+)(?:\/(?=$))?$/i
keys:
[ { name: 'foo', delimiter: '/', optional: false, repeat: false },
{ name: 'bar', delimiter: '/', optional: false, repeat: false } ] }
*/
To clarify, the actual library works fine. The online demo just need updating.
@dashed Perfect, thanks. Just wanted to make sure it was working in 0.1.x
too. I'll add this to my list of things to do as multiple people are getting confused now and there's been no movement.
Sorry this took such along time. It is now updated to run on path-to-regexp 1.0.1 and as a bonus, the source is minified and includes source maps.
Awesome, thanks!
Thanks!