Socket
Socket
Sign inDemoInstall

@shopify/react-cookie

Package Overview
Dependencies
Maintainers
24
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/react-cookie - npm Package Compare versions

Comparing version 2.0.16 to 2.0.17

8

build/cjs/BrowserCookieManager.js

@@ -16,3 +16,2 @@ 'use strict';

}
getCookies() {

@@ -22,3 +21,2 @@ const cookies = this.parse(document.cookie || '');

}
setCookie(name, value) {

@@ -34,3 +32,2 @@ const fullCookie = typeof value === 'string' ? {

}
removeCookie(name) {

@@ -41,6 +38,6 @@ document.cookie = cookie__default["default"].serialize(name, '', {

}
parse(cookies) {
const parsedCookies = cookie__default["default"].parse(cookies);
return Object.entries(parsedCookies).reduce((newCookies, [key, value]) => ({ ...newCookies,
return Object.entries(parsedCookies).reduce((newCookies, [key, value]) => ({
...newCookies,
[key]: {

@@ -51,5 +48,4 @@ value

}
}
exports.BrowserCookieManager = BrowserCookieManager;

@@ -26,7 +26,5 @@ 'use strict';

}
if (manager == null) {
throw new Error(NO_MANAGER_ERROR);
}
return manager.cookies;

@@ -33,0 +31,0 @@ }).current;

@@ -11,7 +11,5 @@ 'use strict';

const manager = React.useContext(context.CookieContext);
if (!manager) {
throw new Error(NO_MANAGER_ERROR);
}
const [cookie, setCookieValue] = React.useState(() => manager === null || manager === void 0 ? void 0 : manager.getCookie(key));

@@ -24,3 +22,2 @@ const setCookie = React.useCallback((value, options) => {

}
setCookieValue(value);

@@ -27,0 +24,0 @@ manager.setCookie(key, {

@@ -10,7 +10,5 @@ 'use strict';

const allCookies = cookies.getCookies();
for (const key of Object.keys(allCookies)) {
cookies.removeCookie(key);
}
return cookies;

@@ -20,7 +18,5 @@ }

const cookies = new BrowserCookieManager.BrowserCookieManager();
for (const [key, value] of Object.entries(initialCookies)) {
cookies.setCookie(key, value);
}
return cookies;

@@ -27,0 +23,0 @@ }

{
"name": "@shopify/react-cookie",
"version": "2.0.16",
"version": "2.0.17",
"license": "MIT",

@@ -27,4 +27,4 @@ "description": "Cookies in React for the server and client",

"dependencies": {
"@shopify/react-hooks": "^3.1.0",
"@shopify/react-network": "^5.0.16",
"@shopify/react-hooks": "^3.1.1",
"@shopify/react-network": "^5.0.17",
"cookie": "^0.4.0"

@@ -31,0 +31,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc