File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -1727,7 +1727,7 @@ export type MergeElysiaInstances<
17271727 Routes &
17281728 ( Prefix extends ``
17291729 ? Current [ '~Routes' ]
1730- : AddPrefix < Prefix , Current [ '~Routes' ] > )
1730+ : CreateEden < Prefix , Current [ '~Routes' ] > )
17311731 >
17321732 : Elysia <
17331733 Prefix ,
Original file line number Diff line number Diff line change @@ -959,6 +959,33 @@ app.group(
959959 } > ( )
960960}
961961
962+ // ? Inherits plugin instance prefix path
963+ {
964+ const pluginPrefixApp = new Elysia ( { prefix : '/app' } ) . get ( '/test' , ( ) => 'hello' )
965+
966+ const appWithArrayOfPlugin = new Elysia ( { prefix : '/api' } ) . use ( [ pluginPrefixApp ] )
967+ const appWithPlugin = new Elysia ( { prefix : '/api' } ) . use ( pluginPrefixApp )
968+
969+ expectTypeOf < typeof appWithArrayOfPlugin [ '~Routes' ] > ( ) . toEqualTypeOf < {
970+ api : {
971+ app : {
972+ test : {
973+ get : {
974+ body : unknown
975+ headers : unknown
976+ query : unknown
977+ params : Record < never , string >
978+ response : {
979+ 200 : string
980+ }
981+ }
982+ }
983+ } ,
984+ }
985+ } > ( )
986+ expectTypeOf < typeof appWithArrayOfPlugin [ '~Routes' ] > ( ) . toEqualTypeOf < typeof appWithPlugin [ '~Routes' ] > ( )
987+ }
988+
962989// ? Inlining function callback don't repeat prefix
963990{
964991 const test = ( app : Elysia ) =>
You can’t perform that action at this time.
0 commit comments