Socket
Socket
Sign inDemoInstall

storybook-addon-cookie

Package Overview
Dependencies
250
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.2 to 3.0.3

7

dist/utils.js

@@ -5,8 +5,7 @@ "use strict";

function setCookie(name, value) {
if (typeof value !== 'string') {
document.cookie = "".concat(name, "=").concat(JSON.stringify(value), ";");
if (typeof value === 'string') {
document.cookie = "".concat(name, "=").concat(value, ";");
}
else {
var encodedValue = encodeURIComponent(value);
document.cookie = "".concat(name, "=").concat(encodedValue, ";");
document.cookie = "".concat(name, "=").concat(JSON.stringify(value), ";");
}

@@ -13,0 +12,0 @@ }

{
"name": "storybook-addon-cookie",
"version": "3.0.2",
"version": "3.0.3",
"description": "Storybook addon for setting document.cookie",

@@ -48,3 +48,3 @@ "author": "hwookim <gusdn9754@gmail.com>",

},
"gitHead": "f3a6e4a91988097a98fda3886bbb9c0809ae8292"
"gitHead": "b3e039065748fb325a28f8f99f6dbe75d1e0a9f1"
}
import { Cookie } from './types';
export function setCookie(name: string, value: string) {
if (typeof value !== 'string') {
if (typeof value === 'string') {
document.cookie = `${name}=${value};`;
} else {
document.cookie = `${name}=${JSON.stringify(value)};`;
} else {
const encodedValue = encodeURIComponent(value);
document.cookie = `${name}=${encodedValue};`;
}

@@ -10,0 +9,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc