diff --git a/index.js b/index.js index 2a8ae15..22d38c9 100644 --- a/index.js +++ b/index.js @@ -27,6 +27,7 @@ function rewrite(src, dst) { let re, map; if (dst) { + if (typeof src == "string") src = src.replace(/\*/g, '(.*)'); re = pathToRegexp(src, keys); map = toMap(keys); debug('rewrite %s -> %s %s', src, dst, re);