micro-memoize
Advanced tools
Comparing version 3.0.0-beta.0 to 3.0.0-beta.1
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
/*! ***************************************************************************** | ||
@@ -271,3 +273,4 @@ Copyright (c) Microsoft Corporation. All rights reserved. | ||
module.exports = createMemoizedFunction; | ||
exports.orderByLru = orderByLru; | ||
exports.default = createMemoizedFunction; | ||
//# sourceMappingURL=micro-memoize.cjs.js.map |
@@ -270,2 +270,3 @@ /*! ***************************************************************************** | ||
export default createMemoizedFunction; | ||
export { orderByLru }; | ||
//# sourceMappingURL=micro-memoize.esm.js.map |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
(global = global || self, global['micro-memoize'] = factory()); | ||
}(this, function () { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(global = global || self, factory(global['micro-memoize'] = {})); | ||
}(this, function (exports) { 'use strict'; | ||
@@ -275,5 +275,8 @@ /*! ***************************************************************************** | ||
return createMemoizedFunction; | ||
exports.orderByLru = orderByLru; | ||
exports.default = createMemoizedFunction; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
})); | ||
//# sourceMappingURL=micro-memoize.js.map |
@@ -1,1 +0,1 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e=e||self)["micro-memoize"]=n()}(this,function(){"use strict";function w(e){var o,r=e.maxSize,a="function"==typeof e.isMatchingKey?e.isMatchingKey:(o=e.isEqual,function(e,n){var t=e.length;if(n.length!==t)return!1;if(1===t)return o(e[0],n[0]);for(var i=0;i<t;){if(!o(e[i],n[i]))return!1;i++}return!0});return function(e,n){if(a(e[0],n))return 0;if(1<r)for(var t=r>e.length?e.length:r,i=1;i<t;){if(a(e[i],n))return i;i++}return-1}}function A(e,n){return e===n||e!=e&&n!=n}function E(e,n,t,i,o){for(var r=i;r--;)e.keys[r+1]=e.keys[r],e.values[r+1]=e.values[r];e.keys[0]=n,e.values[0]=t,o<=i&&(e.keys.length=o,e.values.length=o)}var H=Array.prototype.slice;return function(r,e){if(void 0===e&&(e={}),r.isMemoized)return r;var o,a,u,f,c,s,n=e.isEqual,t=void 0===n?A:n,i=e.isMatchingKey,l=e.isPromise,h=void 0!==l&&l,y=e.maxSize,v=void 0===y?1:y,g=e.onCacheAdd,p=e.onCacheChange,d=e.onCacheHit,m=e.transformKey,C=function(e,n){var t={};for(var i in e)t[i]=e[i];for(var i in n)t[i]=n[i];return t}(function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)n.indexOf(i[o])<0&&(t[i[o]]=e[i[o]])}return t}(e,["isEqual","isMatchingKey","isPromise","maxSize","onCacheAdd","onCacheChange","onCacheHit","transformKey"]),{isEqual:t,isMatchingKey:i,isPromise:h,maxSize:v,onCacheAdd:g,onCacheChange:p,onCacheHit:d,transformKey:m}),b=w(C),k=(a=w(o=C),u=o.onCacheChange,f=o.onCacheHit,c="function"==typeof u,s="function"==typeof f,function(t,n){var i=t.keys[0];t.values[0]=t.values[0].then(function(e){return s&&f(t,o,n),c&&u(t,o,n),e}).catch(function(e){var n=a(t.keys,i);throw~n&&(t.keys.splice(n,1),t.values.splice(n,1)),e})}),z=[],O=[],x={keys:z,get size(){return x.keys.length},values:O},K="function"==typeof m,M=!(!m&&!i),P="function"==typeof g,S="function"==typeof p,j="function"==typeof d;function q(){var e=M?H.call(arguments,0):arguments,n=K?m(e):e,t=z.length?b(z,n):-1;if(~t)j&&d(x,C,q),t&&(E(x,z[t],O[t],t,v),S&&p(x,C,q));else{var i=r.apply(this,arguments),o=M?n:H.call(e,0);E(x,o,i,z.length,v),h&&k(x,q),P&&g(x,C,q),S&&p(x,C,q)}return O[0]}return Object.defineProperties(q,{cache:{configurable:!0,value:x},cacheSnapshot:{configurable:!0,get:function(){return{keys:H.call(x.keys,0),size:x.size,values:H.call(x.values,0)}}},isMemoized:{configurable:!0,value:!0},options:{configurable:!0,value:C}}),q}}); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self)["micro-memoize"]={})}(this,function(e){"use strict";function w(e){var r,o=e.maxSize,a="function"==typeof e.isMatchingKey?e.isMatchingKey:(r=e.isEqual,function(e,n){var t=e.length;if(n.length!==t)return!1;if(1===t)return r(e[0],n[0]);for(var i=0;i<t;){if(!r(e[i],n[i]))return!1;i++}return!0});return function(e,n){if(a(e[0],n))return 0;if(1<o)for(var t=o>e.length?e.length:o,i=1;i<t;){if(a(e[i],n))return i;i++}return-1}}function A(e,n){return e===n||e!=e&&n!=n}function E(e,n,t,i,r){for(var o=i;o--;)e.keys[o+1]=e.keys[o],e.values[o+1]=e.values[o];e.keys[0]=n,e.values[0]=t,r<=i&&(e.keys.length=r,e.values.length=r)}var H=Array.prototype.slice;e.orderByLru=E,e.default=function(o,e){if(void 0===e&&(e={}),o.isMemoized)return o;var r,a,u,f,c,s,n=e.isEqual,t=void 0===n?A:n,i=e.isMatchingKey,l=e.isPromise,y=void 0!==l&&l,h=e.maxSize,v=void 0===h?1:h,p=e.onCacheAdd,g=e.onCacheChange,d=e.onCacheHit,m=e.transformKey,C=function(e,n){var t={};for(var i in e)t[i]=e[i];for(var i in n)t[i]=n[i];return t}(function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)n.indexOf(i[r])<0&&(t[i[r]]=e[i[r]])}return t}(e,["isEqual","isMatchingKey","isPromise","maxSize","onCacheAdd","onCacheChange","onCacheHit","transformKey"]),{isEqual:t,isMatchingKey:i,isPromise:y,maxSize:v,onCacheAdd:p,onCacheChange:g,onCacheHit:d,transformKey:m}),b=w(C),k=(a=w(r=C),u=r.onCacheChange,f=r.onCacheHit,c="function"==typeof u,s="function"==typeof f,function(t,n){var i=t.keys[0];t.values[0]=t.values[0].then(function(e){return s&&f(t,r,n),c&&u(t,r,n),e}).catch(function(e){var n=a(t.keys,i);throw~n&&(t.keys.splice(n,1),t.values.splice(n,1)),e})}),z=[],O=[],x={keys:z,get size(){return x.keys.length},values:O},K="function"==typeof m,M=!(!m&&!i),P="function"==typeof p,S="function"==typeof g,j="function"==typeof d;function q(){var e=M?H.call(arguments,0):arguments,n=K?m(e):e,t=z.length?b(z,n):-1;if(~t)j&&d(x,C,q),t&&(E(x,z[t],O[t],t,v),S&&g(x,C,q));else{var i=o.apply(this,arguments),r=M?n:H.call(e,0);E(x,r,i,z.length,v),y&&k(x,q),P&&p(x,C,q),S&&g(x,C,q)}return O[0]}return Object.defineProperties(q,{cache:{configurable:!0,value:x},cacheSnapshot:{configurable:!0,get:function(){return{keys:H.call(x.keys,0),size:x.size,values:H.call(x.values,0)}}},isMemoized:{configurable:!0,value:!0},options:{configurable:!0,value:C}}),q},Object.defineProperty(e,"__esModule",{value:!0})}); |
@@ -99,3 +99,3 @@ { | ||
"types": "./index.d.ts", | ||
"version": "3.0.0-beta.0" | ||
"version": "3.0.0-beta.1" | ||
} |
@@ -9,3 +9,3 @@ import typescript from 'rollup-plugin-typescript'; | ||
output: { | ||
exports: 'default', | ||
exports: 'named', | ||
file: pkg.browser, | ||
@@ -12,0 +12,0 @@ format: 'umd', |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
420463
2530
0