From 484bcbb5987565e1814555e2724fa25f3808a47f Mon Sep 17 00:00:00 2001 From: WoLfulus Date: Tue, 13 Oct 2020 20:14:51 -0300 Subject: [PATCH] Fix default extension function --- api/src/extensions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/extensions.ts b/api/src/extensions.ts index b0dd6a1deb..8b31d8326b 100644 --- a/api/src/extensions.ts +++ b/api/src/extensions.ts @@ -80,7 +80,7 @@ function registerHooks(hooks: string[]) { const hookPath = path.resolve(extensionsPath, 'hooks', hook, 'index.js'); const hookInstance: HookRegisterFunction | { default?: HookRegisterFunction } = require(hookPath); - let register: HookRegisterFunction = () => ({}); + let register: HookRegisterFunction = hookInstance as HookRegisterFunction; if (typeof hookInstance !== "function") { if (hookInstance.default) { register = hookInstance.default; @@ -110,7 +110,7 @@ function registerEndpoints(endpoints: string[], router: Router) { const endpointPath = path.resolve(extensionsPath, 'endpoints', endpoint, 'index.js'); const endpointInstance: EndpointRegisterFunction | { default?: EndpointRegisterFunction } = require(endpointPath); - let register: EndpointRegisterFunction = () => ({}); + let register: EndpointRegisterFunction = endpointInstance as EndpointRegisterFunction; if (typeof endpointInstance !== "function") { if (endpointInstance.default) { register = endpointInstance.default;