Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

memize

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

memize - npm Package Compare versions

Comparing version
1.0.2
to
1.0.3
+4
-0
CHANGELOG.md

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

#### v1.0.3 (2017-08-30)
- Fix: Resolve error which can occur in certain conditions with `maxSize`
#### v1.0.2 (2017-08-24)

@@ -2,0 +6,0 @@

+6
-5

@@ -28,9 +28,10 @@ var memize = (function () {

// Shift tail to previous
if ( node === tail ) {
tail = node.prev;
}
// Surface matched node to head if not already
if ( node !== head ) {
// As tail, shift to previous. Must only shift if not also
// head, since if both head and tail, there is no previous.
if ( node === tail ) {
tail = node.prev;
}
node.prev.next = node.next;

@@ -37,0 +38,0 @@ node.next = head;

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

var memize=function(){"use strict";return function(n,r){function u(){var r,u,i=t,o=arguments.length;n:for(;i;){for(u=0;u<o;u++)if(i.n[u]!==arguments[u]){i=i.r;continue n}return i===e&&(e=i.u),i!==t&&(i.u.r=i.r,i.r=t,i.u=null,t.u=i,t=i),i.l}for(r=new Array(o),u=0;u<o;u++)r[u]=arguments[u];return i={n:r,l:n.apply(null,r)},t?(t.u=i,i.r=t):e=i,f===l?(e=e.u).r=null:f++,t=i,i.l}var l,t,e,f=0;return r&&r.t&&(l=r.t),u.clear=function(){t=null,e=null,f=0},u}}();
var memize=function(){"use strict";return function(n,r){function u(){var r,u,i=t,o=arguments.length;n:for(;i;){for(u=0;u<o;u++)if(i.n[u]!==arguments[u]){i=i.r;continue n}return i!==t&&(i===e&&(e=i.u),i.u.r=i.r,i.r=t,i.u=null,t.u=i,t=i),i.l}for(r=new Array(o),u=0;u<o;u++)r[u]=arguments[u];return i={n:r,l:n.apply(null,r)},t?(t.u=i,i.r=t):e=i,f===l?(e=e.u).r=null:f++,t=i,i.l}var l,t,e,f=0;return r&&r.t&&(l=r.t),u.clear=function(){t=null,e=null,f=0},u}}();

@@ -25,9 +25,10 @@ module.exports = function memize( fn, options ) {

// Shift tail to previous
if ( node === tail ) {
tail = node.prev;
}
// Surface matched node to head if not already
if ( node !== head ) {
// As tail, shift to previous. Must only shift if not also
// head, since if both head and tail, there is no previous.
if ( node === tail ) {
tail = node.prev;
}
node.prev.next = node.next;

@@ -34,0 +35,0 @@ node.next = head;

{
"name": "memize",
"version": "1.0.2",
"version": "1.0.3",
"description": "Unabashedly-barebones memoization library with an aim toward speed",

@@ -5,0 +5,0 @@ "main": "index.js",