mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-22 15:17:53 -05:00
make comment explanatory of new style
Thanks @rschamp!
This commit is contained in:
parent
87da9f3d8a
commit
79e778af7a
1 changed files with 4 additions and 2 deletions
|
@ -33,8 +33,10 @@ var FastlyConfigMethods = {
|
|||
},
|
||||
|
||||
/*
|
||||
* Translate an express-style pattern e.g. /path/:arg/ to a regex
|
||||
* all :arguments become .+?
|
||||
* Translate an express-style pattern to regex one in two ways:
|
||||
*
|
||||
* 1. /path/:arg/ – all :arg's become .+?
|
||||
* 2. /path/:arg([regex]) – :arg is removed, leaving just /path/([regex])
|
||||
*/
|
||||
expressPatternToRegex: function (pattern) {
|
||||
pattern = pattern.replace(/(:\w+)(\([^\)]+\))/gi, '$2');
|
||||
|
|
Loading…
Reference in a new issue