Skip to content
Myr

* immediately after :param would become not greedy

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by riadh · committed by TJ Holowaychuk · parent ee89ff5 · Browse files · 1 file+3 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−2 removed

  • other:+3 added−2 removed

1 file+3 added−2 removed

modified:lib/utils.js+3 added-2 removed
262 unmodified lines
263 if (Array.isArray(path)) path = '(' + path.join('|') + ')';264 path = path265 .concat(strict ? '' : '/?')266 .replace(/\/\(/g, '(?:/')267 .replace(/(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?/g, function(_, slash, format, key, capture, optional){267 .replace(/(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?(\*)?/g, function(_, slash, format, key, capture, optional, star){268 keys.push({ name: key, optional: !! optional });269 slash = slash || '';270 return ''271 + (optional ? '' : slash)272 + '(?:'273 + (optional ? slash : '')274 + (format || '') + (capture || (format && '([^/.]+?)' || '([^/]+?)')) + ')'275 + (optional || '');275 + (optional || '')276 + (star ? '(/*)' : '');277 })278 .replace(/([\/.])/g, '\\$1')279 .replace(/\*/g, '(.*)');280 return new RegExp('^' + path + '$', sensitive ? '' : 'i');
1 unmodified line