Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@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 0.0.0-snapshot-20240308174203 to 0.0.0-snapshot-20240620045713

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": "0.0.0-snapshot-20240308174203",
"version": "0.0.0-snapshot-20240620045713",
"license": "MIT",

@@ -24,11 +24,11 @@ "description": "Cookies in React for the server and client",

"engines": {
"node": "^14.17.0 || >=16.0.0"
"node": ">=18.12.0"
},
"dependencies": {
"@shopify/react-hooks": "0.0.0-snapshot-20240308174203",
"@shopify/react-network": "0.0.0-snapshot-20240308174203",
"@shopify/react-hooks": "0.0.0-snapshot-20240620045713",
"@shopify/react-network": "0.0.0-snapshot-20240620045713",
"cookie": "^0.4.0"
},
"peerDependencies": {
"react": ">=16.8.0 <19.0.0",
"react": ">=18.0.0 <19.0.0",
"react-dom": ">=16.8.0 <19.0.0"

@@ -35,0 +35,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