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.6 to 3.0.7

8

cjs/types.d.ts

@@ -1,11 +0,5 @@

/// <reference types="react" />
import Cookies from 'universal-cookie';
import { Cookie } from 'universal-cookie';
export declare type ReactCookieProps = {
cookies: Cookies;
allCookies: {
[name: string]: Cookie;
};
cookies?: Cookies;
children?: any;
ref?: React.RefObject<{}>;
};

13

cjs/withCookies.d.ts

@@ -0,3 +1,12 @@

import Cookies, { Cookie } from 'universal-cookie';
import * as React from 'react';
import { ReactCookieProps } from './types';
export default function withCookies<T>(WrapperComponent: React.ComponentType<T & ReactCookieProps>): React.ComponentType<T>;
declare type WrapperProps = {
cookies: Cookies;
allCookies: {
[name: string]: Cookie;
};
children?: any;
ref?: React.RefObject<{}>;
};
export default function withCookies<T>(WrapperComponent: React.ComponentType<T & WrapperProps>): React.ComponentType<T>;
export {};

@@ -92,14 +92,18 @@ "use strict";

CookieWrapper.prototype.listen = function (cookies) {
if (cookies !== this.cookies) {
this.unlisten();
this.cookies = cookies;
this.cookies.addChangeListener(this.onChange);
}
CookieWrapper.prototype.listen = function () {
this.props.cookies.addChangeListener(this.onChange);
};
CookieWrapper.prototype.unlisten = function () {
if (this.cookies) {
this.cookies.removeChangeListener(this.onChange);
this.cookies = undefined;
CookieWrapper.prototype.unlisten = function (cookies) {
(cookies || this.props.cookies).removeChangeListener(this.onChange);
};
CookieWrapper.prototype.componentDidMount = function () {
this.listen();
};
CookieWrapper.prototype.componentDidUpdate = function (prevProps) {
if (prevProps.cookies !== this.props.cookies) {
this.unlisten(prevProps.cookies);
this.listen();
}

@@ -113,18 +117,13 @@ };

CookieWrapper.prototype.render = function () {
var _this = this;
var _a = this.props,
forwardedRef = _a.forwardedRef,
cookies = _a.cookies,
restProps = __rest(_a, ["forwardedRef", "cookies"]);
return React.createElement(_CookiesContext.Consumer, null, function (cookies) {
_this.listen(cookies);
var _a = _this.props,
forwardedRef = _a.forwardedRef,
restProps = __rest(_a, ["forwardedRef"]);
var allCookies = cookies.getAll();
return React.createElement(WrapperComponent, __assign({}, restProps, {
ref: forwardedRef,
cookies: cookies,
allCookies: allCookies
}));
});
var allCookies = cookies.getAll();
return React.createElement(WrapperComponent, __assign({}, restProps, {
ref: forwardedRef,
cookies: cookies,
allCookies: allCookies
}));
};

@@ -137,8 +136,12 @@

var CookieWrapperWithRef = React.forwardRef(function (props, ref) {
return React.createElement(CookieWrapper, __assign({}, props, {
forwardedRef: ref
}));
var CookieWrapperWithRefAndCookieConsumer = React.forwardRef(function (props, ref) {
return React.createElement(_CookiesContext.Consumer, null, function (cookies) {
return React.createElement(CookieWrapper, __assign({
cookies: cookies
}, props, {
forwardedRef: ref
}));
});
});
return hoistStatics(CookieWrapperWithRef, WrapperComponent, {
return hoistStatics(CookieWrapperWithRefAndCookieConsumer, WrapperComponent, {
WrappedComponent: true

@@ -145,0 +148,0 @@ });

@@ -30,3 +30,3 @@ var __extends = (this && this.__extends) || (function () {

CookiesProvider.prototype.render = function () {
return (React.createElement(Provider, { value: this.cookies }, this.props.children));
return React.createElement(Provider, { value: this.cookies }, this.props.children);
};

@@ -33,0 +33,0 @@ return CookiesProvider;

@@ -1,11 +0,5 @@

/// <reference types="react" />
import Cookies from 'universal-cookie';
import { Cookie } from 'universal-cookie';
export declare type ReactCookieProps = {
cookies: Cookies;
allCookies: {
[name: string]: Cookie;
};
cookies?: Cookies;
children?: any;
ref?: React.RefObject<{}>;
};

@@ -0,3 +1,12 @@

import Cookies, { Cookie } from 'universal-cookie';
import * as React from 'react';
import { ReactCookieProps } from './types';
export default function withCookies<T>(WrapperComponent: React.ComponentType<T & ReactCookieProps>): React.ComponentType<T>;
declare type WrapperProps = {
cookies: Cookies;
allCookies: {
[name: string]: Cookie;
};
children?: any;
ref?: React.RefObject<{}>;
};
export default function withCookies<T>(WrapperComponent: React.ComponentType<T & WrapperProps>): React.ComponentType<T>;
export {};

@@ -51,13 +51,15 @@ var __extends = (this && this.__extends) || (function () {

}
CookieWrapper.prototype.listen = function (cookies) {
if (cookies !== this.cookies) {
this.unlisten();
this.cookies = cookies;
this.cookies.addChangeListener(this.onChange);
}
CookieWrapper.prototype.listen = function () {
this.props.cookies.addChangeListener(this.onChange);
};
CookieWrapper.prototype.unlisten = function () {
if (this.cookies) {
this.cookies.removeChangeListener(this.onChange);
this.cookies = undefined;
CookieWrapper.prototype.unlisten = function (cookies) {
(cookies || this.props.cookies).removeChangeListener(this.onChange);
};
CookieWrapper.prototype.componentDidMount = function () {
this.listen();
};
CookieWrapper.prototype.componentDidUpdate = function (prevProps) {
if (prevProps.cookies !== this.props.cookies) {
this.unlisten(prevProps.cookies);
this.listen();
}

@@ -69,9 +71,5 @@ };

CookieWrapper.prototype.render = function () {
var _this = this;
return (React.createElement(Consumer, null, function (cookies) {
_this.listen(cookies);
var _a = _this.props, forwardedRef = _a.forwardedRef, restProps = __rest(_a, ["forwardedRef"]);
var allCookies = cookies.getAll();
return (React.createElement(WrapperComponent, __assign({}, restProps, { ref: forwardedRef, cookies: cookies, allCookies: allCookies })));
}));
var _a = this.props, forwardedRef = _a.forwardedRef, cookies = _a.cookies, restProps = __rest(_a, ["forwardedRef", "cookies"]);
var allCookies = cookies.getAll();
return (React.createElement(WrapperComponent, __assign({}, restProps, { ref: forwardedRef, cookies: cookies, allCookies: allCookies })));
};

@@ -82,6 +80,8 @@ CookieWrapper.displayName = "withCookies(" + name + ")";

}(React.Component));
var CookieWrapperWithRef = React.forwardRef(function (props, ref) {
return React.createElement(CookieWrapper, __assign({}, props, { forwardedRef: ref }));
var CookieWrapperWithRefAndCookieConsumer = React.forwardRef(function (props, ref) {
return (React.createElement(Consumer, null, function (cookies) { return (React.createElement(CookieWrapper, __assign({ cookies: cookies }, props, { forwardedRef: ref }))); }));
});
return hoistStatics(CookieWrapperWithRef, WrapperComponent, { WrappedComponent: true });
return hoistStatics(CookieWrapperWithRefAndCookieConsumer, WrapperComponent, {
WrappedComponent: true
});
}

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

export * from './es6';
export * from './es6';

@@ -1,11 +0,5 @@

/// <reference types="react" />
import Cookies from 'universal-cookie';
import { Cookie } from 'universal-cookie';
export declare type ReactCookieProps = {
cookies: Cookies;
allCookies: {
[name: string]: Cookie;
};
cookies?: Cookies;
children?: any;
ref?: React.RefObject<{}>;
};

@@ -0,3 +1,12 @@

import Cookies, { Cookie } from 'universal-cookie';
import * as React from 'react';
import { ReactCookieProps } from './types';
export default function withCookies<T>(WrapperComponent: React.ComponentType<T & ReactCookieProps>): React.ComponentType<T>;
declare type WrapperProps = {
cookies: Cookies;
allCookies: {
[name: string]: Cookie;
};
children?: any;
ref?: React.RefObject<{}>;
};
export default function withCookies<T>(WrapperComponent: React.ComponentType<T & WrapperProps>): React.ComponentType<T>;
export {};

@@ -92,14 +92,18 @@ "use strict";

CookieWrapper.prototype.listen = function (cookies) {
if (cookies !== this.cookies) {
this.unlisten();
this.cookies = cookies;
this.cookies.addChangeListener(this.onChange);
}
CookieWrapper.prototype.listen = function () {
this.props.cookies.addChangeListener(this.onChange);
};
CookieWrapper.prototype.unlisten = function () {
if (this.cookies) {
this.cookies.removeChangeListener(this.onChange);
this.cookies = undefined;
CookieWrapper.prototype.unlisten = function (cookies) {
(cookies || this.props.cookies).removeChangeListener(this.onChange);
};
CookieWrapper.prototype.componentDidMount = function () {
this.listen();
};
CookieWrapper.prototype.componentDidUpdate = function (prevProps) {
if (prevProps.cookies !== this.props.cookies) {
this.unlisten(prevProps.cookies);
this.listen();
}

@@ -113,18 +117,13 @@ };

CookieWrapper.prototype.render = function () {
var _this = this;
var _a = this.props,
forwardedRef = _a.forwardedRef,
cookies = _a.cookies,
restProps = __rest(_a, ["forwardedRef", "cookies"]);
return React.createElement(_CookiesContext.Consumer, null, function (cookies) {
_this.listen(cookies);
var _a = _this.props,
forwardedRef = _a.forwardedRef,
restProps = __rest(_a, ["forwardedRef"]);
var allCookies = cookies.getAll();
return React.createElement(WrapperComponent, __assign({}, restProps, {
ref: forwardedRef,
cookies: cookies,
allCookies: allCookies
}));
});
var allCookies = cookies.getAll();
return React.createElement(WrapperComponent, __assign({}, restProps, {
ref: forwardedRef,
cookies: cookies,
allCookies: allCookies
}));
};

@@ -137,8 +136,12 @@

var CookieWrapperWithRef = React.forwardRef(function (props, ref) {
return React.createElement(CookieWrapper, __assign({}, props, {
forwardedRef: ref
}));
var CookieWrapperWithRefAndCookieConsumer = React.forwardRef(function (props, ref) {
return React.createElement(_CookiesContext.Consumer, null, function (cookies) {
return React.createElement(CookieWrapper, __assign({
cookies: cookies
}, props, {
forwardedRef: ref
}));
});
});
return hoistStatics(CookieWrapperWithRef, WrapperComponent, {
return hoistStatics(CookieWrapperWithRefAndCookieConsumer, WrapperComponent, {
WrappedComponent: true

@@ -145,0 +148,0 @@ });

{
"name": "react-cookie",
"version": "3.0.6",
"version": "3.0.7",
"description": "Universal cookies for React",

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

"hoist-non-react-statics": "^3.0.0",
"universal-cookie": "^3.0.6"
"universal-cookie": "^3.0.7"
},

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

},
"gitHead": "1e5d93d5ab8b6e374b8936cd136ce8312952e2cf"
"gitHead": "2b6dbedee459d318bf7b4616d024a0deee4a2c2f"
}

@@ -494,14 +494,18 @@ (function (global, factory) {

CookieWrapper.prototype.listen = function (cookies) {
if (cookies !== this.cookies) {
this.unlisten();
this.cookies = cookies;
this.cookies.addChangeListener(this.onChange);
}
CookieWrapper.prototype.listen = function () {
this.props.cookies.addChangeListener(this.onChange);
};
CookieWrapper.prototype.unlisten = function () {
if (this.cookies) {
this.cookies.removeChangeListener(this.onChange);
this.cookies = undefined;
CookieWrapper.prototype.unlisten = function (cookies) {
(cookies || this.props.cookies).removeChangeListener(this.onChange);
};
CookieWrapper.prototype.componentDidMount = function () {
this.listen();
};
CookieWrapper.prototype.componentDidUpdate = function (prevProps) {
if (prevProps.cookies !== this.props.cookies) {
this.unlisten(prevProps.cookies);
this.listen();
}

@@ -515,18 +519,13 @@ };

CookieWrapper.prototype.render = function () {
var _this = this;
var _a = this.props,
forwardedRef = _a.forwardedRef,
cookies = _a.cookies,
restProps = __rest(_a, ["forwardedRef", "cookies"]);
return React.createElement(CookiesContext.Consumer, null, function (cookies) {
_this.listen(cookies);
var _a = _this.props,
forwardedRef = _a.forwardedRef,
restProps = __rest(_a, ["forwardedRef"]);
var allCookies = cookies.getAll();
return React.createElement(WrapperComponent, __assign({}, restProps, {
ref: forwardedRef,
cookies: cookies,
allCookies: allCookies
}));
});
var allCookies = cookies.getAll();
return React.createElement(WrapperComponent, __assign({}, restProps, {
ref: forwardedRef,
cookies: cookies,
allCookies: allCookies
}));
};

@@ -539,8 +538,12 @@

var CookieWrapperWithRef = React.forwardRef(function (props, ref) {
return React.createElement(CookieWrapper, __assign({}, props, {
forwardedRef: ref
}));
var CookieWrapperWithRefAndCookieConsumer = React.forwardRef(function (props, ref) {
return React.createElement(CookiesContext.Consumer, null, function (cookies) {
return React.createElement(CookieWrapper, __assign({
cookies: cookies
}, props, {
forwardedRef: ref
}));
});
});
return hoistNonReactStatics_cjs(CookieWrapperWithRef, WrapperComponent, {
return hoistNonReactStatics_cjs(CookieWrapperWithRefAndCookieConsumer, WrapperComponent, {
WrappedComponent: true

@@ -547,0 +550,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.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=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.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,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 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),this.cookies=void 0)},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 _(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)}),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};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}}}))});
!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,a){"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,a=a&&a.hasOwnProperty("default")?a.default:a;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 s=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}}(a),i=(r=u)&&r.__esModule?r:{default:r};var f=(o=n.createContext(new i.default)).Provider,c=o.Consumer;t.Consumer=c,t.Provider=f});e(s);s.Consumer,s.Provider;var c=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}}(a),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)}),c=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(s.Provider,{value:this.cookies},this.props.children)},e}(o.Component);t.default=c,e.exports=t.default});e(c);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,c=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,a=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 c:case f:return e;default:switch(e=e&&e.$$typeof){case a:case l:case u:return e;default:return t}}case n:return t}}}t.typeOf=d,t.AsyncMode=s,t.ContextConsumer=a,t.ContextProvider=u,t.Element=o,t.ForwardRef=l,t.Fragment=i,t.Profiler=c,t.Portal=n,t.StrictMode=f,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===s||e===c||e===f||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===u||e.$$typeof===a||e.$$typeof===l)},t.isAsyncMode=function(e){return d(e)===s},t.isContextConsumer=function(e){return d(e)===a},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)===c},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 l(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=l({},i.ForwardRef,(l(n={},"$$typeof",!0),l(n,"render",!0),n)),m=Object.defineProperty,v=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=v(r);O&&(i=i.concat(O(r)));for(var f=y[t.$$typeof]||p,c=y[r.$$typeof]||p,u=0;u<i.length;++u){var a=i[u];if(!(d[a]||o&&o[a]||c&&c[a]||f&&f[a])){var s=P(r,a);try{m(t,a,s)}catch(e){}}}return t}return t},j=t(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(i){var r=i.displayName||i.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(){this.props.cookies.addChangeListener(this.onChange)},e.prototype.unlisten=function(e){(e||this.props.cookies).removeChangeListener(this.onChange)},e.prototype.componentDidMount=function(){this.listen()},e.prototype.componentDidUpdate=function(e){e.cookies!==this.props.cookies&&(this.unlisten(e.cookies),this.listen())},e.prototype.componentWillUnmount=function(){this.unlisten()},e.prototype.render=function(){var e=this.props,t=e.forwardedRef,r=e.cookies,o=u(e,["forwardedRef","cookies"]),n=r.getAll();return f.createElement(i,c({},o,{ref:t,cookies:r,allCookies:n}))},e.displayName="withCookies("+r+")",e.WrapperComponent=i,e}(f.Component),e=f.forwardRef(function(t,r){return f.createElement(s.Consumer,null,function(e){return f.createElement(o,c({cookies:e},t,{forwardedRef:r}))})});return _(e,i,{WrappedComponent:!0})};var f=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}}(a);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)}),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};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(c),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