Skip to content

Commit

Permalink
refactor(remove.ts): rename DomCookieOptions to RemoveDomCookieOptions
Browse files Browse the repository at this point in the history
feat(cookie.ts): add RemoveDomCookieOptions type definition
  • Loading branch information
Bluzzi committed Apr 25, 2023
1 parent ec2ac51 commit 3a5634c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/dom/remove/remove.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { DomCookieOptions } from "#/typing/cookie";
import type { RemoveDomCookieOptions } from "#/typing/cookie";
import { serializeCookie } from "#/http/serializer";
import { CookieMaxAge } from "#/utils/duration";
import { isCookieEnabled } from "#/utils/cookie";

export function removeCookie(name: string, options?: Omit<DomCookieOptions, "maxAge">): void {
export function removeCookie(name: string, options?: RemoveDomCookieOptions): void {
isCookieEnabled();

document.cookie = serializeCookie(
Expand Down
4 changes: 3 additions & 1 deletion src/typing/cookie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ type CookieOptions = {
}

export type DomCookieOptions = Omit<CookieOptions, "httpOnly">;
export type HttpCookieOptions = CookieOptions;
export type HttpCookieOptions = CookieOptions;

export type RemoveDomCookieOptions = Pick<CookieOptions, "domain" | "path" | "sameSite">;

0 comments on commit 3a5634c

Please sign in to comment.