src/Core/Stores/CommandRegistry.js
/**
     * Register a Command inside the CommandRegistry
     *
     * @param {String} label - The command label
     * @param {Command} command - The command object
     * @memberof CommandRegistry
     */
Register a Command inside the CommandRegistry
@param {String} label - The command label
@param {Command} command - The command object
@memberof CommandRegistry
Register a Command inside the CommandRegistry @param { String } label - The command label @param { Command } command - The command object @memberof CommandRegistry
register(label, command) {
        if (this.registry.has(label) ) {
            throw new AxonError(`Register [${label}]: Already registered!`, 'COMMAND-REGISTRY', command.module.label);
        }
        this.add(label, command);
        for (const alias of command.aliases) {
            if (this.aliases.has(alias) ) {
                this.axon.logger.error(new AxonError(`Register [${label}] (Alias - ${alias}): Already registered!`, 'COMMAND-REGISTRY', command.module.label) );
            } else {
                this.aliases.set(alias, label);
            }
        }
        this.axon.logger.info(command.hasSubcmd
            ? `[CMD] => Registered: [${command.module.label}(${command.label})] | SubCommands loaded -${command.subCommands.size}-`
            : `[CMD] => Registered: [${command.module.label}(${command.label})]`);
    }
register ( label , command ) { if ( this . registry . has ( label ) ) { throw new AxonError ( ` ${ label } ` , 'COMMAND-REGISTRY' , command . module . label ) ; } this . add ( label , command ) ; for ( const alias of command . aliases ) { if ( this . aliases . has ( alias ) ) { this . axon . logger . error ( new AxonError ( ` ${ label } ${ alias } ` , 'COMMAND-REGISTRY' , command . module . label ) ) ; } else { this . aliases . set ( alias , label ) ; } } this . axon . logger . info ( command . hasSubcmd ? ` ${ command . module . label } ${ command . label } ${ command . subCommands . size } ` : ` ${ command . module . label } ${ command . label } ` ) ; }
Register a Command inside the CommandRegistry
 @param {String} label - The command label
 @param {Command} command - The command object
 @memberof CommandRegistry
Register a Command inside the CommandRegistry @param { String } label - The command label @param { Command } command - The command object @memberof CommandRegistry