File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " uquik" ,
3- "version" : " 1.0.18 " ,
3+ "version" : " 1.0.19 " ,
44 "description" : " uQuik HTTP(S) framework" ,
55 "main" : " index.js" ,
66 "scripts" : {
Original file line number Diff line number Diff line change @@ -325,10 +325,9 @@ class Server extends Router {
325325
326326 // Inject middleware into all routes that match its execution pattern if it is non global
327327 if ( object . priority !== 0 ) {
328- // const match = record.pattern !== '/' && record.pattern.endsWith('/') ? record.pattern.substr(0, record.pattern.length - 1) : record.pattern
329328 this . _routes . forEach ( ( method ) => {
330329 method . forEach ( ( route , pattern ) => {
331- if ( ( pattern === '/' && pattern === record . pattern ) || ( pattern !== '/' && pattern . startsWith ( record . pattern ) ) ) route . use ( object )
330+ if ( ( record . pattern === '/' && pattern === record . pattern ) || ( record . pattern !== '/' && pattern . startsWith ( record . pattern ) ) ) route . use ( object )
332331 } )
333332 } )
334333 }
Original file line number Diff line number Diff line change @@ -305,7 +305,8 @@ const parsePathParameters = (pattern) => {
305305 let counter = 0
306306 if ( pattern . indexOf ( '/:' ) > - 1 ) {
307307 const chunks = pattern . split ( '/' ) . filter ( ( chunk ) => chunk . length > 0 )
308- for ( let index = 0 ; index < chunks . length ; index ++ ) {
308+ const chunksLength = chunks . length
309+ for ( let index = 0 ; index < chunksLength ; index ++ ) {
309310 const current = chunks [ index ]
310311 if ( current . startsWith ( ':' ) && current . length > 2 ) {
311312 results . push ( [ current . substring ( 1 ) , counter ] )
You can’t perform that action at this time.
0 commit comments