register( name, adapter ) {
    /* Check that name and adapter class were provided */
    if ( !name || name.trim() === '' ) {
      throw new EventSourceException( 'A valid name must be provided when registering an adapter' );
    }

    if ( !adapter ) {
      throw new EventSourceException( 'A valid event source adapter class must be provided' );
    }

    /* Register the adapter under the provided name */
    this.adapters[name] = adapter;

    /* Log that we have registered the adapter */
    this.log.debug( `Registered ${adapter.constructor.name} as ${name}` );
  }
/* Registers a new adapter with the provided name and adapter class */
Registers a new adapter with the provided name and adapter class
Registers a new adapter with the provided name and adapter class
register( name, adapter ) {
    if ( !name || name.trim() === '' ) {
      throw new EventSourceException( 'A valid name must be provided when registering an adapter' );
    }
    if ( !adapter ) {
      throw new EventSourceException( 'A valid event source adapter class must be provided' );
    }
    this.adapters[name] = adapter;
    this.log.debug( `Registered ${adapter.constructor.name} as ${name}` );
  }
register ( name , adapter ) { if ( ! name || name . trim ( ) === '' ) { throw new EventSourceException ( 'A valid name must be provided when registering an adapter' ) ; } if ( ! adapter ) { throw new EventSourceException ( 'A valid event source adapter class must be provided' ) ; } this . adapters [ name ] = adapter ; this . log . debug ( ` ${ adapter . constructor . name } ${ name } ` ) ; }
Registers a new adapter with the provided name and adapter class
Registers a new adapter with the provided name and adapter class
/* Check that name and adapter class were provided */ /* Register the adapter under the provided name */ /* Log that we have registered the adapter */