@leafygreen-ui/hooks
Advanced tools
Comparing version 4.2.0 to 4.2.1
# @leafygreen-ui/hooks | ||
## 4.2.1 | ||
### Patch Changes | ||
- d5d40791: Pin lodash version to latest to include fix for [prototype pollution attack vulnerability.](https://hackerone.com/reports/712065) | ||
## 4.2.0 | ||
@@ -4,0 +10,0 @@ |
@@ -1,2 +0,10 @@ | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"),require("lodash/debounce"),require("lodash/isEqual"));else if("function"==typeof define&&define.amd)define(["react","lodash/debounce","lodash/isEqual"],t);else{var r="object"==typeof exports?t(require("react"),require("lodash/debounce"),require("lodash/isEqual")):t(e.react,e["lodash/debounce"],e["lodash/isEqual"]);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}("undefined"!=typeof self?self:this,(function(e,t,r){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([function(t,r){t.exports=e},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.options,i=r.enabled,c=void 0===i||i,a=r.dependencies,l=void 0===a?[c,e]:a,d=r.element,s=(0,n.useRef)((function(){}));(0,n.useEffect)((function(){s.current=t}),[t]),(0,n.useEffect)((function(){if(!1!==c){if("once"===c||!0===c){var t=function(e){return s.current(e)},r=u({},o,{once:"once"===c});return(null!=d?d:document).addEventListener(e,t,r),function(){(null!=d?d:document).removeEventListener(e,t,r)}}console.error("Received value of type ".concat(f(c)," for property `enabled`. Expected a boolean."))}}),l)};var n=r(0);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(e){return(f="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)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useEventListener",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"useElementNode",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"useMutationObserver",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"useViewportSize",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"useEscapeKey",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"usePoller",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"usePrevious",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"useObjectDependency",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"useIsomorphicLayoutEffect",{enumerable:!0,get:function(){return d.default}});var n=s(r(1)),o=s(r(3)),u=s(r(4)),i=s(r(5)),f=s(r(7)),c=s(r(8)),a=s(r(9)),l=s(r(10)),d=s(r(12));function s(e){return e&&e.__esModule?e:{default:e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=(i=(0,n.useState)(null),f=2,function(e){if(Array.isArray(e))return e}(i)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,u=void 0;try{for(var i,f=e[Symbol.iterator]();!(n=(i=f.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==f.return||f.return()}finally{if(o)throw u}}return r}}(i,f)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(i,f)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),t=e[0],r=e[1],u=(0,n.useCallback)((function(e){e&&r(e)}),[]);var i,f;return[t,u]};var n=r(0);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){var u=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=(0,n.useState)(),f=o(i,2),c=f[0],a=f[1];return(0,n.useEffect)((function(){if(u){var n=new MutationObserver((function(){a(r.apply(void 0,arguments))}));return e&&n.observe(e,t),function(){return n.disconnect()}}}),[e,t,r,u]),c};var n=r(0);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,u=void 0;try{for(var i,f=e[Symbol.iterator]();!(n=(i=f.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==f.return||f.return()}finally{if(o)throw u}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return u(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=(n=(0,o.useState)(null),c=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,u=void 0;try{for(var i,f=e[Symbol.iterator]();!(n=(i=f.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==f.return||f.return()}finally{if(o)throw u}}return r}}(n,c)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(n,c)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),t=e[0],r=e[1];var n,c;return(0,o.useEffect)((function(){r(f());var e=(0,u.default)((function(){return r(f())}),100);return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]),t};var n,o=r(0),u=(n=r(6))&&n.__esModule?n:{default:n};function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function f(){return{width:window.innerWidth,height:window.innerHeight}}},function(e,r){e.exports=t},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,o=(n=r(1))&&n.__esModule?n:{default:n};var u=function(e,t){return(0,o.default)("keydown",(function(t){return function(e,t){27===e.keyCode&&(e.stopImmediatePropagation(),t())}(t,e)}),t)};t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.interval,n=void 0===r?3e4:r,u=t.immediate,i=void 0===u||u,f=t.enabled,a=void 0===f||f,l=(0,o.useRef)(),d=c(),s=d&&a;(0,o.useEffect)((function(){l.current=e})),(0,o.useEffect)((function(){var e;if(s)return i?o():t(),r;function t(){r(),e=setTimeout(o,n)}function r(){clearTimeout(e)}function o(){var e;Promise.resolve(null===(e=l.current)||void 0===e?void 0:e.call(l)).finally(t)}}),[n,i,s])};var n,o=r(0),u=(n=r(1))&&n.__esModule?n:{default:n};function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,u=void 0;try{for(var i,f=e[Symbol.iterator]();!(n=(i=f.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==f.return||f.return()}finally{if(o)throw u}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function c(){var e=function(){return"visible"===document.visibilityState},t=i((0,o.useState)(!0),2),r=t[0],n=t[1];return(0,o.useEffect)((function(){n(e)}),[]),(0,u.default)("visibilitychange",(function(){n(e)})),r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=(0,n.useRef)();return(0,n.useEffect)((function(){t.current=e})),t.current};var n=r(0)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=(0,o.useRef)();void 0!==t.current&&(0,u.default)(t.current,e)||(t.current=e);return t.current};var n,o=r(0),u=(n=r(11))&&n.__esModule?n:{default:n}},function(e,t){e.exports=r},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(0),o=function(){var e="undefined"==typeof window?n.useEffect:n.useLayoutEffect;return e.apply(void 0,arguments)};t.default=o}])})); | ||
export { default as useEventListener } from './useEventListener'; | ||
export { default as useElementNode } from './useElementNode'; | ||
export { default as useMutationObserver } from './useMutationObserver'; | ||
export { default as useViewportSize } from './useViewportSize'; | ||
export { default as useEscapeKey } from './useEscapeKey'; | ||
export { default as usePoller } from './usePoller'; | ||
export { default as usePrevious } from './usePrevious'; | ||
export { default as useObjectDependency } from './useObjectDependency'; | ||
export { default as useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect'; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@leafygreen-ui/hooks", | ||
"version": "4.2.0", | ||
"version": "4.2.1", | ||
"description": "LeafyGreen UI Kit Custom Hooks", | ||
"main": "./dist/index.js", | ||
"main": "./dist/index.bundle.js", | ||
"types": "./dist/index.d.ts", | ||
@@ -15,5 +15,5 @@ "scripts": { | ||
"dependencies": { | ||
"lodash": "^4.17.15" | ||
"lodash": "^4.17.20" | ||
}, | ||
"gitHead": "dd71a2d404218ccec2e657df9c0263dc1c15b9e0" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
359987
58
903
Updatedlodash@^4.17.20