Skip to content

Commit 64ff6b3

Browse files
authored
fix: cookies console warnings (#136)
1 parent 5eff4f6 commit 64ff6b3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/utils/helpers.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import type { SerializeOptions } from "cookie";
2-
import { parse as cookieParse, serialize as cookieSerialize } from "cookie";
2+
import * as cookie from "cookie";
33

44
/**
55
* @deprecated Since v0.4.0: Please use {@link parseCookieHeader}. `parse` will
66
* not be available for import starting v1.0.0 of `@supabase/ssr`.
77
*/
8-
export const parse = cookieParse;
8+
export const parse = cookie.parse;
99

1010
/**
1111
* @deprecated Since v0.4.0: Please use {@link serializeCookieHeader}.
1212
* `serialize` will not be available for import starting v1.0.0 of
1313
* `@supabase/ssr`.
1414
*/
15-
export const serialize = cookieSerialize;
15+
export const serialize = cookie.serialize;
1616

1717
/**
1818
* Parses the `Cookie` HTTP header into an array of cookie name-value objects.
@@ -23,7 +23,7 @@ export const serialize = cookieSerialize;
2323
export function parseCookieHeader(
2424
header: string,
2525
): { name: string; value?: string }[] {
26-
const parsed = cookieParse(header);
26+
const parsed = cookie.parse(header);
2727

2828
return Object.keys(parsed ?? {}).map((name) => ({
2929
name,
@@ -43,7 +43,7 @@ export function serializeCookieHeader(
4343
value: string,
4444
options: SerializeOptions,
4545
): string {
46-
return cookieSerialize(name, value, options);
46+
return cookie.serialize(name, value, options);
4747
}
4848

4949
export function isBrowser() {

0 commit comments

Comments
 (0)