lib/api/communication.js
function CommunicationApi(constructorOptions) {

    LOG.debug('Instantiating communication API');
    LOG.debug('Validating constructor options');

    // Sanitize option eventually throwing an InvalidOption

    try {

        this.options =
            new communicationOptions.Constructor().validate(constructorOptions);

    } catch (err) {

        throw(
            err
        );

    }

    if (this.options.token !== '') {

        LOG.debug('Setting predefined token');

        this.token = this.options.token;

    } else {

        this.token = null;

    }

}
function CommunicationApi(constructorOptions) {

    LOG.debug('Instantiating communication API');
    LOG.debug('Validating constructor options');

    // Sanitize option eventually throwing an InvalidOption

    try {

        this.options =
            new communicationOptions.Constructor().validate(constructorOptions);

    } catch (err) {

        throw(
            err
        );

    }

    if (this.options.token !== '') {

        LOG.debug('Setting predefined token');

        this.token = this.options.token;

    } else {

        this.token = null;

    }

}
function CommunicationApi ( constructorOptions ) { LOG . debug ( 'Instantiating communication API' ) ; LOG . debug ( 'Validating constructor options' ) ; // Sanitize option eventually throwing an InvalidOption try { this . options = new communicationOptions . Constructor ( ) . validate ( constructorOptions ) ; } catch ( err ) { throw ( err ) ; } if ( this . options . token !== '' ) { LOG . debug ( 'Setting predefined token' ) ; this . token = this . options . token ; } else { this . token = null ; } }
Communications-Handling API

@param {CommunicationConstructorOptions} constructorOptions
Options for constructor
@constructor
@throws {InvalidOptionError}
Communications - Handling API