react-cookie
Advanced tools
Comparing version 4.0.3 to 4.1.0
"use strict"; | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
@@ -16,7 +16,7 @@ Object.defineProperty(exports, "__esModule", { | ||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var CookiesContext = React.createContext(new _Cookies["default"]()); | ||
var CookiesContext = /*#__PURE__*/React.createContext(new _Cookies["default"]()); | ||
var Provider = CookiesContext.Provider, | ||
@@ -23,0 +23,0 @@ Consumer = CookiesContext.Consumer; |
"use strict"; | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
@@ -18,5 +18,5 @@ Object.defineProperty(exports, "__esModule", { | ||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
@@ -49,5 +49,3 @@ var __extends = void 0 && (void 0).__extends || function () { | ||
var CookiesProvider = | ||
/** @class */ | ||
function (_super) { | ||
var CookiesProvider = function (_super) { | ||
__extends(CookiesProvider, _super); | ||
@@ -68,3 +66,3 @@ | ||
CookiesProvider.prototype.render = function () { | ||
return React.createElement(_CookiesContext.Provider, { | ||
return /*#__PURE__*/React.createElement(_CookiesContext.Provider, { | ||
value: this.cookies | ||
@@ -71,0 +69,0 @@ }, this.props.children); |
@@ -6,2 +6,8 @@ "use strict"; | ||
}); | ||
var _exportNames = { | ||
Cookies: true, | ||
CookiesProvider: true, | ||
withCookies: true, | ||
useCookies: true | ||
}; | ||
Object.defineProperty(exports, "Cookies", { | ||
@@ -40,2 +46,16 @@ enumerable: true, | ||
var _types = require("./types"); | ||
Object.keys(_types).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _types[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _types[key]; | ||
} | ||
}); | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
import { Cookie, CookieSetOptions } from 'universal-cookie'; | ||
export default function useCookies(dependencies?: string[]): [{ | ||
[name: string]: any; | ||
}, (name: string, value: Cookie, options?: CookieSetOptions) => void, (name: string, options?: CookieSetOptions) => void]; | ||
export default function useCookies<T extends string, U = { | ||
[K in T]?: any; | ||
}>(dependencies?: T[]): [U, (name: T, value: Cookie, options?: CookieSetOptions) => void, (name: T, options?: CookieSetOptions) => void]; |
@@ -28,3 +28,3 @@ "use strict"; | ||
var previousCookiesRef = (0, _react.useRef)(allCookies); | ||
(0, _react.useEffect)(function () { | ||
(0, _react.useLayoutEffect)(function () { | ||
function onChange() { | ||
@@ -31,0 +31,0 @@ var newCookies = cookies.getAll(); |
"use strict"; | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
@@ -12,7 +12,9 @@ Object.defineProperty(exports, "__esModule", { | ||
var hoistStatics = _interopRequireWildcard(require("hoist-non-react-statics")); | ||
var _CookiesContext = require("./CookiesContext"); | ||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
@@ -74,5 +76,2 @@ var __extends = void 0 && (void 0).__extends || function () { | ||
// Only way to make function modules work with both TypeScript and Rollup | ||
var hoistStatics = require('hoist-non-react-statics'); | ||
function withCookies(WrappedComponent) { | ||
@@ -82,5 +81,3 @@ // @ts-ignore | ||
var CookieWrapper = | ||
/** @class */ | ||
function (_super) { | ||
var CookieWrapper = function (_super) { | ||
__extends(CookieWrapper, _super); | ||
@@ -129,3 +126,3 @@ | ||
var allCookies = cookies.getAll(); | ||
return React.createElement(WrappedComponent, __assign({}, restProps, { | ||
return /*#__PURE__*/React.createElement(WrappedComponent, __assign({}, restProps, { | ||
ref: forwardedRef, | ||
@@ -142,5 +139,5 @@ cookies: cookies, | ||
var ForwardedComponent = React.forwardRef(function (props, ref) { | ||
return React.createElement(_CookiesContext.Consumer, null, function (cookies) { | ||
return React.createElement(CookieWrapper, __assign({ | ||
var ForwardedComponent = /*#__PURE__*/React.forwardRef(function (props, ref) { | ||
return /*#__PURE__*/React.createElement(_CookiesContext.Consumer, null, function (cookies) { | ||
return /*#__PURE__*/React.createElement(CookieWrapper, __assign({ | ||
cookies: cookies | ||
@@ -147,0 +144,0 @@ }, props, { |
@@ -5,1 +5,2 @@ export { default as Cookies } from './Cookies'; | ||
export { default as useCookies } from './useCookies'; | ||
export * from './types'; |
import { Cookie, CookieSetOptions } from 'universal-cookie'; | ||
export default function useCookies(dependencies?: string[]): [{ | ||
[name: string]: any; | ||
}, (name: string, value: Cookie, options?: CookieSetOptions) => void, (name: string, options?: CookieSetOptions) => void]; | ||
export default function useCookies<T extends string, U = { | ||
[K in T]?: any; | ||
}>(dependencies?: T[]): [U, (name: T, value: Cookie, options?: CookieSetOptions) => void, (name: T, options?: CookieSetOptions) => void]; |
@@ -1,2 +0,2 @@ | ||
import { useContext, useEffect, useState, useRef, useMemo } from 'react'; | ||
import { useContext, useLayoutEffect, useState, useRef, useMemo } from 'react'; | ||
import CookiesContext from './CookiesContext'; | ||
@@ -11,3 +11,3 @@ export default function useCookies(dependencies) { | ||
var previousCookiesRef = useRef(allCookies); | ||
useEffect(function () { | ||
useLayoutEffect(function () { | ||
function onChange() { | ||
@@ -14,0 +14,0 @@ var newCookies = cookies.getAll(); |
@@ -37,5 +37,4 @@ var __extends = (this && this.__extends) || (function () { | ||
import * as React from 'react'; | ||
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(WrappedComponent) { | ||
@@ -42,0 +41,0 @@ // @ts-ignore |
export * from './es6'; |
"use strict"; | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
@@ -16,7 +16,7 @@ Object.defineProperty(exports, "__esModule", { | ||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var CookiesContext = React.createContext(new _Cookies["default"]()); | ||
var CookiesContext = /*#__PURE__*/React.createContext(new _Cookies["default"]()); | ||
var Provider = CookiesContext.Provider, | ||
@@ -23,0 +23,0 @@ Consumer = CookiesContext.Consumer; |
"use strict"; | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
@@ -18,5 +18,5 @@ Object.defineProperty(exports, "__esModule", { | ||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
@@ -49,5 +49,3 @@ var __extends = void 0 && (void 0).__extends || function () { | ||
var CookiesProvider = | ||
/** @class */ | ||
function (_super) { | ||
var CookiesProvider = function (_super) { | ||
__extends(CookiesProvider, _super); | ||
@@ -68,3 +66,3 @@ | ||
CookiesProvider.prototype.render = function () { | ||
return React.createElement(_CookiesContext.Provider, { | ||
return /*#__PURE__*/React.createElement(_CookiesContext.Provider, { | ||
value: this.cookies | ||
@@ -71,0 +69,0 @@ }, this.props.children); |
@@ -6,2 +6,8 @@ "use strict"; | ||
}); | ||
var _exportNames = { | ||
Cookies: true, | ||
CookiesProvider: true, | ||
withCookies: true, | ||
useCookies: true | ||
}; | ||
Object.defineProperty(exports, "Cookies", { | ||
@@ -40,2 +46,16 @@ enumerable: true, | ||
var _types = require("./types"); | ||
Object.keys(_types).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === _types[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _types[key]; | ||
} | ||
}); | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } |
import { Cookie, CookieSetOptions } from 'universal-cookie'; | ||
export default function useCookies(dependencies?: string[]): [{ | ||
[name: string]: any; | ||
}, (name: string, value: Cookie, options?: CookieSetOptions) => void, (name: string, options?: CookieSetOptions) => void]; | ||
export default function useCookies<T extends string, U = { | ||
[K in T]?: any; | ||
}>(dependencies?: T[]): [U, (name: T, value: Cookie, options?: CookieSetOptions) => void, (name: T, options?: CookieSetOptions) => void]; |
@@ -28,3 +28,3 @@ "use strict"; | ||
var previousCookiesRef = (0, _react.useRef)(allCookies); | ||
(0, _react.useEffect)(function () { | ||
(0, _react.useLayoutEffect)(function () { | ||
function onChange() { | ||
@@ -31,0 +31,0 @@ var newCookies = cookies.getAll(); |
"use strict"; | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
@@ -12,7 +12,9 @@ Object.defineProperty(exports, "__esModule", { | ||
var hoistStatics = _interopRequireWildcard(require("hoist-non-react-statics")); | ||
var _CookiesContext = require("./CookiesContext"); | ||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
@@ -74,5 +76,2 @@ var __extends = void 0 && (void 0).__extends || function () { | ||
// Only way to make function modules work with both TypeScript and Rollup | ||
var hoistStatics = require('hoist-non-react-statics'); | ||
function withCookies(WrappedComponent) { | ||
@@ -82,5 +81,3 @@ // @ts-ignore | ||
var CookieWrapper = | ||
/** @class */ | ||
function (_super) { | ||
var CookieWrapper = function (_super) { | ||
__extends(CookieWrapper, _super); | ||
@@ -129,3 +126,3 @@ | ||
var allCookies = cookies.getAll(); | ||
return React.createElement(WrappedComponent, __assign({}, restProps, { | ||
return /*#__PURE__*/React.createElement(WrappedComponent, __assign({}, restProps, { | ||
ref: forwardedRef, | ||
@@ -142,5 +139,5 @@ cookies: cookies, | ||
var ForwardedComponent = React.forwardRef(function (props, ref) { | ||
return React.createElement(_CookiesContext.Consumer, null, function (cookies) { | ||
return React.createElement(CookieWrapper, __assign({ | ||
var ForwardedComponent = /*#__PURE__*/React.forwardRef(function (props, ref) { | ||
return /*#__PURE__*/React.createElement(_CookiesContext.Consumer, null, function (cookies) { | ||
return /*#__PURE__*/React.createElement(CookieWrapper, __assign({ | ||
cookies: cookies | ||
@@ -147,0 +144,0 @@ }, props, { |
{ | ||
"name": "react-cookie", | ||
"version": "4.0.3", | ||
"version": "4.1.0", | ||
"description": "Universal cookies for React", | ||
@@ -5,0 +5,0 @@ "main": "cjs/index.js", |
@@ -86,3 +86,3 @@ <h3 align="center"> | ||
- secure (boolean): Is only accessible through HTTPS? | ||
- httpOnly (boolean): Can only the server access the cookie? | ||
- httpOnly (boolean): Can only the server access the cookie? **Note: You cannot get or set httpOnly cookies from the browser, only the server.** | ||
- sameSite (boolean|none|lax|strict): Strict or Lax enforcement | ||
@@ -101,3 +101,3 @@ | ||
- secure (boolean): Is only accessible through HTTPS? | ||
- httpOnly (boolean): Can only the server access the cookie? | ||
- httpOnly (boolean): Can only the server access the cookie? **Note: You cannot get or set httpOnly cookies from the browser, only the server.** | ||
- sameSite (boolean|none|lax|strict): Strict or Lax enforcement | ||
@@ -151,3 +151,3 @@ | ||
- secure (boolean): Is only accessible through HTTPS? | ||
- httpOnly (boolean): Can only the server access the cookie? | ||
- httpOnly (boolean): Can only the server access the cookie? **Note: You cannot get or set httpOnly cookies from the browser, only the server.** | ||
- sameSite (boolean|none|lax|strict): Strict or Lax enforcement | ||
@@ -166,3 +166,3 @@ | ||
- secure (boolean): Is only accessible through HTTPS? | ||
- httpOnly (boolean): Can only the server access the cookie? | ||
- httpOnly (boolean): Can only the server access the cookie? **Note: You cannot get or set httpOnly cookies from the browser, only the server.** | ||
- sameSite (boolean|none|lax|strict): Strict or Lax enforcement | ||
@@ -169,0 +169,0 @@ |
@@ -7,4 +7,4 @@ (function (global, factory) { | ||
universalCookie = universalCookie && universalCookie.hasOwnProperty('default') ? universalCookie['default'] : universalCookie; | ||
react = react && react.hasOwnProperty('default') ? react['default'] : react; | ||
universalCookie = universalCookie && Object.prototype.hasOwnProperty.call(universalCookie, 'default') ? universalCookie['default'] : universalCookie; | ||
react = react && Object.prototype.hasOwnProperty.call(react, 'default') ? react['default'] : react; | ||
@@ -39,3 +39,3 @@ function unwrapExports (x) { | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
@@ -53,7 +53,7 @@ Object.defineProperty(exports, "__esModule", { | ||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var CookiesContext = React.createContext(new _Cookies["default"]()); | ||
var CookiesContext = /*#__PURE__*/React.createContext(new _Cookies["default"]()); | ||
var Provider = CookiesContext.Provider, | ||
@@ -73,3 +73,3 @@ Consumer = CookiesContext.Consumer; | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
@@ -89,5 +89,5 @@ Object.defineProperty(exports, "__esModule", { | ||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
@@ -120,5 +120,3 @@ var __extends = function () { | ||
var CookiesProvider = | ||
/** @class */ | ||
function (_super) { | ||
var CookiesProvider = function (_super) { | ||
__extends(CookiesProvider, _super); | ||
@@ -139,3 +137,3 @@ | ||
CookiesProvider.prototype.render = function () { | ||
return React.createElement(CookiesContext_1.Provider, { | ||
return /*#__PURE__*/React.createElement(CookiesContext_1.Provider, { | ||
value: this.cookies | ||
@@ -155,41 +153,2 @@ }, this.props.children); | ||
var reactIs_production_min = createCommonjsModule(function (module, exports) { | ||
Object.defineProperty(exports,"__esModule",{value:!0}); | ||
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.suspense_list"): | ||
60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.fundamental"):60117,w=b?Symbol.for("react.responder"):60118,x=b?Symbol.for("react.scope"):60119;function y(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function z(a){return y(a)===m} | ||
exports.typeOf=y;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p; | ||
exports.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===v||a.$$typeof===w||a.$$typeof===x)};exports.isAsyncMode=function(a){return z(a)||y(a)===l};exports.isConcurrentMode=z;exports.isContextConsumer=function(a){return y(a)===k};exports.isContextProvider=function(a){return y(a)===h}; | ||
exports.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return y(a)===n};exports.isFragment=function(a){return y(a)===e};exports.isLazy=function(a){return y(a)===t};exports.isMemo=function(a){return y(a)===r};exports.isPortal=function(a){return y(a)===d};exports.isProfiler=function(a){return y(a)===g};exports.isStrictMode=function(a){return y(a)===f};exports.isSuspense=function(a){return y(a)===p}; | ||
}); | ||
unwrapExports(reactIs_production_min); | ||
var reactIs_production_min_1 = reactIs_production_min.typeOf; | ||
var reactIs_production_min_2 = reactIs_production_min.AsyncMode; | ||
var reactIs_production_min_3 = reactIs_production_min.ConcurrentMode; | ||
var reactIs_production_min_4 = reactIs_production_min.ContextConsumer; | ||
var reactIs_production_min_5 = reactIs_production_min.ContextProvider; | ||
var reactIs_production_min_6 = reactIs_production_min.Element; | ||
var reactIs_production_min_7 = reactIs_production_min.ForwardRef; | ||
var reactIs_production_min_8 = reactIs_production_min.Fragment; | ||
var reactIs_production_min_9 = reactIs_production_min.Lazy; | ||
var reactIs_production_min_10 = reactIs_production_min.Memo; | ||
var reactIs_production_min_11 = reactIs_production_min.Portal; | ||
var reactIs_production_min_12 = reactIs_production_min.Profiler; | ||
var reactIs_production_min_13 = reactIs_production_min.StrictMode; | ||
var reactIs_production_min_14 = reactIs_production_min.Suspense; | ||
var reactIs_production_min_15 = reactIs_production_min.isValidElementType; | ||
var reactIs_production_min_16 = reactIs_production_min.isAsyncMode; | ||
var reactIs_production_min_17 = reactIs_production_min.isConcurrentMode; | ||
var reactIs_production_min_18 = reactIs_production_min.isContextConsumer; | ||
var reactIs_production_min_19 = reactIs_production_min.isContextProvider; | ||
var reactIs_production_min_20 = reactIs_production_min.isElement; | ||
var reactIs_production_min_21 = reactIs_production_min.isForwardRef; | ||
var reactIs_production_min_22 = reactIs_production_min.isFragment; | ||
var reactIs_production_min_23 = reactIs_production_min.isLazy; | ||
var reactIs_production_min_24 = reactIs_production_min.isMemo; | ||
var reactIs_production_min_25 = reactIs_production_min.isPortal; | ||
var reactIs_production_min_26 = reactIs_production_min.isProfiler; | ||
var reactIs_production_min_27 = reactIs_production_min.isStrictMode; | ||
var reactIs_production_min_28 = reactIs_production_min.isSuspense; | ||
var reactIs_development = createCommonjsModule(function (module, exports) { | ||
@@ -202,4 +161,2 @@ | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol | ||
@@ -224,2 +181,3 @@ // nor polyfill, then a plain number is used for performance. | ||
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; | ||
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9; | ||
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; | ||
@@ -231,60 +189,5 @@ var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6; | ||
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. | ||
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE); | ||
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); | ||
} | ||
/** | ||
* Forked from fbjs/warning: | ||
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js | ||
* | ||
* Only change is we use console.warn instead of console.error, | ||
* and do nothing when 'console' is not supported. | ||
* This really simplifies the code. | ||
* --- | ||
* Similar to invariant but only logs a warning if the condition is not met. | ||
* This can be used to log issues in development environments in critical | ||
* paths. Removing the logging code for production environments will keep the | ||
* same logic and follow the same code paths. | ||
*/ | ||
var lowPriorityWarningWithoutStack = function () {}; | ||
{ | ||
var printWarning = function (format) { | ||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
} | ||
var argIndex = 0; | ||
var message = 'Warning: ' + format.replace(/%s/g, function () { | ||
return args[argIndex++]; | ||
}); | ||
if (typeof console !== 'undefined') { | ||
console.warn(message); | ||
} | ||
try { | ||
// --- Welcome to debugging React --- | ||
// This error was thrown as a convenience so that you can use this stack | ||
// to find the callsite that caused this warning to fire. | ||
throw new Error(message); | ||
} catch (x) {} | ||
}; | ||
lowPriorityWarningWithoutStack = function (condition, format) { | ||
if (format === undefined) { | ||
throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument'); | ||
} | ||
if (!condition) { | ||
for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { | ||
args[_key2 - 2] = arguments[_key2]; | ||
} | ||
printWarning.apply(void 0, [format].concat(args)); | ||
} | ||
}; | ||
} | ||
var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack; | ||
function typeOf(object) { | ||
@@ -350,4 +253,5 @@ if (typeof object === 'object' && object !== null) { | ||
if (!hasWarnedAboutDeprecatedIsAsyncMode) { | ||
hasWarnedAboutDeprecatedIsAsyncMode = true; | ||
lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); | ||
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint | ||
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); | ||
} | ||
@@ -395,3 +299,2 @@ } | ||
exports.typeOf = typeOf; | ||
exports.AsyncMode = AsyncMode; | ||
@@ -410,3 +313,2 @@ exports.ConcurrentMode = ConcurrentMode; | ||
exports.Suspense = Suspense; | ||
exports.isValidElementType = isValidElementType; | ||
exports.isAsyncMode = isAsyncMode; | ||
@@ -425,36 +327,36 @@ exports.isConcurrentMode = isConcurrentMode; | ||
exports.isSuspense = isSuspense; | ||
exports.isValidElementType = isValidElementType; | ||
exports.typeOf = typeOf; | ||
})(); | ||
} | ||
}); | ||
var reactIs_development_1 = reactIs_development.AsyncMode; | ||
var reactIs_development_2 = reactIs_development.ConcurrentMode; | ||
var reactIs_development_3 = reactIs_development.ContextConsumer; | ||
var reactIs_development_4 = reactIs_development.ContextProvider; | ||
var reactIs_development_5 = reactIs_development.Element; | ||
var reactIs_development_6 = reactIs_development.ForwardRef; | ||
var reactIs_development_7 = reactIs_development.Fragment; | ||
var reactIs_development_8 = reactIs_development.Lazy; | ||
var reactIs_development_9 = reactIs_development.Memo; | ||
var reactIs_development_10 = reactIs_development.Portal; | ||
var reactIs_development_11 = reactIs_development.Profiler; | ||
var reactIs_development_12 = reactIs_development.StrictMode; | ||
var reactIs_development_13 = reactIs_development.Suspense; | ||
var reactIs_development_14 = reactIs_development.isAsyncMode; | ||
var reactIs_development_15 = reactIs_development.isConcurrentMode; | ||
var reactIs_development_16 = reactIs_development.isContextConsumer; | ||
var reactIs_development_17 = reactIs_development.isContextProvider; | ||
var reactIs_development_18 = reactIs_development.isElement; | ||
var reactIs_development_19 = reactIs_development.isForwardRef; | ||
var reactIs_development_20 = reactIs_development.isFragment; | ||
var reactIs_development_21 = reactIs_development.isLazy; | ||
var reactIs_development_22 = reactIs_development.isMemo; | ||
var reactIs_development_23 = reactIs_development.isPortal; | ||
var reactIs_development_24 = reactIs_development.isProfiler; | ||
var reactIs_development_25 = reactIs_development.isStrictMode; | ||
var reactIs_development_26 = reactIs_development.isSuspense; | ||
var reactIs_development_27 = reactIs_development.isValidElementType; | ||
var reactIs_development_28 = reactIs_development.typeOf; | ||
unwrapExports(reactIs_development); | ||
var reactIs_development_1 = reactIs_development.typeOf; | ||
var reactIs_development_2 = reactIs_development.AsyncMode; | ||
var reactIs_development_3 = reactIs_development.ConcurrentMode; | ||
var reactIs_development_4 = reactIs_development.ContextConsumer; | ||
var reactIs_development_5 = reactIs_development.ContextProvider; | ||
var reactIs_development_6 = reactIs_development.Element; | ||
var reactIs_development_7 = reactIs_development.ForwardRef; | ||
var reactIs_development_8 = reactIs_development.Fragment; | ||
var reactIs_development_9 = reactIs_development.Lazy; | ||
var reactIs_development_10 = reactIs_development.Memo; | ||
var reactIs_development_11 = reactIs_development.Portal; | ||
var reactIs_development_12 = reactIs_development.Profiler; | ||
var reactIs_development_13 = reactIs_development.StrictMode; | ||
var reactIs_development_14 = reactIs_development.Suspense; | ||
var reactIs_development_15 = reactIs_development.isValidElementType; | ||
var reactIs_development_16 = reactIs_development.isAsyncMode; | ||
var reactIs_development_17 = reactIs_development.isConcurrentMode; | ||
var reactIs_development_18 = reactIs_development.isContextConsumer; | ||
var reactIs_development_19 = reactIs_development.isContextProvider; | ||
var reactIs_development_20 = reactIs_development.isElement; | ||
var reactIs_development_21 = reactIs_development.isForwardRef; | ||
var reactIs_development_22 = reactIs_development.isFragment; | ||
var reactIs_development_23 = reactIs_development.isLazy; | ||
var reactIs_development_24 = reactIs_development.isMemo; | ||
var reactIs_development_25 = reactIs_development.isPortal; | ||
var reactIs_development_26 = reactIs_development.isProfiler; | ||
var reactIs_development_27 = reactIs_development.isStrictMode; | ||
var reactIs_development_28 = reactIs_development.isSuspense; | ||
var reactIs = createCommonjsModule(function (module) { | ||
@@ -510,8 +412,11 @@ | ||
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS; | ||
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS; | ||
function getStatics(component) { | ||
// React v16.11 and below | ||
if (reactIs.isMemo(component)) { | ||
return MEMO_STATICS; | ||
} | ||
} // React v16.12 and above | ||
return TYPE_STATICS[component['$$typeof']] || REACT_STATICS; | ||
@@ -567,3 +472,3 @@ } | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
@@ -577,8 +482,10 @@ Object.defineProperty(exports, "__esModule", { | ||
var hoistStatics = _interopRequireWildcard(hoistNonReactStatics_cjs); | ||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var __extends = function () { | ||
@@ -639,5 +546,2 @@ var _extendStatics = function extendStatics(d, b) { | ||
// Only way to make function modules work with both TypeScript and Rollup | ||
function withCookies(WrappedComponent) { | ||
@@ -647,5 +551,3 @@ // @ts-ignore | ||
var CookieWrapper = | ||
/** @class */ | ||
function (_super) { | ||
var CookieWrapper = function (_super) { | ||
__extends(CookieWrapper, _super); | ||
@@ -694,3 +596,3 @@ | ||
var allCookies = cookies.getAll(); | ||
return React.createElement(WrappedComponent, __assign({}, restProps, { | ||
return /*#__PURE__*/React.createElement(WrappedComponent, __assign({}, restProps, { | ||
ref: forwardedRef, | ||
@@ -707,5 +609,5 @@ cookies: cookies, | ||
var ForwardedComponent = React.forwardRef(function (props, ref) { | ||
return React.createElement(CookiesContext_1.Consumer, null, function (cookies) { | ||
return React.createElement(CookieWrapper, __assign({ | ||
var ForwardedComponent = /*#__PURE__*/React.forwardRef(function (props, ref) { | ||
return /*#__PURE__*/React.createElement(CookiesContext_1.Consumer, null, function (cookies) { | ||
return /*#__PURE__*/React.createElement(CookieWrapper, __assign({ | ||
cookies: cookies | ||
@@ -719,3 +621,3 @@ }, props, { | ||
ForwardedComponent.WrappedComponent = CookieWrapper.WrappedComponent; | ||
return hoistNonReactStatics_cjs(ForwardedComponent, WrappedComponent); | ||
return hoistStatics(ForwardedComponent, WrappedComponent); | ||
} | ||
@@ -755,3 +657,3 @@ | ||
var previousCookiesRef = (0, react.useRef)(allCookies); | ||
(0, react.useEffect)(function () { | ||
(0, react.useLayoutEffect)(function () { | ||
function onChange() { | ||
@@ -802,2 +704,8 @@ var newCookies = cookies.getAll(); | ||
var types = /*#__PURE__*/Object.freeze({ | ||
__proto__: null | ||
}); | ||
var cjs = createCommonjsModule(function (module, exports) { | ||
@@ -808,2 +716,8 @@ | ||
}); | ||
var _exportNames = { | ||
Cookies: true, | ||
CookiesProvider: true, | ||
withCookies: true, | ||
useCookies: true | ||
}; | ||
Object.defineProperty(exports, "Cookies", { | ||
@@ -842,2 +756,16 @@ enumerable: true, | ||
Object.keys(types).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
if (key in exports && exports[key] === types[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return types[key]; | ||
} | ||
}); | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
@@ -844,0 +772,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=e||self).ReactCookie=t(e.UniversalCookie,e.React)}(this,function(l,y){"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}l=l&&l.hasOwnProperty("default")?l.default:l,y=y&&y.hasOwnProperty("default")?y.default:y;var p=t(function(e,t){var r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=((r=l)&&r.__esModule?r:{default:r}).default;t.default=o,e.exports=t.default});e(p);var d=t(function(e,t){function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Consumer=t.Provider=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==u(e)&&"function"!=typeof e)return{default:e};var t=f();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=o?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(r,n,i):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(y),n=(r=p)&&r.__esModule?r:{default:r};function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}var i=o.createContext(new n.default),a=i.Provider,c=i.Consumer;t.Consumer=c,t.Provider=a;var s=i;t.default=s});e(d);d.Consumer,d.Provider;var f=t(function(e,t){function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==u(e)&&"function"!=typeof e)return{default:e};var t=f();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=o?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(r,n,i):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(y),n=(r=l)&&r.__esModule?r:{default:r};function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}var i,a,c=(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)});function s(e){var t=a.call(this,e)||this;return e.cookies?t.cookies=e.cookies:t.cookies=new n.default,t}var p=(a=o.Component,c(s,a),s.prototype.render=function(){return o.createElement(d.Provider,{value:this.cookies},this.props.children)},s);t.default=p,e.exports=t.default});e(f);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,u=r?Symbol.for("react.strict_mode"):60108,f=r?Symbol.for("react.profiler"):60114,a=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,s=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,l=r?Symbol.for("react.forward_ref"):60112,y=r?Symbol.for("react.suspense"):60113,d=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,b=r?Symbol.for("react.lazy"):60116,v=r?Symbol.for("react.fundamental"):60117,O=r?Symbol.for("react.responder"):60118,P=r?Symbol.for("react.scope"):60119;function h(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case s:case p:case i:case f:case u:case y:return e;default:switch(e=e&&e.$$typeof){case c:case l:case b:case m:case a:return e;default:return t}}case n:return t}}}function C(e){return h(e)===p}t.typeOf=h,t.AsyncMode=s,t.ConcurrentMode=p,t.ContextConsumer=c,t.ContextProvider=a,t.Element=o,t.ForwardRef=l,t.Fragment=i,t.Lazy=b,t.Memo=m,t.Portal=n,t.Profiler=f,t.StrictMode=u,t.Suspense=y,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===p||e===f||e===u||e===y||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===b||e.$$typeof===m||e.$$typeof===a||e.$$typeof===c||e.$$typeof===l||e.$$typeof===v||e.$$typeof===O||e.$$typeof===P)},t.isAsyncMode=function(e){return C(e)||h(e)===s},t.isConcurrentMode=C,t.isContextConsumer=function(e){return h(e)===c},t.isContextProvider=function(e){return h(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return h(e)===l},t.isFragment=function(e){return h(e)===i},t.isLazy=function(e){return h(e)===b},t.isMemo=function(e){return h(e)===m},t.isPortal=function(e){return h(e)===n},t.isProfiler=function(e){return h(e)===f},t.isStrictMode=function(e){return h(e)===u},t.isSuspense=function(e){return h(e)===y}});e(r);r.typeOf,r.AsyncMode,r.ConcurrentMode,r.ContextConsumer,r.ContextProvider,r.Element,r.ForwardRef,r.Fragment,r.Lazy,r.Memo,r.Portal,r.Profiler,r.StrictMode,r.Suspense,r.isValidElementType,r.isAsyncMode,r.isConcurrentMode,r.isContextConsumer,r.isContextProvider,r.isElement,r.isForwardRef,r.isFragment,r.isLazy,r.isMemo,r.isPortal,r.isProfiler,r.isStrictMode,r.isSuspense;var o=t(function(e,t){});e(o);o.typeOf,o.AsyncMode,o.ConcurrentMode,o.ContextConsumer,o.ContextProvider,o.Element,o.ForwardRef,o.Fragment,o.Lazy,o.Memo,o.Portal,o.Profiler,o.StrictMode,o.Suspense,o.isValidElementType,o.isAsyncMode,o.isConcurrentMode,o.isContextConsumer,o.isContextProvider,o.isElement,o.isForwardRef,o.isFragment,o.isLazy,o.isMemo,o.isPortal,o.isProfiler,o.isStrictMode,o.isSuspense;var n=t(function(e){e.exports=r}),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},m={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},u={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function b(e){return n.isMemo(e)?u:a[e.$$typeof]||i}a[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var v=Object.defineProperty,O=Object.getOwnPropertyNames,P=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,C=Object.getPrototypeOf,_=Object.prototype;var g=function e(t,r,o){if("string"!=typeof r){if(_){var n=C(r);n&&n!==_&&e(t,n,o)}var i=O(r);P&&(i=i.concat(P(r)));for(var u=b(t),f=b(r),a=0;a<i.length;++a){var c=i[a];if(!(m[c]||o&&o[c]||f&&f[c]||u&&u[c])){var s=h(r,c);try{v(t,c,s)}catch(e){}}}}return t},c=t(function(e,t){function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}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=s(e,["forwardedRef","cookies"]),n=r.getAll();return f.createElement(i,c({},o,{ref:t,cookies:r,allCookies:n}))},e.displayName="withCookies("+r+")",e.WrappedComponent=i,e}(f.Component),e=f.forwardRef(function(t,r){return f.createElement(d.Consumer,null,function(e){return f.createElement(o,c({cookies:e},t,{forwardedRef:r}))})});return e.displayName=o.displayName,e.WrappedComponent=o.WrappedComponent,g(e,i)};var f=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==u(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=o?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(r,n,i):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(y);function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}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)},s=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&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r};e.exports=t.default});e(c);var s=t(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){var r=(0,y.useContext)(c.default);if(!r)throw new Error("Missing <CookiesProvider>");var e=r.getAll(),o=(0,y.useState)(e),n=o[0],i=o[1],u=(0,y.useRef)(n);(0,y.useEffect)(function(){function e(){var e=r.getAll();!function(e,t,r){if(!e)return!0;for(var o=0,n=e;o<n.length;o++){var i=n[o];if(t[i]!==r[i])return!0}return!1}(t||null,e,u.current)||i(e),u.current=e}return r.addChangeListener(e),function(){r.removeChangeListener(e)}},[r]);var f=(0,y.useMemo)(function(){return r.set.bind(r)},[r]),a=(0,y.useMemo)(function(){return r.remove.bind(r)},[r]);return[n,f,a]};var r,c=(r=d)&&r.__esModule?r:{default:r};e.exports=t.default});return e(s),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}}),Object.defineProperty(t,"useCookies",{enumerable:!0,get:function(){return i.default}});var r=u(p),o=u(f),n=u(c),i=u(s);function u(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=e||self).ReactCookie=t(e.UniversalCookie,e.React)}(this,function(s,l){"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}s=s&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s,l=l&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l;var c=t(function(e,t){var o;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=((o=s)&&o.__esModule?o:{default:o}).default;t.default=r,e.exports=t.default});e(c);var y=t(function(e,t){function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Consumer=t.Provider=void 0;var o,r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};t=f(t);if(t&&t.has(e))return t.get(e);var o,r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(o in e){var u;"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&((u=n?Object.getOwnPropertyDescriptor(e,o):null)&&(u.get||u.set)?Object.defineProperty(r,o,u):r[o]=e[o])}r.default=e,t&&t.set(e,r);return r}(l),n=(o=c)&&o.__esModule?o:{default:o};function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,o=new WeakMap;return(f=function(e){return e?o:t})(e)}var u=r.createContext(new n.default),r=u.Provider,n=u.Consumer;t.Consumer=n,t.Provider=r,t.default=u});e(y);y.Consumer,y.Provider;var a=t(function(e,t){function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o,r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};t=f(t);if(t&&t.has(e))return t.get(e);var o,r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(o in e){var u;"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&((u=n?Object.getOwnPropertyDescriptor(e,o):null)&&(u.get||u.set)?Object.defineProperty(r,o,u):r[o]=e[o])}r.default=e,t&&t.set(e,r);return r}(l),n=(o=s)&&o.__esModule?o:{default:o};function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,o=new WeakMap;return(f=function(e){return e?o:t})(e)}var u,c,a=(u=function(e,t){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(e,t)},function(e,t){function o(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),a=(c=r.Component,a(p,c),p.prototype.render=function(){return r.createElement(y.Provider,{value:this.cookies},this.props.children)},p);function p(e){var t=c.call(this,e)||this;return e.cookies?t.cookies=e.cookies:t.cookies=new n.default,t}t.default=a,e.exports=t.default});e(a);var o="function"==typeof Symbol&&Symbol.for,r=o?Symbol.for("react.element"):60103,n=o?Symbol.for("react.portal"):60106,u=o?Symbol.for("react.fragment"):60107,i=o?Symbol.for("react.strict_mode"):60108,f=o?Symbol.for("react.profiler"):60114,p=o?Symbol.for("react.provider"):60109,d=o?Symbol.for("react.context"):60110,m=o?Symbol.for("react.async_mode"):60111,b=o?Symbol.for("react.concurrent_mode"):60111,v=o?Symbol.for("react.forward_ref"):60112,O=o?Symbol.for("react.suspense"):60113,P=o?Symbol.for("react.suspense_list"):60120,h=o?Symbol.for("react.memo"):60115,_=o?Symbol.for("react.lazy"):60116,j=o?Symbol.for("react.block"):60121,g=o?Symbol.for("react.fundamental"):60117,w=o?Symbol.for("react.responder"):60118,C=o?Symbol.for("react.scope"):60119;function S(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case m:case b:case u:case f:case i:case O:return e;default:switch(e=e&&e.$$typeof){case d:case v:case _:case h:case p:return e;default:return t}}case n:return t}}}function M(e){return S(e)===b}var k={AsyncMode:m,ConcurrentMode:b,ContextConsumer:d,ContextProvider:p,Element:r,ForwardRef:v,Fragment:u,Lazy:_,Memo:h,Portal:n,Profiler:f,StrictMode:i,Suspense:O,isAsyncMode:function(e){return M(e)||S(e)===m},isConcurrentMode:M,isContextConsumer:function(e){return S(e)===d},isContextProvider:function(e){return S(e)===p},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},isForwardRef:function(e){return S(e)===v},isFragment:function(e){return S(e)===u},isLazy:function(e){return S(e)===_},isMemo:function(e){return S(e)===h},isPortal:function(e){return S(e)===n},isProfiler:function(e){return S(e)===f},isStrictMode:function(e){return S(e)===i},isSuspense:function(e){return S(e)===O},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===u||e===b||e===f||e===i||e===O||e===P||"object"==typeof e&&null!==e&&(e.$$typeof===_||e.$$typeof===h||e.$$typeof===p||e.$$typeof===d||e.$$typeof===v||e.$$typeof===g||e.$$typeof===w||e.$$typeof===C||e.$$typeof===j)},typeOf:S},o=t(function(e,t){}),$=(o.AsyncMode,o.ConcurrentMode,o.ContextConsumer,o.ContextProvider,o.Element,o.ForwardRef,o.Fragment,o.Lazy,o.Memo,o.Portal,o.Profiler,o.StrictMode,o.Suspense,o.isAsyncMode,o.isConcurrentMode,o.isContextConsumer,o.isContextProvider,o.isElement,o.isForwardRef,o.isFragment,o.isLazy,o.isMemo,o.isPortal,o.isProfiler,o.isStrictMode,o.isSuspense,o.isValidElementType,o.typeOf,t(function(e){e.exports=k})),x={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},E={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},W={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},D={};function R(e){return $.isMemo(e)?W:D[e.$$typeof]||x}D[$.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},D[$.Memo]=W;var F=Object.defineProperty,A=Object.getOwnPropertyNames,L=Object.getOwnPropertySymbols,N=Object.getOwnPropertyDescriptor,T=Object.getPrototypeOf,z=Object.prototype;function U(e,t,o){if("string"!=typeof t){var r;!z||(r=T(t))&&r!==z&&U(e,r,o);var n=A(t);L&&(n=n.concat(L(t)));for(var u=R(e),i=R(t),f=0;f<n.length;++f){var c=n[f];if(!(E[c]||o&&o[c]||i&&i[c]||u&&u[c])){var a=N(t,c);try{F(e,c,a)}catch(e){}}}}return e}var q=t(function(e,t){function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(n){var o=n.displayName||n.name,r=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.onChange=function(){e.forceUpdate()},e}return a(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,o=e.cookies,r=s(e,["forwardedRef","cookies"]),e=o.getAll();return u.createElement(n,p({},r,{ref:t,cookies:o,allCookies:e}))},e.displayName="withCookies("+o+")",e.WrappedComponent=n,e}(u.Component),e=u.forwardRef(function(t,o){return u.createElement(y.Consumer,null,function(e){return u.createElement(r,p({cookies:e},t,{forwardedRef:o}))})});return e.displayName=r.displayName,e.WrappedComponent=r.WrappedComponent,f(e,n)};var u=o(l),f=o(U);function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,o=new WeakMap;return(c=function(e){return e?o:t})(e)}function o(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};t=c(t);if(t&&t.has(e))return t.get(e);var o,r,n={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&((r=u?Object.getOwnPropertyDescriptor(e,o):null)&&(r.get||r.set)?Object.defineProperty(n,o,r):n[o]=e[o]);return n.default=e,t&&t.set(e,n),n}var r,a=(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(e,t)},function(e,t){function o(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),p=function(){return(p=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},s=function(e,t){var o={};for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]]);return o};e.exports=t.default});e(q);var V=t(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){var o=(0,l.useContext)(f.default);if(!o)throw new Error("Missing <CookiesProvider>");var e=o.getAll(),r=(0,l.useState)(e),n=r[0],u=r[1],i=(0,l.useRef)(n);(0,l.useLayoutEffect)(function(){function e(){var e=o.getAll();!function(e,t,o){if(!e)return!0;for(var r=0,n=e;r<n.length;r++){var u=n[r];if(t[u]!==o[u])return!0}return!1}(t||null,e,i.current)||u(e),i.current=e}return o.addChangeListener(e),function(){o.removeChangeListener(e)}},[o]);e=(0,l.useMemo)(function(){return o.set.bind(o)},[o]),r=(0,l.useMemo)(function(){return o.remove.bind(o)},[o]);return[n,e,r]};var o,f=(o=y)&&o.__esModule?o:{default:o};e.exports=t.default});e(V);var I=Object.freeze({__proto__:null});return e(t(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var o={Cookies:!0,CookiesProvider:!0,withCookies:!0,useCookies:!0};Object.defineProperty(t,"Cookies",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"CookiesProvider",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"withCookies",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"useCookies",{enumerable:!0,get:function(){return i.default}});var r=f(c),n=f(a),u=f(q),i=f(V);function f(e){return e&&e.__esModule?e:{default:e}}Object.keys(I).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(o,e)||e in t&&t[e]===I[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return I[e]}}))})}))}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93361
1559