When providing config like this:
{
apiKey: 'test-api-key',
cdnURL: 'https://www.test.com'
debug: !production
}
the cdnURL is left unused and segmentHost default value, cdn.segment.com is used instead.
I think it's because segmentHost is checked first and it has a default value so if unprovided it will still have a value and the if condition will always be true.
if (this._config.segmentHost) {
// Deprecated option
cdnUrl = 'https://' + this._config.segmentHost;
} else {
cdnUrl = this._config.cdnURL;
}