src/Core/Loaders/CommandLoader.js
/**
     * Load one command instance in the module.
     * Validate and correct the command before registering it.
     *
     * @param {Command} command - The command to load
     * @param {CommandRegistry} parent - The registry to load the command into
     * @returns {Boolean}
     * @memberof CommandLoader
     */
Load one command instance in the module.
Validate and correct the command before registering it.

@param {Command} command - The command to load
@param {CommandRegistry} parent - The registry to load the command into
@returns {Boolean}
@memberof CommandLoader
Load one command instance in the module . Validate and correct the command before registering it . @param { Command } command - The command to load @param { CommandRegistry } parent - The registry to load the command into @returns { Boolean } @memberof CommandLoader
load(command, registry) {
        if (!(command instanceof Command) ) {
            throw new AxonError(`[${command.toString()}] Not a Command!`, 'COMMAND-LOADER', this._module.label);
        }
        if (command.label.includes(' ') ) {
            throw new AxonError(`[${command.label}] Command label may not have spaces!`, 'COMMAND-LOADER', this._module.label);
        }
        if (!Validator.validCommand(command) ) {
            throw new AxonError(`[${command.label}] Invalid Command (enable debugMode)!`, 'COMMAND-LOADER', this._module.label);
        }
        this.registerCommand(command, registry);
        return true;
    }
load ( command , registry ) { if ( ! ( command instanceof Command ) ) { throw new AxonError ( ` ${ command . toString ( ) } ` , 'COMMAND-LOADER' , this . _module . label ) ; } if ( command . label . includes ( ' ' ) ) { throw new AxonError ( ` ${ command . label } ` , 'COMMAND-LOADER' , this . _module . label ) ; } if ( ! Validator . validCommand ( command ) ) { throw new AxonError ( ` ${ command . label } ` , 'COMMAND-LOADER' , this . _module . label ) ; } this . registerCommand ( command , registry ) ; return true ; }
Load one command instance in the module.
Load one command instance in the module .