File tree Expand file tree Collapse file tree 3 files changed +24
-3
lines changed Expand file tree Collapse file tree 3 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -370,4 +370,14 @@ function _start() {
370370 } ) ) ;
371371 return _start . apply ( this , arguments ) ;
372372}
373- var _default = exports [ "default" ] = fastifyInstance ;
373+ var instanceProxy = new Proxy ( { } , {
374+ get : function get ( target , prop ) {
375+ if ( ! fastifyInstance ) return undefined ;
376+ return fastifyInstance [ prop ] ;
377+ } ,
378+ apply : function apply ( target , thisArg , args ) {
379+ if ( ! fastifyInstance ) return undefined ;
380+ return Reflect . apply ( fastifyInstance , thisArg , args ) ;
381+ }
382+ } ) ;
383+ var _default = exports [ "default" ] = instanceProxy ;
Original file line number Diff line number Diff line change 11{
22 "name" : " fastify-app" ,
3- "version" : " 2.0.0 " ,
3+ "version" : " 2.0.1 " ,
44 "description" : " A simple fastify app template for JSON API server with helpful routes and initial settings." ,
55 "main" : " src/index.mjs" ,
66 "module" : " src/index.mjs" ,
Original file line number Diff line number Diff line change @@ -242,5 +242,16 @@ async function start() {
242242 } ) ;
243243}
244244
245- export default fastifyInstance ;
245+ const instanceProxy = new Proxy ( { } , {
246+ get ( target , prop ) {
247+ if ( ! fastifyInstance ) return undefined ;
248+ return fastifyInstance [ prop ] ;
249+ } ,
250+ apply ( target , thisArg , args ) {
251+ if ( ! fastifyInstance ) return undefined ;
252+ return Reflect . apply ( fastifyInstance , thisArg , args ) ;
253+ }
254+ } ) ;
255+
256+ export default instanceProxy ;
246257export { init , start , ApiError } ;
You can’t perform that action at this time.
0 commit comments