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

react-cookie

Package Overview
Dependencies
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-cookie - npm Package Compare versions

Comparing version 3.0.2 to 3.0.3

3

cjs/Cookies.js

@@ -13,2 +13,3 @@ "use strict";

var _default = _universalCookie.default;
exports.default = _default;
exports.default = _default;
module.exports = exports["default"];

@@ -71,2 +71,3 @@ "use strict";

var _default = CookiesProvider;
exports.default = _default;
exports.default = _default;
module.exports = exports["default"];

@@ -10,4 +10,2 @@ "use strict";

var hoistStatics = _interopRequireWildcard(require("hoist-non-react-statics"));
var _CookiesContext = require("./CookiesContext");

@@ -72,2 +70,5 @@

// Only way to make function modules work with both TypeScript and Rollup
var hoistStatics = require('hoist-non-react-statics');
function withCookies(WrapperComponent) {

@@ -143,2 +144,4 @@ // @ts-ignore

});
}
}
module.exports = exports["default"];

@@ -35,5 +35,5 @@ var __extends = (this && this.__extends) || (function () {

import * as React from 'react';
// @ts-ignore
import * as hoistStatics from 'hoist-non-react-statics';
import { Consumer } from './CookiesContext';
// Only way to make function modules work with both TypeScript and Rollup
var hoistStatics = require('hoist-non-react-statics');
export default function withCookies(WrapperComponent) {

@@ -40,0 +40,0 @@ // @ts-ignore

@@ -13,2 +13,3 @@ "use strict";

var _default = _universalCookie.default;
exports.default = _default;
exports.default = _default;
module.exports = exports["default"];

@@ -71,2 +71,3 @@ "use strict";

var _default = CookiesProvider;
exports.default = _default;
exports.default = _default;
module.exports = exports["default"];

@@ -10,4 +10,2 @@ "use strict";

var hoistStatics = _interopRequireWildcard(require("hoist-non-react-statics"));
var _CookiesContext = require("./CookiesContext");

@@ -72,2 +70,5 @@

// Only way to make function modules work with both TypeScript and Rollup
var hoistStatics = require('hoist-non-react-statics');
function withCookies(WrapperComponent) {

@@ -143,2 +144,4 @@ // @ts-ignore

});
}
}
module.exports = exports["default"];
{
"name": "react-cookie",
"version": "3.0.2",
"version": "3.0.3",
"description": "Universal cookies for React",

@@ -39,3 +39,3 @@ "main": "cjs/index.js",

"hoist-non-react-statics": "^3.0.0",
"universal-cookie": "^3.0.1"
"universal-cookie": "^3.0.3"
},

@@ -53,3 +53,3 @@ "devDependencies": {

},
"gitHead": "da261ca38c00b03c36fd8acedda450c7e8435b29"
"gitHead": "1890e812e41ced578abd5403bfc7607895826172"
}

@@ -31,2 +31,3 @@ (function (global, factory) {

exports.default = _default;
module.exports = exports["default"];
});

@@ -134,2 +135,3 @@

exports.default = _default;
module.exports = exports["default"];
});

@@ -412,6 +414,4 @@

var hoistStatics = _interopRequireWildcard(hoistNonReactStatics_cjs);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }

@@ -474,2 +474,5 @@

// Only way to make function modules work with both TypeScript and Rollup
function withCookies(WrapperComponent) {

@@ -542,6 +545,8 @@ // @ts-ignore

});
return hoistStatics(CookieWrapperWithRef, WrapperComponent, {
return hoistNonReactStatics_cjs(CookieWrapperWithRef, WrapperComponent, {
WrappedComponent: true
});
}
module.exports = exports["default"];
});

@@ -548,0 +553,0 @@

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("universal-cookie"),require("react")):"function"==typeof define&&define.amd?define(["universal-cookie","react"],t):e.ReactCookie=t(e.UniversalCookie,e.React)}(this,function(c,s){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t(e,t){return e(t={exports:{}},t.exports),t.exports}c=c&&c.hasOwnProperty("default")?c.default:c,s=s&&s.hasOwnProperty("default")?s.default:s;var f=t(function(e,t){var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=((r=c)&&r.__esModule?r:{default:r}).default;t.default=o});e(f);var l=t(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Consumer=t.Provider=void 0;var r,o,n=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var o=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};o.get||o.set?Object.defineProperty(t,r,o):t[r]=e[r]}return t.default=e,t}}(s),i=(r=c)&&r.__esModule?r:{default:r};var f=(o=n.createContext(new i.default)).Provider,a=o.Consumer;t.Consumer=a,t.Provider=f});e(l);l.Consumer,l.Provider;var a=t(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var o=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};o.get||o.set?Object.defineProperty(t,r,o):t[r]=e[r]}return t.default=e,t}}(s),n=(r=c)&&r.__esModule?r:{default:r};var i,f=(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=function(r){function e(e){var t=r.call(this,e)||this;return e.cookies?t.cookies=e.cookies:t.cookies=new n.default,t}return f(e,r),e.prototype.render=function(){return o.createElement(l.Provider,{value:this.cookies},this.props.children)},e}(o.Component);t.default=a});e(a);var r=t(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,n=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,f=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,u=r?Symbol.for("react.context"):60110,s=r?Symbol.for("react.async_mode"):60111,l=r?Symbol.for("react.forward_ref"):60112,p=r?Symbol.for("react.timeout"):60113;function d(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case s:case i:case a:case f:return e;default:switch(e=e&&e.$$typeof){case u:case l:case c:return e;default:return t}}case n:return t}}}t.typeOf=d,t.AsyncMode=s,t.ContextConsumer=u,t.ContextProvider=c,t.Element=o,t.ForwardRef=l,t.Fragment=i,t.Profiler=a,t.Portal=n,t.StrictMode=f,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===s||e===a||e===f||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===c||e.$$typeof===u||e.$$typeof===l)},t.isAsyncMode=function(e){return d(e)===s},t.isContextConsumer=function(e){return d(e)===u},t.isContextProvider=function(e){return d(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return d(e)===l},t.isFragment=function(e){return d(e)===i},t.isProfiler=function(e){return d(e)===a},t.isPortal=function(e){return d(e)===n},t.isStrictMode=function(e){return d(e)===f}});e(r);r.typeOf,r.AsyncMode,r.ContextConsumer,r.ContextProvider,r.Element,r.ForwardRef,r.Fragment,r.Profiler,r.Portal,r.StrictMode,r.isValidElementType,r.isAsyncMode,r.isContextConsumer,r.isContextProvider,r.isElement,r.isForwardRef,r.isFragment,r.isProfiler,r.isPortal,r.isStrictMode;var o=t(function(e,t){});e(o);o.typeOf,o.AsyncMode,o.ContextConsumer,o.ContextProvider,o.Element,o.ForwardRef,o.Fragment,o.Profiler,o.Portal,o.StrictMode,o.isValidElementType,o.isAsyncMode,o.isContextConsumer,o.isContextProvider,o.isElement,o.isForwardRef,o.isFragment,o.isProfiler,o.isPortal,o.isStrictMode;var n,i=t(function(e){e.exports=r});function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var p={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},d={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},y=u({},i.ForwardRef,(u(n={},"$$typeof",!0),u(n,"render",!0),n)),v=Object.defineProperty,m=Object.getOwnPropertyNames,O=Object.getOwnPropertySymbols,P=Object.getOwnPropertyDescriptor,b=Object.getPrototypeOf,h=Object.prototype;var _=function e(t,r,o){if("string"!=typeof r){if(h){var n=b(r);n&&n!==h&&e(t,n,o)}var i=m(r);O&&(i=i.concat(O(r)));for(var f=y[t.$$typeof]||p,a=y[r.$$typeof]||p,c=0;c<i.length;++c){var u=i[c];if(!(d[u]||o&&o[u]||a&&a[u]||f&&f[u])){var s=P(r,u);try{v(t,u,s)}catch(e){}}}return t}return t},j=t(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(f){var r=f.displayName||f.name,o=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.onChange=function(){e.forceUpdate()},e}return i(e,t),e.prototype.listen=function(e){e!==this.cookies&&(this.unlisten(),this.cookies=e,this.cookies.addChangeListener(this.onChange))},e.prototype.unlisten=function(){this.cookies&&this.cookies.removeChangeListener(this.onChange)},e.prototype.componentWillUnmount=function(){this.unlisten()},e.prototype.render=function(){var i=this;return a.createElement(l.Consumer,null,function(e){i.listen(e);var t=i.props,r=t.forwardedRef,o=u(t,["forwardedRef"]),n=e.getAll();return a.createElement(f,c({},o,{ref:r,cookies:e,allCookies:n}))})},e.displayName="withCookies("+r+")",e.WrapperComponent=f,e}(a.Component),e=a.forwardRef(function(e,t){return a.createElement(o,c({},e,{forwardedRef:t}))});return n(e,f,{WrappedComponent:!0})};var a=r(s),n=r(_);function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var o=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};o.get||o.set?Object.defineProperty(t,r,o):t[r]=e[r]}return t.default=e,t}var o,i=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),c=function(){return(c=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},u=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&(r[o[n]]=e[o[n]])}return r}});return e(j),e(t(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Cookies",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"CookiesProvider",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"withCookies",{enumerable:!0,get:function(){return n.default}});var r=i(f),o=i(a),n=i(j);function i(e){return e&&e.__esModule?e:{default:e}}}))});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("universal-cookie"),require("react")):"function"==typeof define&&define.amd?define(["universal-cookie","react"],t):e.ReactCookie=t(e.UniversalCookie,e.React)}(this,function(u,s){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t(e,t){return e(t={exports:{}},t.exports),t.exports}u=u&&u.hasOwnProperty("default")?u.default:u,s=s&&s.hasOwnProperty("default")?s.default:s;var f=t(function(e,t){var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=((r=u)&&r.__esModule?r:{default:r}).default;t.default=o,e.exports=t.default});e(f);var l=t(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Consumer=t.Provider=void 0;var r,o,n=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var o=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};o.get||o.set?Object.defineProperty(t,r,o):t[r]=e[r]}return t.default=e,t}}(s),i=(r=u)&&r.__esModule?r:{default:r};var f=(o=n.createContext(new i.default)).Provider,a=o.Consumer;t.Consumer=a,t.Provider=f});e(l);l.Consumer,l.Provider;var a=t(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var o=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};o.get||o.set?Object.defineProperty(t,r,o):t[r]=e[r]}return t.default=e,t}}(s),n=(r=u)&&r.__esModule?r:{default:r};var i,f=(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=function(r){function e(e){var t=r.call(this,e)||this;return e.cookies?t.cookies=e.cookies:t.cookies=new n.default,t}return f(e,r),e.prototype.render=function(){return o.createElement(l.Provider,{value:this.cookies},this.props.children)},e}(o.Component);t.default=a,e.exports=t.default});e(a);var r=t(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,n=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,f=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,s=r?Symbol.for("react.async_mode"):60111,l=r?Symbol.for("react.forward_ref"):60112,p=r?Symbol.for("react.timeout"):60113;function d(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case s:case i:case a:case f:return e;default:switch(e=e&&e.$$typeof){case c:case l:case u:return e;default:return t}}case n:return t}}}t.typeOf=d,t.AsyncMode=s,t.ContextConsumer=c,t.ContextProvider=u,t.Element=o,t.ForwardRef=l,t.Fragment=i,t.Profiler=a,t.Portal=n,t.StrictMode=f,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===s||e===a||e===f||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===u||e.$$typeof===c||e.$$typeof===l)},t.isAsyncMode=function(e){return d(e)===s},t.isContextConsumer=function(e){return d(e)===c},t.isContextProvider=function(e){return d(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return d(e)===l},t.isFragment=function(e){return d(e)===i},t.isProfiler=function(e){return d(e)===a},t.isPortal=function(e){return d(e)===n},t.isStrictMode=function(e){return d(e)===f}});e(r);r.typeOf,r.AsyncMode,r.ContextConsumer,r.ContextProvider,r.Element,r.ForwardRef,r.Fragment,r.Profiler,r.Portal,r.StrictMode,r.isValidElementType,r.isAsyncMode,r.isContextConsumer,r.isContextProvider,r.isElement,r.isForwardRef,r.isFragment,r.isProfiler,r.isPortal,r.isStrictMode;var o=t(function(e,t){});e(o);o.typeOf,o.AsyncMode,o.ContextConsumer,o.ContextProvider,o.Element,o.ForwardRef,o.Fragment,o.Profiler,o.Portal,o.StrictMode,o.isValidElementType,o.isAsyncMode,o.isContextConsumer,o.isContextProvider,o.isElement,o.isForwardRef,o.isFragment,o.isProfiler,o.isPortal,o.isStrictMode;var n,i=t(function(e){e.exports=r});function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var p={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},d={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},y=c({},i.ForwardRef,(c(n={},"$$typeof",!0),c(n,"render",!0),n)),v=Object.defineProperty,m=Object.getOwnPropertyNames,O=Object.getOwnPropertySymbols,P=Object.getOwnPropertyDescriptor,b=Object.getPrototypeOf,h=Object.prototype;var _=function e(t,r,o){if("string"!=typeof r){if(h){var n=b(r);n&&n!==h&&e(t,n,o)}var i=m(r);O&&(i=i.concat(O(r)));for(var f=y[t.$$typeof]||p,a=y[r.$$typeof]||p,u=0;u<i.length;++u){var c=i[u];if(!(d[c]||o&&o[c]||a&&a[c]||f&&f[c])){var s=P(r,c);try{v(t,c,s)}catch(e){}}}return t}return t},j=t(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(f){var r=f.displayName||f.name,o=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.onChange=function(){e.forceUpdate()},e}return n(e,t),e.prototype.listen=function(e){e!==this.cookies&&(this.unlisten(),this.cookies=e,this.cookies.addChangeListener(this.onChange))},e.prototype.unlisten=function(){this.cookies&&this.cookies.removeChangeListener(this.onChange)},e.prototype.componentWillUnmount=function(){this.unlisten()},e.prototype.render=function(){var i=this;return a.createElement(l.Consumer,null,function(e){i.listen(e);var t=i.props,r=t.forwardedRef,o=c(t,["forwardedRef"]),n=e.getAll();return a.createElement(f,u({},o,{ref:r,cookies:e,allCookies:n}))})},e.displayName="withCookies("+r+")",e.WrapperComponent=f,e}(a.Component),e=a.forwardRef(function(e,t){return a.createElement(o,u({},e,{forwardedRef:t}))});return _(e,f,{WrappedComponent:!0})};var a=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var o=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};o.get||o.set?Object.defineProperty(t,r,o):t[r]=e[r]}return t.default=e,t}}(s);var o,n=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),u=function(){return(u=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},c=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&(r[o[n]]=e[o[n]])}return r};e.exports=t.default});return e(j),e(t(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Cookies",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"CookiesProvider",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"withCookies",{enumerable:!0,get:function(){return n.default}});var r=i(f),o=i(a),n=i(j);function i(e){return e&&e.__esModule?e:{default:e}}}))});
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