Socket
Socket
Sign inDemoInstall

lru-cache

Package Overview
Dependencies
0
Maintainers
1
Versions
134
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.3.2 to 7.3.3

15

index.js

@@ -115,2 +115,3 @@ const perf = typeof performance === 'object' && performance &&

}
this.keyMap = new Map()

@@ -224,3 +225,3 @@ this.keyList = new Array(max).fill(null)

while (this.calculatedSize > maxSize) {
this.evict()
this.evict(true)
}

@@ -412,3 +413,3 @@ this.calculatedSize += this.sizes[index]

if (this.size === this.max) {
return this.evict()
return this.evict(false)
}

@@ -425,3 +426,3 @@ if (this.free.length !== 0) {

const val = this.valList[this.head]
this.evict()
this.evict(true)
return val

@@ -431,3 +432,3 @@ }

evict () {
evict (free) {
const head = this.head

@@ -441,2 +442,8 @@ const k = this.keyList[head]

this.removeItemSize(head)
// if we aren't about to use the index, then null these out
if (free) {
this.keyList[head] = null
this.valList[head] = null
this.free.push(head)
}
this.head = this.next[head]

@@ -443,0 +450,0 @@ this.keyMap.delete(k)

{
"name": "lru-cache",
"description": "A cache object that deletes the least-recently-used items.",
"version": "7.3.2",
"version": "7.3.3",
"publishConfig": {

@@ -25,3 +25,4 @@ "tag": "v7.3-backport"

"benchmark": "^2.1.4",
"tap": "^15.1.6"
"heapdump": "^0.3.15",
"tap": "^16.0.1"
},

@@ -36,4 +37,7 @@ "license": "ISC",

"tap": {
"coverage-map": "map.js"
"coverage-map": "map.js",
"node-arg": [
"--expose-gc"
]
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc