Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
protected _setupTransport(): Transport {
if (!this._options.dsn) {
// We return the noop transport here in case there is no Dsn.
return new NoopTransport();
}
const transportOptions = {
...this._options.transportOptions,
dsn: this._options.dsn
};
if (this._options.transport) {
return new this._options.transport(transportOptions);
}
if (this._isNativeTransportAvailable()) {
return new NativeTransport();
}
return new Transports.FetchTransport(transportOptions);