@@ -2238,6 +2238,60 @@ var TESTS: Test[] = [
2238
2238
[
2239
2239
[ null , 'this is' ]
2240
2240
]
2241
+ ] ,
2242
+ /**
2243
+ * Case-sensitive compile tokensToFunction params.
2244
+ */
2245
+ [
2246
+ '/:test(abc)' ,
2247
+ {
2248
+ sensitive : true
2249
+ } ,
2250
+ [
2251
+ {
2252
+ name : 'test' ,
2253
+ prefix : '/' ,
2254
+ delimiter : '/' ,
2255
+ optional : false ,
2256
+ repeat : false ,
2257
+ partial : false ,
2258
+ asterisk : false ,
2259
+ pattern : 'abc'
2260
+ }
2261
+ ] ,
2262
+ [
2263
+ [ '/abc' , [ '/abc' , 'abc' ] ] ,
2264
+ [ '/ABC' , null ]
2265
+ ] ,
2266
+ [
2267
+ [ { test : 'abc' } , '/abc' ] ,
2268
+ [ { test : 'ABC' } , null ]
2269
+ ]
2270
+ ] ,
2271
+ [
2272
+ '/:test(abc)' ,
2273
+ {
2274
+ } ,
2275
+ [
2276
+ {
2277
+ name : 'test' ,
2278
+ prefix : '/' ,
2279
+ delimiter : '/' ,
2280
+ optional : false ,
2281
+ repeat : false ,
2282
+ partial : false ,
2283
+ asterisk : false ,
2284
+ pattern : 'abc'
2285
+ }
2286
+ ] ,
2287
+ [
2288
+ [ '/abc' , [ '/abc' , 'abc' ] ] ,
2289
+ [ '/ABC' , [ '/ABC' , 'ABC' ] ]
2290
+ ] ,
2291
+ [
2292
+ [ { test : 'abc' } , '/abc' ] ,
2293
+ [ { test : 'ABC' } , '/ABC' ]
2294
+ ]
2241
2295
]
2242
2296
]
2243
2297
@@ -2322,7 +2376,7 @@ describe('path-to-regexp', function () {
2322
2376
} )
2323
2377
2324
2378
describe ( util . inspect ( path ) , function ( ) {
2325
- var re = pathToRegexp ( path , opts )
2379
+ var re = pathToRegexp ( path as string , opts )
2326
2380
2327
2381
// Parsing and compiling is only supported with string input.
2328
2382
if ( typeof path === 'string' ) {
@@ -2331,7 +2385,7 @@ describe('path-to-regexp', function () {
2331
2385
} )
2332
2386
2333
2387
describe ( 'compile' , function ( ) {
2334
- var toPath = pathToRegexp . compile ( path )
2388
+ var toPath = pathToRegexp . compile ( path as string , opts )
2335
2389
2336
2390
compileCases . forEach ( function ( io ) {
2337
2391
var input = io [ 0 ]
0 commit comments