Skip to content

Commit

Permalink
fix: run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
J0 committed Sep 11, 2024
1 parent a3682e6 commit 9db53b5
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 @@ -52,7 +52,7 @@ export function createBrowserClient<
: string & keyof Database,
Schema extends GenericSchema = Database[SchemaName] extends GenericSchema
? Database[SchemaName]
: any
: any,
>(
supabaseUrl: string,
supabaseKey: string,
Expand All @@ -61,7 +61,7 @@ export function createBrowserClient<
cookieOptions?: CookieOptionsWithName;
cookieEncoding?: "raw" | "base64url";
isSingleton?: boolean;
}
},
): SupabaseClient<Database, SchemaName, Schema>;

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

export function createBrowserClient<
Expand All @@ -95,7 +95,7 @@ export function createBrowserClient<
: string & keyof Database,
Schema extends GenericSchema = Database[SchemaName] extends GenericSchema
? Database[SchemaName]
: any
: any,
>(
supabaseUrl: string,
supabaseKey: string,
Expand All @@ -104,7 +104,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 @@ -117,7 +117,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 @@ -126,7 +126,7 @@ export function createBrowserClient<
...options,
cookieEncoding: options?.cookieEncoding ?? "base64url",
},
false
false,
);

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

if (shouldUseSingleton) {
Expand Down

0 comments on commit 9db53b5

Please sign in to comment.