diff --git a/packages/core/src/shared/config.ts b/packages/core/src/shared/config.ts index c6090384..a9de6ce7 100644 --- a/packages/core/src/shared/config.ts +++ b/packages/core/src/shared/config.ts @@ -10,7 +10,7 @@ export const DEFAULT_CONFIG: SharedConfig = { error: "An error occurred.", notFound: "Command not found.", }, - constructCommand: (ctor) => { + construct: (ctor) => { const obj = setmetatable({}, ctor as never) as object; const result = (obj as { constructor(): unknown }).constructor(); assert( diff --git a/packages/core/src/shared/core/registry.ts b/packages/core/src/shared/core/registry.ts index 68cbb058..2373fc89 100644 --- a/packages/core/src/shared/core/registry.ts +++ b/packages/core/src/shared/core/registry.ts @@ -431,7 +431,7 @@ export abstract class BaseRegistry< MetadataKey.Guard, ) ?? []; - const instance = this.config.constructCommand(commandClass); + const instance = this.config.construct(commandClass); for (const property of DecoratorMetadata.getOwnProperties(commandClass)) { // Get decorator data const options = DecoratorMetadata.getOwnMetadata( diff --git a/packages/core/src/shared/types.ts b/packages/core/src/shared/types.ts index 830b8b63..37da040b 100644 --- a/packages/core/src/shared/types.ts +++ b/packages/core/src/shared/types.ts @@ -14,7 +14,7 @@ export interface SharedConfig { logLevel: CenturionLogLevel; guards: CommandGuard[]; messages: CommandMessages; - constructCommand: (ctor: new (...args: never[]) => object) => object; + construct: (ctor: new (...args: never[]) => object) => object; defaultContextState?: defined; }