Skip to content

Commit

Permalink
chore: assign default null values to optional alias arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
1abhishekpandey committed Dec 11, 2024
1 parent 668a9cd commit f5d4018
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libs/sdk/src/RudderClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ async function group(

async function alias(
newId: string,
previousIdOrOptions?: string | Record<string, unknown> | null,
options?: Record<string, unknown> | undefined | null,
previousIdOrOptions: string | Record<string, unknown> | null = null,
options: Record<string, unknown> | undefined | null = null,
): Promise<void> {
// Validate newId
if (!newId) {
Expand All @@ -234,7 +234,7 @@ async function alias(

// Handle cases based on the type of previousIdOrOptions
if (typeof previousIdOrOptions === 'string') {
return bridge.alias(newId, previousIdOrOptions, filterNaN(options ?? null));
return bridge.alias(newId, previousIdOrOptions, filterNaN(options));
}
if (
previousIdOrOptions &&
Expand All @@ -243,7 +243,7 @@ async function alias(
) {
return bridge.alias(newId, null, filterNaN(previousIdOrOptions));
}
return bridge.alias(newId, null, filterNaN(options ?? null));
return bridge.alias(newId, null, filterNaN(options));
}

async function putDeviceToken(token: string): Promise<void>;
Expand Down

0 comments on commit f5d4018

Please sign in to comment.