Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/common/lib/util/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,21 @@ export function normaliseOptions(
MsgPack: MsgPack | null,
logger: Logger | null, // should only be omitted by tests
): NormalisedClientOptions {
checkIfClientOptionsAreValid(options);

const loggerToUse = logger ?? Logger.defaultLogger;

// Deprecated options
if (options.environment) {
loggerToUse.deprecated('The `environment` client option', 'Use the `endpoint` client option instead.');
}
if (options.restHost) {
loggerToUse.deprecated('The `restHost` client option', 'Use the `endpoint` client option instead.');
}
if (options.realtimeHost) {
loggerToUse.deprecated('The `realtimeHost` client option', 'Use the `endpoint` client option instead.');
}

checkIfClientOptionsAreValid(options);

if (typeof options.recover === 'function' && options.closeOnUnload === true) {
Logger.logAction(
loggerToUse,
Expand Down
Loading