create-memo
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -5,40 +5,2 @@ 'use strict'; | ||
function _slicedToArray(arr, i) { | ||
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); | ||
} | ||
function _arrayWithHoles(arr) { | ||
if (Array.isArray(arr)) return arr; | ||
} | ||
function _iterableToArrayLimit(arr, i) { | ||
var _arr = []; | ||
var _n = true; | ||
var _d = false; | ||
var _e = undefined; | ||
try { | ||
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { | ||
_arr.push(_s.value); | ||
if (i && _arr.length === i) break; | ||
} | ||
} catch (err) { | ||
_d = true; | ||
_e = err; | ||
} finally { | ||
try { | ||
if (!_n && _i["return"] != null) _i["return"](); | ||
} finally { | ||
if (_d) throw _e; | ||
} | ||
} | ||
return _arr; | ||
} | ||
function _nonIterableRest() { | ||
throw new TypeError("Invalid attempt to destructure non-iterable instance"); | ||
} | ||
class LinkedMapCache { | ||
@@ -144,3 +106,5 @@ constructor() { | ||
removeLatterlyUsed() { | ||
const maxSize = this.options.maxSize; | ||
const { | ||
maxSize | ||
} = this.options; | ||
const itemsToRemove = this.map.size - maxSize + 1; | ||
@@ -152,6 +116,5 @@ | ||
for (let i = 0; i < itemsToRemove; i++) { | ||
const _entries$next = entries.next(), | ||
_entries$next$value = _slicedToArray(_entries$next.value, 1), | ||
key = _entries$next$value[0]; | ||
const { | ||
value: [key] | ||
} = entries.next(); | ||
this.clear(key); | ||
@@ -158,0 +121,0 @@ } |
{ | ||
"name": "create-memo", | ||
"description": "Memoization utils for JavaScript", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "esnext": "dist-src/index.js", |
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
0
21979
707