11import { describe , expectTypeOf , it } from 'vitest'
22import {
33 MatcherPatternPathCustomParams ,
4- PARAM_INTEGER ,
4+ PARAM_INTEGER_SINGLE ,
55 PATH_PARAM_DEFAULT_PARSER ,
66 PATH_PARAM_SINGLE_DEFAULT ,
77} from './matcher-pattern'
@@ -10,7 +10,7 @@ describe('MatcherPatternPathCustomParams', () => {
1010 it ( 'can be generic' , ( ) => {
1111 const matcher = new MatcherPatternPathCustomParams (
1212 / ^ \/ u s e r s \/ ( [ ^ / ] + ) $ / i,
13- { userId : { parser : PATH_PARAM_DEFAULT_PARSER } } ,
13+ { userId : { ... PATH_PARAM_DEFAULT_PARSER } } ,
1414 [ 'users' , 0 ]
1515 )
1616
@@ -35,7 +35,7 @@ describe('MatcherPatternPathCustomParams', () => {
3535 it ( 'can be a simple param' , ( ) => {
3636 const matcher = new MatcherPatternPathCustomParams (
3737 / ^ \/ u s e r s \/ ( [ ^ / ] + ) \/ ( [ ^ / ] + ) $ / i,
38- { userId : { parser : PATH_PARAM_SINGLE_DEFAULT , repeat : true } } ,
38+ { userId : { ... PATH_PARAM_SINGLE_DEFAULT , repeat : true } } ,
3939 [ 'users' , 0 ]
4040 )
4141 expectTypeOf ( matcher . match ( '/users/123/456' ) ) . toEqualTypeOf < {
@@ -55,7 +55,7 @@ describe('MatcherPatternPathCustomParams', () => {
5555 / ^ \/ p r o f i l e s \/ ( [ ^ / ] + ) $ / i,
5656 {
5757 userId : {
58- parser : PARAM_INTEGER ,
58+ ... PARAM_INTEGER_SINGLE ,
5959 // parser: PATH_PARAM_DEFAULT_PARSER,
6060 } ,
6161 } ,
0 commit comments