Skip to content

Commit

Permalink
feat: Remove encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
hwookim committed Oct 24, 2023
1 parent f3a6e4a commit 4b88761
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/addon/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Cookie } from './types';

export function setCookie(name: string, value: string) {
if (typeof value !== 'string') {
document.cookie = `${name}=${JSON.stringify(value)};`;
if (typeof value === 'string') {
document.cookie = `${name}=${value};`;
} else {
const encodedValue = encodeURIComponent(value);
document.cookie = `${name}=${encodedValue};`;
document.cookie = `${name}=${JSON.stringify(value)};`;
}
}

Expand Down

0 comments on commit 4b88761

Please sign in to comment.