Skip to content

Commit

Permalink
Correcting the regex for express param conversion.
Browse files Browse the repository at this point in the history
* It was working before, but it wasn't written properly.  Should match on [^}]+.
* Learned something new about javascript I.E. + can backtrack.
  • Loading branch information
jsdevel committed Feb 4, 2016
1 parent d21adab commit d73b694
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ function copy(obj) {
}

function toExpressParams(part) {
return part.replace(/^\{([^\{]+)\}$/, ':$1');
return part.replace(/^\{([^\}]+)\}$/, ':$1');
}

function withNoDuplicates(arr) {
Expand Down

0 comments on commit d73b694

Please sign in to comment.