Skip to content

Commit

Permalink
fix: run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
J0 committed Nov 11, 2024
1 parent 6c4d333 commit 0baf24c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/createBrowserClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function createBrowserClient<
: string & keyof Database,
Schema extends GenericSchema = Database[SchemaName] extends GenericSchema
? Database[SchemaName]
: any
: any,
>(
supabaseUrl: string,
supabaseKey: string,
Expand All @@ -50,7 +50,7 @@ export function createBrowserClient<
cookieOptions?: CookieOptionsWithName;
cookieEncoding?: "raw" | "base64url";
isSingleton?: boolean;
}
},
): SupabaseClient<Database, SchemaName, Schema>;

/**
Expand All @@ -65,7 +65,7 @@ export function createBrowserClient<
: string & keyof Database,
Schema extends GenericSchema = Database[SchemaName] extends GenericSchema
? Database[SchemaName]
: any
: any,
>(
supabaseUrl: string,
supabaseKey: string,
Expand All @@ -74,7 +74,7 @@ export function createBrowserClient<
cookieOptions?: CookieOptionsWithName;
cookieEncoding?: "raw" | "base64url";
isSingleton?: boolean;
}
},
): SupabaseClient<Database, SchemaName, Schema>;

export function createBrowserClient<
Expand All @@ -84,7 +84,7 @@ export function createBrowserClient<
: string & keyof Database,
Schema extends GenericSchema = Database[SchemaName] extends GenericSchema
? Database[SchemaName]
: any
: any,
>(
supabaseUrl: string,
supabaseKey: string,
Expand All @@ -93,7 +93,7 @@ export function createBrowserClient<
cookieOptions?: CookieOptionsWithName;
cookieEncoding?: "raw" | "base64url";
isSingleton?: boolean;
}
},
): SupabaseClient<Database, SchemaName, Schema> {
// singleton client is created only if isSingleton is set to true, or if isSingleton is not defined and we detect a browser
const shouldUseSingleton =
Expand All @@ -106,7 +106,7 @@ export function createBrowserClient<

if (!supabaseUrl || !supabaseKey) {
throw new Error(
`@supabase/ssr: Your project's URL and API key are required to create a Supabase client!\n\nCheck your Supabase project's API settings to find these values\n\nhttps://supabase.com/dashboard/project/_/settings/api`
`@supabase/ssr: Your project's URL and API key are required to create a Supabase client!\n\nCheck your Supabase project's API settings to find these values\n\nhttps://supabase.com/dashboard/project/_/settings/api`,
);
}

Expand All @@ -115,7 +115,7 @@ export function createBrowserClient<
...options,
cookieEncoding: options?.cookieEncoding ?? "base64url",
},
false
false,
);

const storageKey = options?.auth?.storageKey || options?.cookieOptions?.name;
Expand All @@ -141,7 +141,7 @@ export function createBrowserClient<
persistSession: true,
storage,
},
}
},
);

if (shouldUseSingleton) {
Expand Down

0 comments on commit 0baf24c

Please sign in to comment.