mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -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
|
* Translate an express-style pattern to regex one in two ways:
|
||||||
* all :arguments become .+?
|
*
|
||||||
|
* 1. /path/:arg/ – all :arg's become .+?
|
||||||
|
* 2. /path/:arg([regex]) – :arg is removed, leaving just /path/([regex])
|
||||||
*/
|
*/
|
||||||
expressPatternToRegex: function (pattern) {
|
expressPatternToRegex: function (pattern) {
|
||||||
pattern = pattern.replace(/(:\w+)(\([^\)]+\))/gi, '$2');
|
pattern = pattern.replace(/(:\w+)(\([^\)]+\))/gi, '$2');
|
||||||
|
|
Loading…
Reference in a new issue